blob: 07f917313d207ee8745f1f29b04ac3ce4c25c8e9 [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: '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"
if (System.getenv("BUILD_NUMBER") != null)
version += ".${System.getenv("BUILD_NUMBER")}"
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'
}
repositories {
maven {
name = "bc"
url = "http://mod-buildcraft.com/"
}
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven/"
}
maven {
name = "ic2"
url = "http://maven.ic2.player.to/"
}
maven {
name = "mobius"
url = "http://mobiusstrip.eu/maven"
}
maven {
name = "ue"
url = "http://calclavia.com/maven/"
}
}
configurations {
provided
shade
compile.extendsFrom provided, shade
}
dependencies {
provided "appeng:appliedenergistics2:${config.ae2.version}:dev"
provided "codechicken:CodeChickenLib:${config.minecraft.version}-${config.ccl.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.mod-buildcraft:buildcraft:${config.bc.version}:dev"
provided "dev.calclavia.universalelectricity:universal-electricity:+:dev"
provided "mcp.mobius.waila:Waila:${config.waila.version}_${config.minecraft.version}:dev"
provided "net.industrial-craft:industrialcraft-2:${config.ic2.version}:api"
compile 'com.google.code.findbugs:jsr305:1.3.9' // Annotations used by google libs.
shade files('libs/OpenComputers-JNLua.jar', 'libs/OpenComputers-LuaJ.jar')
}
idea.module.scopes.PROVIDED.plus += configurations.provided
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 {
configurations.shade.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
configurations.shade.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'
}
artifacts {
archives deobfJar
archives apiJar
archives javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact apiJar
artifact javadocJar
artifact deobfJar { classifier 'dev' }
}
}
repositories {
maven {
url "${config.maven.url}"
}
}
}