/* * Tinkers Construct * Master build file * * Authors: Sunstrike, ProgWML6 * Help from AbrarSyed */ buildscript { repositories { mavenCentral() maven { name = 'ForgeFS' url = 'http://files.minecraftforge.net/maven' } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.0-SNAPSHOT' } } repositories { ivy { name 'Forge FS legacy' artifactPattern "http://files.minecraftforge.net/[module]/[module]-dev-[revision].[ext]" } ivy { name 'CB FS' artifactPattern "http://www.chickenbones.craftsaddle.org/Files/New_Versions/1.6.4/[module]-dev%20[revision].[ext]" } maven { name 'SlimeKnights Maven FS' url 'http://aeon.sunstrike.io' } maven { name 'ForgeFS' url 'http://files.minecraftforge.net/maven' } maven { name 'MinecraftS3' url 'http://s3.amazonaws.com/Minecraft.Download/libraries' } } apply plugin: 'forge' // define the properties file ext.configFile = file "build.properties" configFile.withReader { // read config. it shall from now on be referenced as simply config or as project.config def prop = new Properties() prop.load(it) project.ext.config = new ConfigSlurper().parse prop } ext.artifact_version_override = 'NotUsed' //gitignored config file -- if this has the entry for override it will override the version for local builds //create a file called version.properties with the line artifact_version_override=NotUsed //replace not used w/ version #'s for manual local overrides ext.configFile2 = file "version.properties" if (configFile2.exists()){ configFile2.withReader { def prop2 = new Properties() prop2.load(it) ext.GIVersionFL = new ConfigSlurper().parse prop2 if (GIVersionFL != null){ project.artifact_version_override = GIVersionFL.artifact_version_override } } } dependencies { compile "mantle:Mantle:${config.mantle_version}:dev" compile name: 'ForgeMultipart', version: "${config.minecraft_version}-${config.FMP_version}", ext: 'jar' compile name: 'CodeChickenLib', version: "${config.minecraft_version}-${config.CCLIB_version}", ext: 'jar' compile name: 'NotEnoughItems', version: "${config.NEI_version}", type: 'jar' } // sets version to the slimeKnights default version format task buildInfo { def cmd = "git rev-parse --short HEAD" def proc = cmd.execute() proc.waitFor() if (proc.exitValue() == 0) { ext.revision = proc.text.trim() } else { ext.revision = "GITBORK" } if (System.getenv().BUILD_NUMBER != null) { ext.buildNum = System.getenv().BUILD_NUMBER } else { ext.buildNum = "DEV" } } ext.artifact_version = 'NFG' if (System.getenv().ARTIFACT_VERSION == null && artifact_version_override == 'NotUsed') { artifact_version = "${project.buildInfo.buildNum}.${project.buildInfo.revision}" } if (System.getenv().ARTIFACT_VERSION != null && artifact_version_override == 'NotUsed') { artifact_version = "${system.getenv().ARTIFACT_VERSION}" } if (artifact_version_override != 'NotUsed') { artifact_version = "${artifact_version_override}" } version = "${config.minecraft_version}-${artifact_version}" minecraft { version = config.minecraft_version + "-" + config.forge_version assetDir = 'run/assets' replace '${version}', project.version } sourceSets { main { resources { srcDir 'resources' } } } processResources { // replace stuff in text files, not binary ones. from(sourceSets.main.resources.srcDirs) { include '**/*.info' // replace version and MCVersion expand 'version':artifact_version,'MCversion':config.minecraft_version } // copy everything else, thats not text from(sourceSets.main.resources.srcDirs) { exclude '**/*.info' } } jar { manifest { attributes 'FMLCorePlugin': 'tconstruct.preloader.TConstructLoaderContainer' attributes 'FMLCorePluginContainsFMLMod': 'true' } } // because the normal output has been made to be obfuscated task deobfJar(type: Jar) { from sourceSets.main.output classifier = 'deobf' } task libJar(type: Jar) { from(sourceSets.main.java) { include "tconstruct/library/*" } classifier = 'lib' } artifacts { archives deobfJar archives libJar }