blob: 7adcd939116137299463ebe64970857583c3d8c4 [file] [log] [blame] [raw]
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
apply plugin: 'scala'
apply plugin: 'forge'
apply plugin: 'idea'
apply plugin: 'maven-publish'
file "build.properties" withReader {
def prop = new Properties()
prop.load(it)
ext.config = new ConfigSlurper().parse prop
}
version = "${config.oc.version}"
group = "li.cil.oc"
archivesBaseName = "OpenComputers"
def getGitRef() {
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (Throwable e) {
return "unknown"
}
}
if (System.getenv("BUILD_NUMBER") != null)
version += ".${System.getenv("BUILD_NUMBER")}"
else
version += "-" + getGitRef()
if (config.oc.subversion != null && config.oc.subversion != "")
version += "-${config.oc.subversion}"
ext.simpleVersion = version
version = "MC${config.minecraft.version}-${project.version}"
runClient {
jvmArgs '-Dfml.coreMods.load=li.cil.oc.common.launch.TransformerLoader'
}
runServer {
jvmArgs '-Dfml.coreMods.load=li.cil.oc.common.launch.TransformerLoader'
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
repositories {
maven {
name = "bc"
url = "http://mod-buildcraft.com/"
}
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven/"
}
maven {
name = "ic2, forestry"
url = "http://maven.ic2.player.to/"
}
maven {
name = "mobius"
url = "http://mobiusstrip.eu/maven"
}
maven {
name = "ue"
url = "http://calclavia.com/maven/"
}
maven {
name "FireBall API Depot"
url "http://dl.tsr.me/artifactory/libs-release-local"
}
maven {
name 'DVS1 Maven FS'
url 'http://dvs1.progwml6.com/files/maven'
}
ivy {
name 'Galacticraft'
artifactPattern "http://ci.cil.li/job/Galacticraft/${config.gc.build}/artifact/build/libs/[module]-1.7-[revision].${config.gc.build}.[ext]"
}
ivy {
name 'Mekanism'
artifactPattern "http://ci.cil.li/job/Mekanism/${config.mekanism.build}/artifact/output/[module]-${config.minecraft.version}-[revision].${config.mekanism.build}.[ext]"
}
ivy {
name 'ProjectRed'
artifactPattern "http://projectredwiki.com/maven/mrtjp/[module]/${config.minecraft.version}-[revision]/[module]-${config.minecraft.version}-[revision]-dev.[ext]"
}
ivy {
name 'immibis'
artifactPattern "https://dl.dropboxusercontent.com/u/2944265/mods/autobuilt/files/[module]-[revision].[ext]"
}
ivy {
name 'CoFHLib'
artifactPattern "http://addons.cursecdn.com/files/${config.cofhlib.cf}/[module]-[revision].[ext]"
}
ivy {
name 'MineFactoryReloaded'
artifactPattern "http://addons.cursecdn.com/files/${config.mfr.cf}/[module]-[revision].[ext]"
}
ivy {
name 'ComputerCraft'
artifactPattern "http://addons.cursecdn.com/files/${config.cc.cf}/[module][revision].[ext]"
}
ivy {
name 'EnderIO'
artifactPattern "http://addons.cursecdn.com/files/${config.eio.cf}/[module]-[revision].[ext]"
}
ivy {
name 'Railcraft'
artifactPattern "http://addons.cursecdn.com/files/${config.rc.cf}/[module]_[revision].[ext]"
}
ivy {
name 'BloodMagic'
artifactPattern "http://addons.cursecdn.com/files/${config.bloodmagic.cf}/[module]-${config.minecraft.version}-[revision].[ext]"
}
}
configurations {
provided
embedded
compile.extendsFrom provided, embedded
}
dependencies {
provided "api:rotarycraft:${config.rotc.version}"
provided "appeng:appliedenergistics2:${config.ae2.version}:dev"
provided "codechicken:CodeChickenLib:${config.minecraft.version}-${config.ccl.version}:dev"
provided "codechicken:EnderStorage:${config.minecraft.version}-${config.es.version}:dev"
provided "codechicken:ForgeMultipart:${config.minecraft.version}-${config.fmp.version}:dev"
provided "codechicken:NotEnoughItems:${config.minecraft.version}-${config.nei.version}:dev"
provided "codechicken:WR-CBE:${config.minecraft.version}-${config.wrcbe.version}:dev"
provided "com.gregoriust.gregtech:gregtech_${config.minecraft.version}:${config.gt.version}:dev"
provided "com.mod-buildcraft:buildcraft:${config.bc.version}:dev"
provided "dev.calclavia.resonantengine:resonant-engine:${config.re.version}:dev"
provided "mcp.mobius.waila:Waila:${config.waila.version}_${config.minecraft.version}:dev"
provided "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev"
provided "net.sengir.forestry:forestry_${config.minecraft.version}:${config.forestry.version}:dev"
provided "tmech:TMechworks:${config.minecraft.version}-${config.tmech.version}:deobf"
provided name: 'GalacticraftCoreAll', version: config.gc.version, ext: 'jar'
provided name: 'MekanismAll', version: config.mekanism.version, ext: 'jar'
provided name: 'ProjectRed', version: config.projred.version, ext: 'jar'
provided name: 'redlogic', version: config.redlogic.version, ext: 'jar'
provided name: 'CoFHLib', version: config.cofhlib.version, ext: 'jar'
provided name: 'MineFactoryReloaded', version: config.mfr.version, ext: 'jar'
provided name: 'ComputerCraft', version: config.cc.version, ext: 'jar'
provided name: 'EnderIO', version: config.eio.version, ext: 'jar'
provided name: 'Railcraft', version: config.rc.version, ext: 'jar'
provided name: 'BloodMagic', version: config.bloodmagic.version, ext: 'jar'
compile 'com.google.code.findbugs:jsr305:1.3.9' // Annotations used by google libs.
embedded files('libs/OpenComputers-JNLua.jar', 'libs/OpenComputers-LuaJ.jar')
}
idea.module.scopes.PROVIDED.plus += [configurations.provided]
// TODO Causes errors on Gradle 2 for me (No such property: allDependencies for class: java.io.File).
//eclipse.classpath.plusConfigurations += [configurations.provided]
minecraft {
version = "${config.minecraft.version}-${config.forge.version}"
replaceIn "li/cil/oc/OpenComputers.scala"
replace "@VERSION@", project.simpleVersion
}
processResources {
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.simpleVersion, 'mcversion': config.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
include 'application.conf'
filter { line ->
line.replaceAll("@VERSION@", project.simpleVersion)
}
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
exclude 'application.conf'
}
}
jar {
exclude "cofh/**"
configurations.embedded.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
classifier = 'universal'
manifest {
attributes FMLCorePlugin: "li.cil.oc.common.launch.TransformerLoader"
attributes FMLCorePluginContainsFMLMod: "true"
}
}
javadoc {
include 'li/cil/oc/api/**'
}
// because the normal default jar task has been modified to be obfuscated
task deobfJar(type: Jar) {
from sourceSets.main.output
exclude "cofh/**"
configurations.embedded.each { dep ->
from(project.zipTree(dep)) {
exclude 'META-INF', 'META-INF/**'
}
}
classifier = 'dev'
manifest {
attributes FMLCorePlugin: "li.cil.oc.common.launch.TransformerLoader"
attributes FMLCorePluginContainsFMLMod: "true"
}
}
task apiJar(type: Jar) {
from sourceSets.main.output
from sourceSets.main.java
classifier = 'api'
include 'li/cil/oc/api/**'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from 'build/docs/javadoc'
classifier 'javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.java
from sourceSets.main.scala
classifier = 'sources'
}
artifacts {
archives deobfJar
archives apiJar
archives javadocJar
archives sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact apiJar
artifact javadocJar
artifact sourcesJar
artifact deobfJar { classifier 'dev' }
}
}
repositories {
maven {
url "${config.maven.url}"
}
}
}
// this is needed for IntelliJ so we don't have to copy over the assets manually every time
idea {
module {
outputDir = file('build/classes/main')
}
}