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 5 years ago
parent ad2424ecd0
commit f5a77fd1e0

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

Loading…
Cancel
Save