Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- android {
- ...
- buildTypes {
- release {
- minifyEnabled true
- ...
- }
- debug {
- minifyEnabled false
- }
- }
- productFlavors {
- prod {
- applicationId "com.example.myproject"
- versionCode 3
- versionName "1.2.0"
- }
- dev {
- applicationId "com.example.myproject.dev"
- versionCode 15
- versionName "1.3.6"
- }
- }
- applicationVariants.all { variant ->
- variant.outputs.all { output ->
- def project = "myProject"
- def SEP = "_"
- def flavor = variant.productFlavors[0].name
- def buildType = variant.variantData.variantConfiguration.buildType.name
- def version = variant.versionName
- def date = new Date();
- def formattedDate = date.format('ddMMyy_HHmm')
- def newApkName = project + SEP + flavor + SEP + buildType + SEP + version + SEP + formattedDate + ".apk"
- outputFileName = new File(newApkName)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement