From 850fe2ce45e3844cac831c8be9e8802cb6495cda Mon Sep 17 00:00:00 2001 From: longnghia <41385034+longnghia@users.noreply.github.com> Date: Sun, 1 Dec 2024 21:48:25 +0700 Subject: [PATCH] feat: auto versionName --- app/build.gradle.kts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f4a1f99..076f293 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -8,12 +8,16 @@ android { namespace = "com.paulcoding.hviewer" compileSdk = 35 + val latestTag = providers.exec { + commandLine = "git describe --tags --abbrev=0".split(' ') + }.standardOutput.asText.get().trim().replaceFirst("v", "") + defaultConfig { applicationId = "com.paulcoding.hviewer" minSdk = 26 targetSdk = 34 versionCode = 1 - versionName = "1.1.0" + versionName = latestTag testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" }