SHARE
TWEET

Untitled

a guest Sep 16th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. android {
  2.  
  3.     ...
  4.  
  5.     buildTypes {
  6.         release {
  7.             minifyEnabled true
  8.             ...
  9.         }
  10.         debug {
  11.             minifyEnabled false
  12.         }
  13.     }
  14.  
  15.     productFlavors {
  16.         prod {
  17.             applicationId "com.example.myproject"
  18.             versionCode 3
  19.             versionName "1.2.0"
  20.         }
  21.         dev {
  22.             applicationId "com.example.myproject.dev"
  23.             versionCode 15
  24.             versionName "1.3.6"
  25.         }
  26.     }
  27.  
  28.     applicationVariants.all { variant ->
  29.         variant.outputs.all { output ->
  30.             def project = "myProject"
  31.             def SEP = "_"
  32.             def flavor = variant.productFlavors[0].name
  33.             def buildType = variant.variantData.variantConfiguration.buildType.name
  34.             def version = variant.versionName
  35.             def date = new Date();
  36.             def formattedDate = date.format('ddMMyy_HHmm')
  37.  
  38.             def newApkName = project + SEP + flavor + SEP + buildType + SEP + version + SEP + formattedDate + ".apk"
  39.  
  40.             outputFileName = new File(newApkName)
  41.         }
  42.     }
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top