Commit cf1db758 authored by Geoffrey Métais's avatar Geoffrey Métais

Calculate revision in gradle and store it in app

parent dfb49064
......@@ -18,6 +18,7 @@ android {
resValue "string", "build_time", buildTime()
resValue "string", "build_host", hostName()
resValue "string", "build_revision", revision()
//Set the build ABI according to build types
tasks.whenTaskAdded { task ->
......@@ -183,4 +184,13 @@ def buildTime() {
def hostName() {
return System.getProperty("user.name") + "@" + InetAddress.localHost.hostName
}
def revision() {
def code = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = code
}
return code.toString()
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment