From aa4ac3f310a2c991dd052d727cf5d617e269a7db Mon Sep 17 00:00:00 2001 From: Progwml6 Date: Thu, 5 Dec 2013 16:34:01 -0500 Subject: [PATCH] update versioning --- .gitignore | 2 ++ build.gradle | 46 ++++++++++++++++++------ src/main/java/tconstruct/TConstruct.java | 2 +- 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 79e2729e..379496f5 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ Thumbs.db /*.iws #Vim backups *~ +#manual version override +version.properties \ No newline at end of file diff --git a/build.gradle b/build.gradle index 84985b7b..f844163e 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,6 @@ repositories { apply plugin: 'forge' - // define the properties file ext.configFile = file "build.properties" @@ -54,6 +53,21 @@ configFile.withReader { 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" @@ -63,12 +77,7 @@ dependencies { } -minecraft { - version = config.minecraft_version + "-" + config.forge_version - assetDir = 'run/assets' -} - -// sets version to the slimeKnights version format +// sets version to the slimeKnights default version format task buildInfo { def cmd = "git rev-parse --short HEAD" def proc = cmd.execute() @@ -85,7 +94,24 @@ task buildInfo { ext.buildNum = "DEV" } } -version = "${minecraft.version}-${project.buildInfo.buildNum}.${project.buildInfo.revision}" +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 { @@ -99,9 +125,8 @@ processResources // replace stuff in text files, not binary ones. from(sourceSets.main.resources.srcDirs) { include '**/*.info' - // replace version and MCVersion - expand 'version':project.version, 'mcversion':project.minecraft.version + expand 'version':artifact_version,'MCversion':config.minecraft_version } // copy everything else, thats not text @@ -110,7 +135,6 @@ processResources } } - jar { manifest { attributes 'FMLCorePlugin': 'tconstruct.preloader.TConstructLoaderContainer' diff --git a/src/main/java/tconstruct/TConstruct.java b/src/main/java/tconstruct/TConstruct.java index b6ff6f87..421873bc 100644 --- a/src/main/java/tconstruct/TConstruct.java +++ b/src/main/java/tconstruct/TConstruct.java @@ -32,7 +32,7 @@ import tconstruct.worldgen.village.*; * @author mDiyo */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.6.X_2.0a", +@Mod(modid = "TConstruct", name = "TConstruct", version = "${version}", dependencies = "required-after:Forge@[8.9,);required-after:Mantle;after:ForgeMultipart;after:MineFactoryReloaded;after:NotEnoughItems;after:Waila;after:ThermalExpansion") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = tconstruct.util.network.TPacketHandler.class) public class TConstruct