build.gradle 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'android-apt'
  3. def releaseTime() {
  4. return new Date().format("yyyy-MM-dd_HH-mm-ss", TimeZone.getTimeZone("GMT+8"))
  5. }
  6. android {
  7. compileSdkVersion rootProject.ext.android.compileSdkVersion
  8. buildToolsVersion rootProject.ext.android.buildToolsVersion
  9. // 关闭PNG合法性检查的
  10. aaptOptions.cruncherEnabled = false
  11. aaptOptions.useNewCruncher = false
  12. // 开启dataBinding
  13. dataBinding.enabled = true
  14. // 移除lint检查的error
  15. lintOptions.abortOnError = false
  16. // 关闭增量编译
  17. // compileOptions.incremental = false
  18. defaultConfig {
  19. applicationId rootProject.ext.android.applicationId
  20. minSdkVersion rootProject.ext.android.minSdkVersion
  21. targetSdkVersion rootProject.ext.android.targetSdkVersion
  22. versionCode 9
  23. versionName "1.0"
  24. // dex突破65535的限制
  25. multiDexEnabled true //
  26. // alibaba路由跳转添加以来
  27. javaCompileOptions {
  28. annotationProcessorOptions {
  29. arguments = [ moduleName : project.getName() ]
  30. }
  31. }
  32. ndk {
  33. // 设置支持的 SO 库构架
  34. abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a'//, 'x86', 'x86_64', 'mips', 'mips64'
  35. }
  36. }
  37. compileOptions {
  38. encoding "UTF-8"
  39. }
  40. signingConfigs {
  41. debug {
  42. // No debug config
  43. // 签名store文件路径
  44. storeFile file(rootProject.ext.android.storeFile)
  45. // 签名store文件的密码
  46. storePassword rootProject.ext.android.storePassword
  47. // 别名
  48. keyAlias rootProject.ext.android.keyAlias
  49. // 别名的密码
  50. keyPassword rootProject.ext.android.keyPassword
  51. }
  52. // 正式版
  53. release {
  54. // 签名store文件路径
  55. storeFile file(rootProject.ext.android.storeFile)
  56. // 签名store文件的密码
  57. storePassword rootProject.ext.android.storePassword
  58. // 别名
  59. keyAlias rootProject.ext.android.keyAlias
  60. // 别名的密码
  61. keyPassword rootProject.ext.android.keyPassword
  62. }
  63. }
  64. buildTypes {
  65. debug {
  66. // 显示Log
  67. buildConfigField "boolean", "LOG_DEBUG", "true"
  68. signingConfig signingConfigs.debug
  69. // 版本名后缀
  70. versionNameSuffix "-debug"
  71. // 是否混淆
  72. minifyEnabled false
  73. // zipAlign优化
  74. zipAlignEnabled false
  75. // 是否可以debug
  76. debuggable true
  77. jniDebuggable true
  78. // 移除无用的resource文件
  79. shrinkResources false
  80. buildConfigField "boolean", "isRelease", 'false'
  81. }
  82. release {
  83. // 不显示Log
  84. buildConfigField "boolean", "LOG_DEBUG", "false"
  85. signingConfig signingConfigs.release
  86. // 是否混淆
  87. minifyEnabled true
  88. // zipAlign优化
  89. zipAlignEnabled true
  90. // 移除无用的resource文件
  91. shrinkResources true
  92. buildConfigField "boolean", "isRelease", 'true'
  93. // 混淆配置文件的位置
  94. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  95. applicationVariants.all { variant ->
  96. variant.outputs.each { output ->
  97. def outputFile = output.outputFile
  98. if (outputFile != null && outputFile.name.endsWith('.apk')) {
  99. // 输出apk名称为 Ultron_v1.0_2016-04-15_wandoujia.apk
  100. // 保留基础签名版本
  101. def fileName
  102. if (variant.productFlavors[0].name == 'app') {
  103. fileName = "app-release.apk"
  104. } else {
  105. fileName = "Small_v${defaultConfig.versionName}_${releaseTime()}_${variant.productFlavors[0].name}.apk"
  106. }
  107. output.outputFile = new File(outputFile.parent, fileName)
  108. }
  109. }
  110. }
  111. }
  112. }
  113. /*
  114. // 分模块,根据是否是debug,标识是 application 还是 library
  115. println rootProject.ext.isDebug.toBoolean()
  116. if (rootProject.ext.isDebug.toBoolean()) {
  117. apply plugin: 'com.android.application'
  118. } else {
  119. apply plugin: 'com.android.library'
  120. }
  121. // 分模块,根据是否是debug,使用不同的 Manifest
  122. sourceSets {
  123. main {
  124. if (rootProject.ext.isDebug.toBoolean()) {
  125. manifest.srcFile 'src/main/debug/AndroidManifest.xml'
  126. } else {
  127. manifest.srcFile 'src/main/release/AndroidManifest.xml'
  128. java {
  129. exclude 'debug/**'
  130. }
  131. }
  132. }
  133. }*/
  134. // 多渠道打包
  135. productFlavors {
  136. GooglePlay {}
  137. umeng {}
  138. wandoujia {}
  139. qihu360 {}
  140. baidu {}
  141. xiaomi {}
  142. tencent {}
  143. qq{}
  144. s360{}
  145. ali{}
  146. anzhi{}
  147. sougou{}
  148. huawei{}
  149. oppo{}
  150. xiaomi{}
  151. vivo{}
  152. lenovo{}
  153. letv{}
  154. liqu{}
  155. coolapk{}
  156. gfan{}
  157. mopo{}
  158. eoe{}
  159. pc6{}
  160. nduo{}
  161. appfun{}
  162. app {}
  163. productFlavors.all {
  164. flavor ->
  165. flavor.manifestPlaceholders = [APP_CHANNEL_VALUE: name, UMENG_KEY: rootProject.ext.android.umengKey,
  166. MAP_GD_KEY : rootProject.ext.android.mapGDKey, PARTNER_CODE: rootProject.ext.android.partnerCode
  167. , GETUI_APP_ID: rootProject.ext.android.getuiAppId, GETUI_APP_KEY: rootProject.ext.android.getuiAppKey
  168. , GETUI_APP_SECRET: rootProject.ext.android.getuiAppSecret
  169. , GETUI_APP_MASTER_SECRET: rootProject.ext.android.getuiAppMasterSecret]
  170. }
  171. }
  172. }
  173. // 导入本地lib
  174. repositories {
  175. flatDir {
  176. dirs 'libs'
  177. }
  178. }
  179. // 应用 Bugtags 插件
  180. apply plugin: 'com.bugtags.library.plugin'
  181. // Bugtags 插件配置
  182. bugtags {
  183. // 自动上传符号表功能配置,如果需要根据 build varint 配置,请参考帮助中心->符号表->Android 符号表->配置自动上传符号表
  184. // 这里是你的 appKey
  185. appKey "acffe161e4fd4aff25e84f7762b19132"
  186. // 这里是你的 appSecret,管理员在设置页可以查看
  187. appSecret "6dd32ba546080f03e74f57ec4139c19e"
  188. mappingUploadEnabled true
  189. //网络跟踪功能配置(企业版)
  190. trackingNetworkEnabled true
  191. }
  192. dependencies {
  193. compile fileTree(include: ['*.jar'], dir: 'libs')
  194. testCompile 'junit:junit:4.12'
  195. compile project(':logic')
  196. compile project(':network')
  197. // compile project(':payments')
  198. compile project(':tools')
  199. compile project(':views')
  200. compile project(':sTLivenessLibrary')
  201. compile project(':iDCardLib')
  202. compile project(':livenessLib')
  203. //compile project(':permission')
  204. compile 'com.pnikosis:materialish-progress:1.0'
  205. // Sweet Alert Dialog
  206. // compile 'cn.pedant.sweetalert:library:1.3'
  207. compile(name: 'sweet-alert-v1.0', ext: 'aar')
  208. // 底部导航栏 https://github.com/Ashok-Varma/BottomNavigation
  209. compile 'com.ashokvarma.android:bottom-navigation-bar:1.3.0'
  210. // Banner https://github.com/youth5201314/banner
  211. compile 'com.youth.banner:banner:1.4.1'
  212. // 图片加载
  213. compile rootProject.ext.dependencies["glide"]
  214. // OKHttp方式加载网络图片
  215. compile rootProject.ext.dependencies["glide-okhttp3-integration"]
  216. // 强大的 RecyclerView 适配器 https://github.com/CymChad/BaseRecyclerViewAdapterHelper
  217. compile rootProject.ext.dependencies["baseRecyclerViewAdapterHelper"]
  218. // 粘性头部 https://github.com/timehop/sticky-headers-recyclerview
  219. compile rootProject.ext.dependencies["stickyHeadersRecyclerView"]
  220. // DatePick 效果的弹出选择框
  221. compile rootProject.ext.dependencies["pickerView"]
  222. //仿支付宝密码
  223. compile rootProject.ext.dependencies["GridPasswordView"]
  224. // URL路由
  225. compile rootProject.ext.dependencies["activityRouter"]
  226. // android权限管理 https://github.com/yanzhenjie/AndPermission
  227. //compile rootProject.ext.dependencies["permission"]
  228. apt rootProject.ext.dependencies["activityRouter-compiler"]
  229. // URL路由
  230. compile rootProject.ext.dependencies["ARouter"]
  231. apt rootProject.ext.dependencies["ARouter-compiler"]
  232. // Bugtags
  233. compile 'com.bugtags.library:bugtags-lib:latest.integration'
  234. compile files('libs/mta-sdk-1.6.2.jar')
  235. compile 'com.joanzapata.iconify:android-iconify:2.2.2'
  236. compile(name: 'livebodylibrary-release', ext: 'aar')
  237. //compile files('libs/library-2.4.0.jar')
  238. compile files('libs/FridaySDK_V1.0.0.jar')
  239. // 集成个推maven 库
  240. compile 'com.getui:sdk-for-google-play:2.10.3.1'
  241. compile 'com.youth.banner:banner:1.4.1'
  242. compile files('libs/alipaySdk-20170725.jar')
  243. compile files('libs/baiqishi-risk-sdk-2.2.1.jar')
  244. }