fixed the user version being incorrectly incremented more than it should
This commit is contained in:
parent
941fb3e754
commit
e5b937b995
1 changed files with 5 additions and 2 deletions
|
|
@ -44,9 +44,12 @@ def computeVersionCode = { ->
|
||||||
}
|
}
|
||||||
|
|
||||||
def computeVersionName = { ->
|
def computeVersionName = { ->
|
||||||
String tagsCount = execThing('git tag').split('\n').size() + 1 // initially, versions were 1-based
|
String tagsCount = execThing('git tag').split('\n').size()
|
||||||
String lastTag = execThing('git describe --tags --abbrev=0')
|
String lastTag = execThing('git describe --tags --abbrev=0')
|
||||||
String commitsSinceLastTag = execThing("git log $lastTag..HEAD --oneline").split('\n').size() + 1
|
|
||||||
|
String gitLogResult = execThing("git log $lastTag..HEAD --oneline")
|
||||||
|
String commitsSinceLastTag = gitLogResult.equals('') ? "0" : gitLogResult.split('\n').size();
|
||||||
|
|
||||||
String currentHash = execThing('git log -1 --format=%h')
|
String currentHash = execThing('git log -1 --format=%h')
|
||||||
|
|
||||||
return "$tagsCount.$commitsSinceLastTag ($currentHash)"
|
return "$tagsCount.$commitsSinceLastTag ($currentHash)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue