build.gradle 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. ext.mainApp = true //设置为true,表示此module为主app module,一直以application方式编译
  2. apply from: rootProject.file('cc-settings.gradle')
  3. apply from: rootProject.file('common-build.gradle')
  4. android {
  5. compileSdkVersion rootProject.compile_sdk_version
  6. defaultConfig {
  7. applicationId rootProject.application_id
  8. minSdkVersion rootProject.min_sdk_version
  9. targetSdkVersion rootProject.target_sdk_version
  10. versionCode rootProject.application_version_code
  11. versionName rootProject.application_version_name
  12. manifestPlaceholders = [
  13. JPUSH_PKGNAME: 'com.quansu.heifengwuliu',
  14. JPUSH_APPKEY : "fe6707d0979ba5e2059b8fb9",//值来自开发者平台取得的AppKey
  15. JPUSH_CHANNEL: "default_developer",
  16. ]
  17. ndk {
  18. //选择要添加的对应 cpu 类型的 .so 库。
  19. abiFilters 'armeabi-v7a'
  20. // 还可以添加 'x86', 'x86_64', 'mips', 'mips64'
  21. }
  22. }
  23. signingConfigs {
  24. release {
  25. keyAlias "heifengwuliu"
  26. keyPassword "HiFengwuliu@###121"
  27. storeFile file("../heifengwuliu.jks")
  28. storePassword "HiFengwuliu@###121"
  29. v2SigningEnabled true
  30. }
  31. }
  32. buildTypes {
  33. debug {
  34. signingConfig signingConfigs.release
  35. versionNameSuffix "-" + name
  36. }
  37. release {
  38. debuggable false
  39. minifyEnabled true
  40. zipAlignEnabled true
  41. shrinkResources true
  42. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  43. signingConfig signingConfigs.release
  44. }
  45. }
  46. //指定release APK名称
  47. applicationVariants.all { variant ->
  48. variant.outputs.all {
  49. // 输出apk名称为 1.0_vivo.apk
  50. def fileName = "${variant.productFlavors[0].name}_${defaultConfig.versionName}.apk"
  51. outputFileName = fileName
  52. }
  53. }
  54. flavorDimensions "version"
  55. //指定渠道
  56. productFlavors {
  57. dev {}
  58. vivo {}
  59. oppo {}
  60. huawei {}
  61. xiaomi {}
  62. coolapk {}
  63. yingyongbao {}
  64. }
  65. // 批量渠道包值替换
  66. //通过脚本获取所有渠道
  67. //在Terminal控制台输入gradlew assembleRelease开始打包
  68. //包生成在build-->outputs-->apk文件夹
  69. productFlavors.all {
  70. // 遍历替换所有渠道
  71. flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL: name]
  72. }
  73. //
  74. //Terminal窗口输入
  75. //打包wandoujia渠道的release版本,执行如下命令
  76. // gradlew assembleWandoujiaRelease
  77. //打包wandoujia渠道的debug版本,执行如下命令
  78. // gradlew assembleWandoujiaDebug
  79. // 只打wandoujia渠道版会生成wandoujia渠道的Release和Debug版本
  80. // gradlew assembleWandoujia
  81. //打全部Release版本
  82. // gradlew assembleRelease
  83. compileOptions {
  84. targetCompatibility 1.8
  85. sourceCompatibility 1.8
  86. }
  87. kotlinOptions {
  88. jvmTarget = '1.8'
  89. }
  90. android.buildFeatures {
  91. dataBinding = true
  92. viewBinding = false
  93. }
  94. }
  95. dependencies {
  96. implementation project(':base')
  97. addComponent 'update'
  98. addComponent 'umeng'
  99. addComponent 'jpush'
  100. addComponent 'gaode'
  101. addComponent 'lookimg'
  102. //微信sdk
  103. implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
  104. //侧滑删除
  105. // implementation 'com.github.mcxtzhang:SwipeDelMenuLayout:V1.2.5'
  106. //时间选择器
  107. implementation 'com.contrarywind:Android-PickerView:4.1.9'
  108. //选择图片
  109. implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.5.8'
  110. //高仿微信朋友圈图片展示效果 ImageWatcher
  111. implementation 'com.github.iielse:ImageWatcher:1.1.5'
  112. //各种图标折线图
  113. implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
  114. }