forked from github/szkolny
[Gradle] Fix showing correct app version on debug builds.
This commit is contained in:
parent
23bd9b8e05
commit
113ecc0ef1
@ -56,7 +56,7 @@ android {
|
||||
flavorDimensions "platform"
|
||||
productFlavors {
|
||||
main {
|
||||
versionName gitInfo.versionHuman
|
||||
versionName "${release.versionName}-${gitInfo.versionSuffix}"
|
||||
}
|
||||
official {}
|
||||
play {}
|
||||
|
@ -97,18 +97,17 @@ private def buildGitInfo() {
|
||||
def tag = getLastTag(repo, git, head)
|
||||
def tagName = tag[1]
|
||||
def tagRevCount = tag[2]
|
||||
def versionName = tagName.replace("v", "")
|
||||
|
||||
def result = [
|
||||
hash : head.objectId.name,
|
||||
branch : repo.branch,
|
||||
dirty : dirty,
|
||||
remotes : remotes,
|
||||
unstaged : status.uncommittedChanges.join("; "),
|
||||
tag : tagName,
|
||||
revCount : tagRevCount,
|
||||
version : """$tagName-$tagRevCount-g${head.objectId.name.substring(0, 8)}""" + (dirty ? ".dirty" : ""),
|
||||
versionHuman: """$versionName-${repo.branch.replace("/", "_")}""" + (dirty ? ".dirty" : "")
|
||||
hash : head.objectId.name,
|
||||
branch : repo.branch,
|
||||
dirty : dirty,
|
||||
remotes : remotes,
|
||||
unstaged : status.uncommittedChanges.join("; "),
|
||||
tag : tagName,
|
||||
revCount : tagRevCount,
|
||||
version : """$tagName-$tagRevCount-g${head.objectId.name.substring(0, 8)}""" + (dirty ? ".dirty" : ""),
|
||||
versionSuffix : """${repo.branch.replace("/", "_")}""" + (dirty ? ".dirty" : "")
|
||||
]
|
||||
return result
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user