build.gradle: properly calculate gitVersionBase if latest tag is not a release tag

This commit is contained in:
Christopher Roy Bratusek 2019-04-20 21:07:49 +02:00 committed by Marvin W
parent 652d7a9104
commit e7f37e17a8
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ def execResult(...args) {
def gmsVersion = "13.2.80"
def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', ''))
def gitVersionBase = execResult('git', 'describe', '--tags', '--abbrev=0').substring(1)
def gitVersionBase = execResult('git', 'describe', '--tags', '--abbrev=0', '--match=v[0-9]*').substring(1)
def gitCommitCount = Integer.parseInt(execResult('git', 'rev-list', '--count', "v$gitVersionBase..HEAD"))
def gitCommitId = execResult('git', 'show-ref', '--abbrev=7', '--head', 'HEAD').split(' ')[0]
def gitDirty = execResult('git', 'status', '--porcelain').size() > 0