Skip to content

Commit

Permalink
update versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Dec 5, 2013
1 parent 6dd171c commit aa4ac3f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -21,3 +21,5 @@ Thumbs.db
/*.iws
#Vim backups
*~
#manual version override
version.properties
46 changes: 35 additions & 11 deletions build.gradle
Expand Up @@ -44,7 +44,6 @@ repositories {


apply plugin: 'forge'

// define the properties file
ext.configFile = file "build.properties"

Expand All @@ -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"
Expand All @@ -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()
Expand All @@ -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 {
Expand All @@ -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
Expand All @@ -110,7 +135,6 @@ processResources
}
}


jar {
manifest {
attributes 'FMLCorePlugin': 'tconstruct.preloader.TConstructLoaderContainer'
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/TConstruct.java
Expand Up @@ -32,7 +32,7 @@
* @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
Expand Down

0 comments on commit aa4ac3f

Please sign in to comment.