Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Rename apk outputs with commit hash #282

Merged
merged 1 commit into from
Nov 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ android {
applicationVariants.configureEach {
outputs.configureEach {
(this as? ApkVariantOutputImpl)?.outputFileName =
"${appName}_${versionName}_${versionCode}_${flavorName}_${buildType.name}.apk"
"${appName}_${versionName}_${versionCode}_${flavorName}_${buildType.name}_$commitHash.apk"
}
}
}
Expand All @@ -69,3 +69,7 @@ dependencies {
fun Project.getSignProperty(key: String, path: String = "gradle/keystore.properties"): String {
return Properties().apply { rootProject.file(path).inputStream().use(::load) }.getProperty(key)
}

val commitHash = providers.exec {
commandLine("git", "rev-parse", "--short=7", "HEAD")
}.standardOutput.asText.get().trim()