build.gradle 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. apply plugin: 'com.android.application'
  2. def releaseTime() {
  3. return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
  4. }
  5. buildscript {
  6. ext {
  7. appId = 'com.ftw.im.junyou' // app的包名,
  8. channel = 'client' // bugly上显示的渠道名,
  9. buglyAppId = '3062b077ab' // bugly配置的appId,
  10. baiduApiKey = '2vlM2itABnPcKg8CWOvKcKY1g19tjfko' // baidu配置的apiKey,
  11. googleApiKey = 'AIzaSyABu5gPAX0xzT1uw-W2q8XKQxxnEBNXSK8' // google地图配置的apiKey,
  12. huaweiAppId = '100871407' // 华为推送配置的appId,
  13. xiaomiAppId = '2882303761518030500' // 小米推送配置的appId,
  14. xiaomiAppKey = '5671803053500' // 小米推送配置的appKey,
  15. meizuAppId = '121401' // 魅族推送配置的appId,
  16. meizuAppKey = '041187021368448a93e4f39e7d0eb3b5' // 魅族推送配置的appKey,
  17. vivoAppId = '12982' // VIVO推送配置的appId,
  18. vivoAppKey = '2f5463ff-31fe-404b-a1b7-3eec2f3790a0' // VIVO推送配置的appKey,
  19. oppoAppKey = 'e532308602074e408c2b1b7d850d96e1' // OPPO推送配置的appKey,
  20. oppoAppSecret = '8e0b3c7b4a7d492390046a158bfccc44' // OPPO推送配置的secret,
  21. wechatAppId = 'wx0699fbc4666ab6e3' // 微信相关的appId,
  22. qqAppId = '101884630' // QQ相关的appId,
  23. buglyAppChannel = channel
  24. date = new Date().format("yyyyMMdd")
  25. buglyVersionNameSuffix = '' + '-' + date
  26. }
  27. }
  28. // 判断存在谷歌服务配置文件才启用谷歌服务,
  29. //def googleJson = file('google-services.json')
  30. //if (googleJson.exists() && googleJson.readLines().any { it.contains(appId) }) {
  31. // apply plugin: 'com.google.gms.google-services'
  32. // // 谷歌服务4.2版本有已知bug会导致其他无关依赖(smack4.3.4)莫名冲突,禁用相关检查解决,
  33. // // https://github.com/invertase/react-native-firebase/issues/1676
  34. // //noinspection UnnecessaryQualifiedReference
  35. // com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
  36. //}
  37. android {
  38. lintOptions {
  39. abortOnError false
  40. checkReleaseBuilds false
  41. }
  42. packagingOptions {
  43. exclude 'META-INF/*.kotlin_module'
  44. }
  45. compileSdkVersion compile_version
  46. defaultConfig {
  47. applicationId appId
  48. versionCode 100
  49. versionName "1.0.0"
  50. minSdkVersion min_version
  51. targetSdkVersion target_version
  52. ndk {
  53. abiFilters "armeabi", "armeabi-v7a", "x86"
  54. // abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
  55. }
  56. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  57. multiDexEnabled = true
  58. buildConfigField('String', "BUGLY_APP_ID", '"' + buglyAppId + '"')
  59. buildConfigField('String', "BUGLY_APP_CHANNEL", '"' + buglyAppChannel + '"')
  60. buildConfigField('String', "XIAOMI_APP_ID", '"' + xiaomiAppId + '"')
  61. buildConfigField('String', "XIAOMI_APP_KEY", '"' + xiaomiAppKey + '"')
  62. buildConfigField('String', "MEIZU_APP_ID", '"' + meizuAppId + '"')
  63. buildConfigField('String', "MEIZU_APP_KEY", '"' + meizuAppKey + '"')
  64. buildConfigField('String', "OPPO_APP_KEY", '"' + oppoAppKey + '"')
  65. buildConfigField('String', "OPPO_APP_SECRET", '"' + oppoAppSecret + '"')
  66. buildConfigField('String', "GOOGLE_API_KEY", '"' + googleApiKey + '"')
  67. buildConfigField('String', "WECHAT_APP_ID", '"' + wechatAppId + '"')
  68. buildConfigField('String', "QQ_APP_ID", '"' + qqAppId + '"')
  69. manifestPlaceholders = [
  70. APP_ID : appId,
  71. BAIDU_API_KEY : baiduApiKey,
  72. VIVO_APP_ID : vivoAppId,
  73. VIVO_APP_KEY : vivoAppKey,
  74. GOOGLE_API_KEY: googleApiKey,
  75. HUAWEI_APP_ID : huaweiAppId,
  76. QQ_APP_ID : qqAppId,
  77. JPUSH_PKGNAME : appId,
  78. JPUSH_APPKEY : "247d5f7506b27d1fb4d0d373", //JPush上注册的包名对应的appkey.
  79. JPUSH_CHANNEL : "developer-default" //暂时填写默认值即可.
  80. ]
  81. resConfigs "en", "zh-rCN", "zh-rTW", "vi", "th", "in"
  82. }
  83. packagingOptions {
  84. pickFirst 'lib/*/libc++_shared.so'
  85. }
  86. // 高版本as中installRelease不会依赖assembleRelease也就不会复制apk,
  87. afterEvaluate {
  88. // 没配置签名的话,就没有installRelease,
  89. if (tasks.findByName('installRelease')) {
  90. installRelease.dependsOn 'assembleRelease'
  91. }
  92. }
  93. // multiDex的一些相关配置,这样配置可以让你的编译速度更快
  94. dexOptions {
  95. // 让它不要对Lib做preDexing
  96. preDexLibraries = false
  97. // 开启incremental dexing,优化编译效率,这个功能android studio默认是关闭的
  98. // incremental true
  99. // 增加java堆内存大小
  100. javaMaxHeapSize "4g"
  101. }
  102. // 单元测试用,
  103. testOptions {
  104. unitTests.returnDefaultValues = true
  105. }
  106. // 进行JAVA 的版本配置,使用对应版本的一些新特性
  107. compileOptions {
  108. sourceCompatibility JavaVersion.VERSION_1_8
  109. targetCompatibility JavaVersion.VERSION_1_8
  110. }
  111. useLibrary 'org.apache.http.legacy'
  112. packagingOptions {
  113. exclude 'META-INF/LICENSE.txt'
  114. exclude 'META-INF/NOTICE.txt'
  115. }
  116. bundle {
  117. // 是否分割多语言包
  118. language {
  119. enableSplit = false
  120. }
  121. // 是否分割资源
  122. density {
  123. enableSplit = true
  124. }
  125. // 是否分割二进制 so 包资源
  126. abi {
  127. enableSplit = true
  128. }
  129. }
  130. signingConfigs {
  131. debug {
  132. storeFile file('debug.keystore')//签名文件路径
  133. }
  134. release {
  135. // storeFile file('debug.keystore')//签名文件路径
  136. // keyAlias "androiddebugkey"
  137. // keyPassword "android"
  138. // storePassword "android"
  139. keyAlias "${KEY_ALIAS}"
  140. keyPassword "${KEY_PASSWORD}"
  141. storeFile file("${STORE_FILE}")
  142. storePassword "${STORE_PASSWORD}"
  143. }
  144. }
  145. buildTypes {
  146. debug {
  147. signingConfig signingConfigs.release
  148. // //是否混淆
  149. // minifyEnabled true
  150. // //Zipalign优化
  151. // zipAlignEnabled true
  152. // //清除未使用的资源
  153. // shrinkResources true
  154. //混淆文件
  155. // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  156. }
  157. release {
  158. //是否混淆
  159. // minifyEnabled true
  160. //Zipalign优化
  161. zipAlignEnabled true
  162. //清除未使用的资源
  163. // shrinkResources true
  164. //混淆文件
  165. // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  166. //签名
  167. signingConfig signingConfigs.release
  168. //gradle 3.0后使用这行代码
  169. android.applicationVariants.all { variant ->
  170. variant.outputs.all {
  171. if (variant.buildType.name.equals('release')) {
  172. outputFileName = "jixin_v${defaultConfig.versionName}_${defaultConfig.versionCode}_${releaseTime()}_release.apk"
  173. } else {
  174. outputFileName = "jixin_v${defaultConfig.versionName}_${defaultConfig.versionCode}_${releaseTime()}_debug.apk"
  175. }
  176. }
  177. }
  178. }
  179. }
  180. buildToolsVersion = '28.0.3'
  181. }
  182. configurations.all {
  183. resolutionStrategy.eachDependency { details ->
  184. // jitsi和imaging两个库都依赖fresco版本冲突了,
  185. if (details.requested.group == 'com.facebook.fresco') {
  186. details.useVersion '2.0.0'
  187. }
  188. }
  189. }
  190. dependencies {
  191. testImplementation 'junit:junit:4.12'
  192. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  193. androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  194. // 1.1.0会导致安卓5上webview崩溃,https://stackoverflow.com/a/58131421
  195. // 准确说是低版本webView的bug,普遍存在国产安卓5上,
  196. //noinspection GradleDependency
  197. implementation 'androidx.appcompat:appcompat:1.0.2'
  198. implementation 'com.google.android.material:material:1.0.0'
  199. implementation 'androidx.recyclerview:recyclerview:1.0.0'
  200. implementation 'androidx.gridlayout:gridlayout:1.0.0'
  201. implementation 'androidx.cardview:cardview:1.0.0'
  202. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  203. implementation 'androidx.multidex:multidex:2.0.1'
  204. implementation 'com.squareup.okhttp3:okhttp:3.2.0'
  205. implementation 'com.github.bumptech.glide:glide:3.7.0'
  206. implementation 'de.greenrobot:eventbus:3.0.0-beta1'
  207. implementation files('libs/android-async-http-1.4.5.jar')
  208. // implementation files('libs/BaiduLBS_Android.jar')
  209. implementation files('libs/fastjson-1.2.40.jar')
  210. implementation files('libs/httpmime-4.2.jar')
  211. implementation files('libs/nineoldandroids.jar')
  212. implementation files('libs/ormlite-android-4.48.jar')
  213. implementation files('libs/ormlite-core-4.48.jar')
  214. implementation files('libs/pinyin4j-2.5.0.jar')
  215. implementation files('libs/universal-image-loader-1.9.0.jar')
  216. // QQ登录,
  217. implementation files('libs/open_sdk_r6199_lite.jar')
  218. // 微信支付/分享,
  219. implementation 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:1.0.2'
  220. // 支付宝 SDK AAR 包所需的配置
  221. implementation files('libs/alipaySdk-15.5.9-20181123210601.aar')
  222. // 小米推送,
  223. implementation files('libs/MiPush_SDK_Client_3_6_18.jar')
  224. // 华为推送,
  225. implementation 'com.huawei.android.hms:push:2.5.2.300'
  226. implementation 'com.huawei.android.hms:base:2.5.2.300'
  227. // 魅族推送,
  228. implementation 'com.meizu.flyme.internet:push-internal:3.8.1@aar'
  229. // vivo推送,
  230. implementation files('libs/vivopushsdk_v2.3.4.jar')
  231. // oppo推送,
  232. implementation files('libs/mcssdk-1.0.1.jar')
  233. // firebase,
  234. implementation 'com.google.firebase:firebase-core:16.0.9'
  235. implementation 'com.google.firebase:firebase-messaging:18.0.0'
  236. // 下拉刷新、视频播放、扫一扫
  237. implementation project(':pullToRefershLibraryMy')
  238. implementation project(':jcvideoplayer-lib')
  239. implementation project(':YZxing-lib')
  240. // 拍照录像
  241. // implementation project(path: ':cameralibrary')
  242. // implementation project(path: ':filterlibrary')
  243. implementation project(':OpenGLlibrary')
  244. // 音视频
  245. implementation project(':meeting')
  246. // 音视频使用jwt传递用户信息,
  247. implementation 'io.jsonwebtoken:jjwt:0.9.1'
  248. // 谷歌地图
  249. // 谷歌服务版本15依赖support-v4版本26
  250. // implementation 'com.google.android.gms:play-services-maps:16.1.0'
  251. // implementation 'com.google.android.gms:play-services-location:16.0.0'
  252. // 协议 protobuf socket
  253. implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.6.1'
  254. implementation group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.6.1'
  255. // 视频缓存 + 视频处理
  256. implementation 'com.danikula:videocache:2.7.1'
  257. implementation 'com.github.yangjie10930:EpMedia:v0.9.5'
  258. // 图片压缩
  259. implementation 'top.zibin:Luban:1.1.3'
  260. // Bitmap二级缓存库
  261. implementation('com.github.chrisbanes.bitmapcache:library:2.3') {
  262. exclude group: 'com.google.android', module: 'support-v4'
  263. }
  264. // 数据库调试库,仅限debug包生效,
  265. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  266. debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
  267. // bugly上报,没配置自动上传mapping,因为测试时自动上传mapping失败,
  268. implementation 'com.tencent.bugly:crashreport:2.6.6'
  269. // HTML解析器
  270. implementation 'org.jsoup:jsoup:1.10.3'
  271. // 角标
  272. implementation "me.leolin:ShortcutBadger:1.1.22"
  273. // 图片编辑库
  274. implementation 'cc.aoeiuv020:imaging:1.0'
  275. // 流式布局
  276. implementation 'com.hyman:flowlayout-lib:1.1.2'
  277. // 带header和footer的GridView
  278. implementation 'in.srain.cube:grid-view-with-header-footer:1.0.12'
  279. // 仿ios按钮
  280. implementation 'com.github.zcweng:switch-button:0.0.3@aar'
  281. // 带数字的进度条
  282. implementation 'com.daimajia.numberprogressbar:library:1.4@aar'
  283. // 靠谱点的圆形视图库
  284. implementation 'com.makeramen:roundedimageview:2.3.0'
  285. implementation files('libs/xjgarsdklibrary-release-9.2.1-2019-08-31.aar')
  286. // 表格面板视图,https://github.com/ceryle/FitGridView
  287. implementation 'com.github.ceryle:FitGridView:v1.0.5'
  288. // 仿ios右划返回上一页,
  289. implementation 'me.imid.swipebacklayout.lib:library:1.1.0'
  290. // 支持侧滑的recyclerView,
  291. implementation project(':swiperecyclerview')
  292. // 下拉刷新布局,
  293. implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-28'
  294. // 密码学库,加密算法用到,
  295. implementation 'org.bouncycastle:bcprov-jdk15on:1.57'
  296. implementation 'cn.jiguang.sdk:jpush:3.1.1'
  297. implementation 'cn.jiguang.sdk:jcore:1.1.9'
  298. implementation 'com.huangyz0918:androidwm-light:0.1.2'
  299. implementation project(path: ':cockroach')
  300. implementation 'com.airbnb.android:lottie:3.4.0'
  301. implementation 'com.jakewharton:butterknife:10.1.0'
  302. annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
  303. implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46'
  304. implementation 'com.github.paradoxie:AutoVerticalTextview:0.1'
  305. implementation 'me.xuexuan:emoji-rain:1.0.0'
  306. implementation 'com.android.support:support-dynamic-animation:27.1.1'
  307. implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
  308. implementation 'com.squareup.retrofit2:retrofit:2.6.1'
  309. implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
  310. implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.1'
  311. implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
  312. implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'//okhttplog
  313. implementation 'com.androidkun:XTabLayout:1.1.3'
  314. implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
  315. implementation 'com.klinkerapps:link_builder:2.0.5'
  316. implementation 'com.zzhoujay.richtext:richtext:3.0.7'
  317. implementation 'com.zzhoujay:html:1.0.1'
  318. implementation project(':wheelsruflibrary') //转盘
  319. }
  320. configurations {
  321. all*.exclude group: 'xpp3', module: 'xpp3'
  322. }