From f5a77fd1e07af1926490ed4361bee24de43103f2 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 11 Jun 2020 15:10:24 +0200 Subject: [PATCH] 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 --- android/build.gradle | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 44e562d..de68a81 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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