Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement