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"
|
flavorDimensions "platform"
|
||||||
productFlavors {
|
productFlavors {
|
||||||
main {
|
main {
|
||||||
versionName gitInfo.versionHuman
|
versionName "${release.versionName}-${gitInfo.versionSuffix}"
|
||||||
}
|
}
|
||||||
official {}
|
official {}
|
||||||
play {}
|
play {}
|
||||||
|
@ -97,18 +97,17 @@ private def buildGitInfo() {
|
|||||||
def tag = getLastTag(repo, git, head)
|
def tag = getLastTag(repo, git, head)
|
||||||
def tagName = tag[1]
|
def tagName = tag[1]
|
||||||
def tagRevCount = tag[2]
|
def tagRevCount = tag[2]
|
||||||
def versionName = tagName.replace("v", "")
|
|
||||||
|
|
||||||
def result = [
|
def result = [
|
||||||
hash : head.objectId.name,
|
hash : head.objectId.name,
|
||||||
branch : repo.branch,
|
branch : repo.branch,
|
||||||
dirty : dirty,
|
dirty : dirty,
|
||||||
remotes : remotes,
|
remotes : remotes,
|
||||||
unstaged : status.uncommittedChanges.join("; "),
|
unstaged : status.uncommittedChanges.join("; "),
|
||||||
tag : tagName,
|
tag : tagName,
|
||||||
revCount : tagRevCount,
|
revCount : tagRevCount,
|
||||||
version : """$tagName-$tagRevCount-g${head.objectId.name.substring(0, 8)}""" + (dirty ? ".dirty" : ""),
|
version : """$tagName-$tagRevCount-g${head.objectId.name.substring(0, 8)}""" + (dirty ? ".dirty" : ""),
|
||||||
versionHuman: """$versionName-${repo.branch.replace("/", "_")}""" + (dirty ? ".dirty" : "")
|
versionSuffix : """${repo.branch.replace("/", "_")}""" + (dirty ? ".dirty" : "")
|
||||||
]
|
]
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user