Guest User

Untitled

a guest
Oct 16th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. android {
  2. buildTypes {
  3. release {
  4. //批量修改apk名字
  5. applicationVariants.all { variant ->
  6. variant.outputs.all { output ->
  7. def outputFile = output.outputFile
  8. if (outputFile != null && outputFile.name.endsWith('.apk')) {
  9. //获取签名的名字
  10. variant.signingConfig.name
  11. //要被替换的源字符串
  12. def sourceFile = "-${variant.flavorName}-${variant.buildType.name}"
  13. //替换的字符串
  14. def replaceFile = "-v${variant.versionName}-${variant.flavorName}_${variant.buildType.name}"
  15. outputFileName = output.outputFile.name.replace(sourceFile, replaceFile);
  16. }
  17. }
  18. }
  19. }
  20. }
  21.  
  22. flavorDimensions "color"
  23.  
  24. productFlavors {
  25. xiaomi {}
  26. offical {}
  27. baidu {}
  28. googleplay {}
  29. qihu360 {}
  30. huawei {}
  31. sougou {}
  32. wangyi {}
  33. uc {}
  34. meizu {}
  35. ali {}
  36. wandoujia {}
  37. anzhishichang {}
  38. lianxiang {}
  39. yingyongbao {}
  40. oppo {}
  41. sametest {}
  42. }
  43.  
  44. productFlavors.all {
  45. flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
  46. }
  47. }
Add Comment
Please, Sign In to add comment