fix version name

This commit is contained in:
Li ZongYing
2024-03-16 16:17:10 +08:00
parent 9450de2c91
commit 0335f58a12
+2 -2
View File
@@ -71,7 +71,7 @@ android {
static def VersionCode() {
try {
def process = 'git rev-list --count HEAD'.execute()
def process = "git describe --tags --always | sed 's/v/ /g' | sed 's/\\./ /g' | sed 's/-/ /g' | awk '{print \$1*16777216+\$2*65536+\$3*256+\$4}'".execute()
process.waitFor()
return process.text.toInteger()
} catch (ignored) {
@@ -81,7 +81,7 @@ static def VersionCode() {
static def VersionName() {
try {
def process = "git describe --tags --always | sed 's/v/ /g' | sed 's/\\./ /g' | sed 's/-/ /g' | awk '{print \$1*16777216+\$2*65536+\$3*256+\$4}'".execute()
def process = "git describe --tags --always".execute()
process.waitFor()
return process.text.trim() - "v"
} catch (ignored) {