Skip to content

Instantly share code, notes, and snippets.

@zhangzhibin
Last active July 16, 2021 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhangzhibin/26cbcc017c6ac599074617937f5a3834 to your computer and use it in GitHub Desktop.
Save zhangzhibin/26cbcc017c6ac599074617937f5a3834 to your computer and use it in GitHub Desktop.
set better name for output file in android studio with build.gradle https://xmanyou.com/android-studio-build-file-with-better-name/
defaultConfig {
applicationId "com.xmanyou.my.game"
minSdkVersion 21
targetSdkVersion 30
versionCode 28
versionName "1.2.5"
def gitCommit = "git rev-parse --short HEAD".execute().text.trim()
archivesBaseName = "${defaultConfig.applicationId}-${defaultConfig.versionName}v${defaultConfig.versionCode}-${gitCommit}"
println 'outputFileName: after = ' + archivesBaseName
}
// the output will be:
// com.xmanyou.my.game-1.2.5v28-943fbca-release.apk
// or
// com.xmanyou.my.game-1.2.5v28-943fbca.aab
// more refer to https://xmanyou.com/android-ru-he-rang-sheng-cheng-de-apk/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment