diff --git a/build.gradle b/build.gradle index 1e9d6d4..50c40bf 100644 --- a/build.gradle +++ b/build.gradle @@ -35,17 +35,39 @@ dependencies { } 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 +} minecraft { - version = '1.6.4-9.11.1.964' + version = config.minecraft_version + "-" + config.forge_version assetDir = 'run/assets' } + // sets version to the slimeKnights version format task buildInfo { def cmd = "git rev-parse --short HEAD" def proc = cmd.execute() - ext.revision = proc.text.trim() + 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" + } } -version = "${minecraft.version}-${System.getenv().BUILD_NUMBER}.${project.buildInfo.revision}" +version = "${minecraft.version}-${project.buildInfo.buildNum}-${project.buildInfo.revision}" + sourceSets { main { diff --git a/build.properties b/build.properties new file mode 100644 index 0000000..83a6056 --- /dev/null +++ b/build.properties @@ -0,0 +1,2 @@ +minecraft_version=1.6.4 +forge_version=9.11.1.964 \ No newline at end of file diff --git a/build.xml b/build.xml deleted file mode 100644 index 8644a14..0000000 --- a/build.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -