mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 04:13:53 +01:00
21 lines
522 B
Groovy
21 lines
522 B
Groovy
ext.getBuildVersion = { ->
|
|
def stdout = new ByteArrayOutputStream()
|
|
exec {
|
|
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
|
standardOutput = stdout
|
|
}
|
|
return stdout.toString().trim()
|
|
}
|
|
|
|
ext.getBranchName = { ->
|
|
try {
|
|
def stdOut = new ByteArrayOutputStream()
|
|
exec {
|
|
commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD'
|
|
standardOutput = stdOut
|
|
}
|
|
return stdOut.toString().trim()
|
|
} catch (ignored) {
|
|
return null
|
|
}
|
|
}
|