From 376bdb3fbc47aec41a3a7cec7df183c5a010fb44 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Sun, 6 Oct 2024 23:21:39 +0530 Subject: [PATCH] gradle: Suffix last git commit's hash into versionName * Only for debug and nightlies Signed-off-by: Aayush Gupta --- app/build.gradle.kts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 2b31a654f..61a983826 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -37,6 +37,10 @@ kotlin { jvmToolchain(17) } +val gitHash: String + get() = project.providers.exec { commandLine("git", "rev-parse", "--short", "HEAD") } + .standardOutput.asText.get().trim() + android { namespace = "com.aurora.store" compileSdk = 35 @@ -92,11 +96,13 @@ android { register("nightly") { initWith(getByName("release")) applicationIdSuffix = ".nightly" + versionNameSuffix = "-$gitHash" } debug { applicationIdSuffix = ".debug" signingConfig = signingConfigs.getByName("aosp") + versionNameSuffix = "-$gitHash" } }