android: use git describe --tags --dirty for the version name

The monotonic version code is still manually bumped.

Updates tailscale/tailscale#431

Signed-off-by: Elias Naur <mail@eliasnaur.com>
pull/2/head
Elias Naur 4 years ago
parent ad2424ecd0
commit f5a77fd1e0

@ -20,13 +20,22 @@ allprojects {
apply plugin: 'com.android.application'
def getVersionName = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--dirty'
standardOutput = stdout
}
return stdout.toString().trim()
}
android {
compileSdkVersion 29
defaultConfig {
minSdkVersion 23
targetSdkVersion 29
versionCode 5
versionName "0.1.5"
versionName getVersionName()
}
compileOptions {
sourceCompatibility 1.8

Loading…
Cancel
Save