blob: 21668cd5d064fb283a6a2e212f54960b9f10f457 [file] [log] [blame] [raw]
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT'
}
}
apply plugin: 'forge'
apply plugin: 'scala'
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}"
repositories {
ivy {
name "minecraftforge"
artifactPattern "http://files.minecraftforge.net/[module]/[module]-dev-[revision].[ext]"
}
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven/"
}
}
dependencies {
compile "codechicken:CodeChickenLib:${config.minecraft.version}-${config.ccl.version}:dev"
compile "codechicken:ForgeMultipart:${config.minecraft.version}-${config.fmp.version}:dev"
compile "codechicken:NotEnoughItems:${config.minecraft.version}-${config.nei.version}:dev"
compile "codechicken:WR-CBE:${config.minecraft.version}-${config.wrcbe.version}:dev"
}
minecraft {
version = "${config.minecraft.version}-${config.forge.version}"
replaceIn "li/cil/oc/OpenComputers.scala"
replace "@VERSION@", project.simpleVersion
if (project.hasProperty("keystore_fingerprint"))
replace "@FINGERPRINT@", keystore_fingerprint
}
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 {
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
classifier = 'deobf'
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}"
}
}
}