mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 20:47:57 +01:00
build.gradle: Record branch in version string
This commit is contained in:
parent
ae6664479e
commit
f8c00533c7
1 changed files with 13 additions and 0 deletions
13
build.gradle
13
build.gradle
|
@ -439,6 +439,19 @@ def getGitCommit() {
|
|||
def proc = cmd.execute()
|
||||
def gitCommit = proc.text.trim()
|
||||
assert !gitCommit.isEmpty()
|
||||
|
||||
def srCmd = 'git symbolic-ref --short HEAD'
|
||||
def srProc = srCmd.execute()
|
||||
srProc.waitForOrKill(10 * 1000)
|
||||
if (srProc.exitValue() == 0) {
|
||||
// Only add the information if the git command was
|
||||
// successful. There may be no symbolic reference for HEAD if
|
||||
// e.g. in detached mode.
|
||||
def symbolicReference = srProc.text.trim()
|
||||
assert !symbolicReference.isEmpty()
|
||||
gitCommit += "-$symbolicReference"
|
||||
}
|
||||
|
||||
gitCommit
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue