mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 02:12:42 -04:00
Adding git ref to version when building locally.
This commit is contained in:
parent
e66c7dc742
commit
4eceafaaa5
15
build.gradle
15
build.gradle
@ -29,8 +29,23 @@ version = "${config.oc.version}"
|
|||||||
group = "li.cil.oc"
|
group = "li.cil.oc"
|
||||||
archivesBaseName = "OpenComputers"
|
archivesBaseName = "OpenComputers"
|
||||||
|
|
||||||
|
def getGitRef() {
|
||||||
|
try {
|
||||||
|
def stdout = new ByteArrayOutputStream()
|
||||||
|
exec {
|
||||||
|
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
||||||
|
standardOutput = stdout
|
||||||
|
}
|
||||||
|
return stdout.toString().trim()
|
||||||
|
} catch (Throwable e) {
|
||||||
|
return "unknown"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (System.getenv("BUILD_NUMBER") != null)
|
if (System.getenv("BUILD_NUMBER") != null)
|
||||||
version += ".${System.getenv("BUILD_NUMBER")}"
|
version += ".${System.getenv("BUILD_NUMBER")}"
|
||||||
|
else
|
||||||
|
version += "-" + getGitRef()
|
||||||
|
|
||||||
if (config.oc.subversion != null && config.oc.subversion != "")
|
if (config.oc.subversion != null && config.oc.subversion != "")
|
||||||
version += "-${config.oc.subversion}"
|
version += "-${config.oc.subversion}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user