Guest User

Untitled

a guest
Nov 24th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. buildTypes {
  2. applicationVariants.all { variant ->
  3. def oldFile = variant.outputs.outputFile.get(0)
  4. def newFile = new File(
  5. oldFile.parent,
  6. oldFile.name.replace(".apk", "-" + defaultConfig.versionName + ".apk"))
  7.  
  8. variant.outputs.outputFile.set(0, newFile)
  9. }
  10.  
  11. android {
  12. applicationVariants.all { variant ->
  13. variant.outputs.each { output ->
  14. output.outputFile = new File(
  15. output.outputFile.parent,
  16. output.outputFile.name.replace(".apk", "-${variant.versionName}.apk"))
  17. }
  18. }
  19. }
  20.  
  21. applicationVariants.all { variant ->
  22. variant.outputs.each { output ->
  23. output.outputFile = new File(
  24. output.outputFile.parent,
  25. output.outputFile.name.replace("-assistant", "-assistant-${versionName}"))
  26. }
  27. }
  28.  
  29. applicationVariants.all { variant ->
  30. variant.outputs.all { output ->
  31. outputFileName = "myapp-${variant.versionName}-${variant.name}.apk"
  32. }
  33. }
Add Comment
Please, Sign In to add comment