Files
gendustry/build.gradle
T

206 lines
5.4 KiB
Groovy

buildscript {
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
repositories {
mavenCentral()
mavenLocal()
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'
file "build.properties" withReader {
def prop = new Properties()
prop.load(it)
ext.config = new ConfigSlurper().parse prop
}
if (project.hasProperty('forgeOverride')) {
config.forge.version = forgeOverride
}
if (project.hasProperty('buildnum')) {
ext.simpleVersion = "${config.gendustry.version}.${project.buildnum}"
} else {
ext.simpleVersion = "${config.gendustry.version}-DEV"
}
version = simpleVersion + '-mc' + config.minecraft.version
ext.myApiVersion = config.gendustry.api.version
group = "net.bdew"
archivesBaseName = "gendustry-fu"
minecraft {
version = "${config.minecraft.version}-${config.forge.version}"
replace("BDLIB_VER", config.bdlib.version)
replace("GENDUSTRY_VER", simpleVersion.toString())
replace("GENDUSTRY_APIVER", myApiVersion)
}
repositories {
mavenCentral()
mavenLocal()
maven {
name = "bdew"
url = "http://jenkins.bdew.net/maven"
}
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven"
}
maven {
name = "ic2"
url = "http://maven.ic2.player.to/"
}
maven {
name "waila"
url "http://mobiusstrip.eu/maven"
}
ivy {
name "CoFHLib"
artifactPattern "http://addons-origin.cursecdn.com/files/${config.cofhlib.cf}/[module]-[revision](-[classifier])(.[ext])"
}
ivy {
name "BuildCraft"
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision]-[classifier].[ext]"
}
}
dependencies {
compile "net.bdew:bdlib:${config.bdlib.version}-mc${config.minecraft.version}:dev"
compile "codechicken:NotEnoughItems:${config.minecraft.version}-${config.nei.version}:dev"
compile "codechicken:CodeChickenLib:${config.minecraft.version}-${config.ccl.version}:dev"
compile "codechicken:CodeChickenCore:${config.minecraft.version}-${config.ccc.version}:dev"
compile "com.mod-buildcraft:buildcraft:${config.buildcraft.version}:dev"
compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:api"
compile "net.sengir.forestry:forestry_${config.minecraft.version}:${config.forestry.version}:api"
compile module("mcp.mobius.waila:Waila:${config.waila.version}_${config.minecraft.version}") {
transitive = false // WAILA is depending on an invalid combination of CCC/NEI that doesn't run...
}
compile ":CoFHLib:${config.cofhlib.version}:dev@jar"
}
import org.apache.tools.ant.filters.ReplaceTokens
sourceSets {
main {
scala {
srcDir 'src'
}
resources {
srcDir 'resources'
}
output.resourcesDir = output.classesDir // Hack for IDEA
}
}
processResources {
inputs.property "tokens", minecraft.replacements
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
filter(ReplaceTokens, tokens: minecraft.replacements)
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
task apiJar(type: Jar, dependsOn: 'classes') {
from(sourceSets.main.output) {
include 'net/bdew/gendustry/api/**'
}
from(file('api-changelog.md'))
duplicatesStrategy "exclude"
extension = 'jar'
classifier = 'api'
}
task sourceJar(type: Jar) {
classifier "sources"
}
task deobfJar(type: Jar) {
from sourceSets.main.output
exclude "**/*.psd"
classifier "dev"
duplicatesStrategy "exclude"
}
jar {
exclude "**/*.psd"
}
afterEvaluate { project ->
// Fudge the inputs of api/source jars so we get the version after replacements
tasks.getByPath(":sourceJar").from(tasks.getByPath(":sourceMainScala").outputs.files)
tasks.getByPath(":apiJar").from(tasks.getByPath(":sourceMainScala").outputs.files, {
include 'net/bdew/gendustry/api/**'
})
}
artifacts {
archives sourceJar
archives deobfJar
archives apiJar
}
apply plugin: 'maven-publish'
publishing {
publications {
maven(MavenPublication) {
artifact deobfJar
artifact sourceJar
artifact apiJar
}
}
repositories {
maven {
url "file://var/www/maven"
}
}
}
apply plugin: 'curseforge'
curse {
projectId = config.curseforge.id
apiKey = project.hasProperty("curseForgeApiKey") ? project.curseForgeApiKey : ""
releaseType = 'alpha'
artifact = jar
changelog = project.hasProperty("changelog") ? project.changelog : "No changelog available"
additionalArtifact deobfJar
additionalArtifact sourceJar
additionalArtifact apiJar
relatedProject 'bdlib': 'requiredLibrary'
relatedProject 'forestry': 'requiredLibrary'
relatedProject 'cofhcore': 'optionalLibrary'
relatedProject 'buildcraft': 'optionalLibrary'
relatedProject 'notenoughitems': 'optionalLibrary'
relatedProject 'waila': 'optionalLibrary'
}