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

Commit

Permalink
Rename apk outputs with commit hash (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler authored Nov 27, 2022
1 parent b66135e commit 724fb14
Showing 1 changed file with 5 additions and 1 deletion.
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()

1 comment on commit 724fb14

@Goooler
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OLD: DemoApp_1.7.2_107020_prod_release.apk (signature: V1, V2, V3)
NEW: DemoApp_1.7.2_107020_prod_release_724fb14.apk (signature: V1, V2, V3)

          │          compressed          │         uncompressed
          ├───────────┬───────────┬──────┼───────────┬───────────┬──────
 APK      │ old       │ new       │ diff │ old       │ new       │ diff
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
      dex │   1.7 MiB │   1.7 MiB │  0 B │   3.6 MiB │   3.6 MiB │  0 B
     arsc │ 301.8 KiB │ 301.8 KiB │  0 B │ 301.7 KiB │ 301.7 KiB │  0 B
 manifest │   2.8 KiB │   2.8 KiB │  0 B │  10.9 KiB │  10.9 KiB │  0 B
      res │ 267.4 KiB │ 267.4 KiB │  0 B │ 381.6 KiB │ 381.6 KiB │  0 B
    asset │   5.3 KiB │   5.3 KiB │  0 B │     5 KiB │     5 KiB │  0 B
    other │  28.8 KiB │  28.8 KiB │  0 B │  58.7 KiB │  58.7 KiB │  0 B
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │   2.3 MiB │   2.3 MiB │  0 B │   4.4 MiB │   4.4 MiB │  0 B


 DEX     │ old   │ new   │ diff
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0
 strings │ 24822 │ 24822 │ 0 (+0 -0)
   types │  5262 │  5262 │ 0 (+0 -0)
 classes │  4155 │  4155 │ 0 (+0 -0)
 methods │ 24678 │ 24678 │ 0 (+0 -0)
  fields │ 26923 │ 26923 │ 0 (+0 -0)


 ARSC    │ old  │ new  │ diff
─────────┼──────┼──────┼──────
 configs │   50 │   50 │  0
 entries │ 1376 │ 1376 │  0

Please sign in to comment.