Skip to content

Instantly share code, notes, and snippets.

@fuka
Created March 9, 2017 13:31
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 fuka/7e177d82076b0eb53e4c7e49193434c7 to your computer and use it in GitHub Desktop.
Save fuka/7e177d82076b0eb53e4c7e49193434c7 to your computer and use it in GitHub Desktop.
apkの名前をいい感じにする
applicationVariants.all { variant ->
variant.outputs.each { output ->
if (output.outputFile != null && output.outputFile.name.endsWith('.apk')) {
def nameSuffix = variant.buildType.hasProperty('versionNameSuffix') ? variant.buildType.versionNameSuffix : ""
def newName = "${APPLICATION_NAME}-${defaultConfig.versionName}${nameSuffix}.apk"
output.outputFile = new File(output.outputFile.parent, newName)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment