Created
August 18, 2017 12:47
-
-
Save dario61081/a22133887d9bcfcaa4909f5713b2fec0 to your computer and use it in GitHub Desktop.
Custom apk name
This file contains hidden or 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
| buildTypes { | |
| release { | |
| minifyEnabled true | |
| proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
| signingConfig signingConfigs.config | |
| applicationVariants.all { variant -> | |
| variant.outputs.each { output -> | |
| project.ext { appName = 'whpicking' } | |
| def formattedDate = "-" + variant.versionName + "_" + variant.versionCode + "-" + new Date().format('yyyyMMddHHmmss') | |
| def newName = output.outputFile.name | |
| newName = newName.replace("app-", "$project.ext.appName-") | |
| newName = newName.replace("-release", "-release" + formattedDate) | |
| 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