1
0
Fork 0

fixed the user version being incorrectly incremented more than it should

This commit is contained in:
sspanak 2022-08-15 09:48:51 +03:00
parent 941fb3e754
commit e5b937b995

View file

@ -44,9 +44,12 @@ def computeVersionCode = { ->
}
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 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')
return "$tagsCount.$commitsSinceLastTag ($currentHash)"