Add git commit to version and add version to generated replay files

This commit is contained in:
johni0702
2015-06-02 20:33:22 +02:00
parent d96ba1f135
commit 1bc80cc257
5 changed files with 32 additions and 6 deletions

View File

@@ -97,6 +97,19 @@ jar {
}
}
def getGitCommitHash() {
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--always', '--dirty=*'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (e) {
return "unknown"
}
}
processResources
{
// this will ensure that this task is redone when the versions change.
@@ -108,7 +121,7 @@ processResources
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
expand 'version':project.version + '-' + getGitCommitHash(), 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info