Created
March 9, 2017 13:31
-
-
Save fuka/7e177d82076b0eb53e4c7e49193434c7 to your computer and use it in GitHub Desktop.
apkの名前をいい感じにする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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