Version info: show only git describe --tags.

The commitId is included if there are commits after this tag.
This commit is contained in:
Dennis Guse
2021-07-15 19:30:30 +02:00
parent d42d1214ea
commit 684419e86e
+2 -8
View File
@@ -24,13 +24,8 @@ def getVersionName = { ->
commandLine 'git', 'describe', '--tags'
standardOutput = stdout
}
exec {
commandLine 'git', 'log', '--format="%h"', '-n 1'
standardOutput = stdout
}
return stdout.toString().replace('\n', '-').replace('"', '').trim()
}
catch (ignored) {
return stdout.toString().trim()
} catch (ignored) {
return null
}
}
@@ -61,7 +56,6 @@ android {
buildConfigField "String", "VERSION_NAME_FULL", "\"${getVersionName()}\""
minSdkVersion 21
targetSdkVersion 30