build.gradle 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. //这些行指定了使用了哪些 Gradle 插件
  2. apply plugin: 'com.android.application'
  3. apply plugin: 'org.greenrobot.greendao'
  4. //配置了 Android 构建的各种参数。
  5. android {
  6. //修改构建版本和工具版本:
  7. compileSdkVersion rootProject.ext.compileSdkVersion
  8. buildToolsVersion rootProject.ext.buildToolsVersion
  9. //修改应用 ID 和版本信息:
  10. defaultConfig {
  11. applicationId "com.timichat.app"
  12. minSdkVersion rootProject.ext.minSdkVersion
  13. targetSdkVersion rootProject.ext.targetSdkVersion
  14. versionCode 202201230
  15. versionName "2.5.1"
  16. //指定了用于运行测试的测试运行器
  17. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  18. //启用了 MultiDex 支持,允许应用支持多个 Dex 文件,用于处理应用中的方法数限制问题
  19. multiDexEnabled true
  20. //定义了构建配置字段,这些字段可以在 Java 代码中使用。
  21. buildConfigField("String", "FILE_PROVIDER_NAME", "\"com.timichat.app.FileProvider\"")
  22. //设置了 Android 清单文件中的占位符,允许在构建过程中动态替换清单文件中的值。
  23. manifestPlaceholders = [
  24. app_Id : "com.timichat.app",
  25. app_name : "TiMi语音",
  26. channel_id : "3",
  27. qq_app_id : "",
  28. map_api_key : "123123",
  29. ali_app_key : "123123",
  30. ali_app_secret: "123123"
  31. ]
  32. ndk {
  33. abiFilters 'armeabi-v7a'/*, 'arm64-v8a'*/
  34. }
  35. }
  36. // 配置了 Dex 编译选项,指定了 Java 堆大小
  37. dexOptions {
  38. javaMaxHeapSize "4g"
  39. }
  40. //配置了 GreenDAO 数据库框架
  41. greendao {
  42. schemaVersion 25
  43. daoPackage 'com.starbuds.app.entity.db'
  44. targetGenDir 'src/main/java'
  45. }
  46. //配置签名信息:
  47. signingConfigs {
  48. release {
  49. storeFile file('../boluojie123.keystore')
  50. storePassword "boluojie.china.com"
  51. keyAlias "boluojie"
  52. keyPassword "boluojie.china.com"
  53. v1SigningEnabled true
  54. v2SigningEnabled true
  55. }
  56. }
  57. //配置构建类型:
  58. buildTypes {
  59. debug {
  60. debuggable true
  61. minifyEnabled false
  62. shrinkResources false
  63. zipAlignEnabled true
  64. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  65. manifestPlaceholders = [
  66. ali_app_key : "123333347698",
  67. ali_app_secret: "123127635475506424ca142289274a0592e",
  68. channel_id : "123201"
  69. ]
  70. signingConfig signingConfigs.release
  71. }
  72. release {
  73. minifyEnabled true
  74. shrinkResources true
  75. zipAlignEnabled true
  76. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  77. }
  78. }
  79. flavorDimensions "xingya"
  80. //添加多渠道打包配置
  81. productFlavors {
  82. //渠道包
  83. timi {// timi
  84. dimension "xingya"
  85. signingConfig signingConfigs.release
  86. manifestPlaceholders = [
  87. app_Id : "com.timichat.app",
  88. app_name : "TiMi语音",
  89. channel_id : "261442100002816"
  90. ]
  91. }
  92. tm {
  93. dimension "xingya"
  94. signingConfig signingConfigs.release
  95. manifestPlaceholders = [
  96. app_Id : "com.timichat.app",
  97. app_name : "Tm语音",
  98. channel_id : "261442100002817"
  99. ]
  100. }
  101. }
  102. //自定义构建输出目录和文件名:
  103. android.applicationVariants.all { variant ->
  104. variant.outputs.all { output ->
  105. def outputFile = output.outputFile
  106. if (outputFile != null && outputFile.name.contains('release')) {
  107. //渠道名称
  108. def buildName = ""
  109. variant.productFlavors.each { product ->
  110. buildName = product.name
  111. }
  112. //获取每个打包产物
  113. variant.getPackageApplication().outputDirectory = new File("${project.getProjectDir()}/channel")
  114. outputFileName = "${buildName}-${variant.versionName}-${variant.versionCode}.apk"
  115. }
  116. }
  117. }
  118. //这里配置了不同渠道的资源文件和资产文件的路径,以确保每个渠道的资源都被正确使用。
  119. sourceSets {
  120. [timi,tm].each {
  121. sourceSets[it.name].res.srcDirs = ["src/channel/${it.name}/res"]
  122. sourceSets[it.name].assets.srcDirs = ["src/channel/${it.name}/assets"]
  123. }
  124. }
  125. //配置了 Lint 静态代码分析工具的选项。
  126. lintOptions {
  127. abortOnError false
  128. }
  129. //指定了 Java 源代码的兼容性,这里设置为 Java 8 兼容
  130. compileOptions {
  131. sourceCompatibility JavaVersion.VERSION_1_8
  132. targetCompatibility JavaVersion.VERSION_1_8
  133. }
  134. }
  135. dependencies {
  136. implementation fileTree(include: ['*.jar'], dir: 'libs')
  137. implementation fileTree(include: ['*.aar'], dir: 'libs')
  138. implementation project(':xlibrary')
  139. // implementation project(':tuikit')
  140. implementation project(':easyPhotos')
  141. implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
  142. implementation "com.jakewharton:butterknife:$rootProject.ext.butterknifeVersion"
  143. implementation "androidx.constraintlayout:constraintlayout:$rootProject.ext.androidxConstraintVersion"
  144. implementation "androidx.appcompat:appcompat:$rootProject.ext.androidxVersion"
  145. implementation 'com.google.android.material:material:1.3.0'
  146. annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.ext.butterknifeVersion"
  147. implementation "org.greenrobot:greendao:$rootProject.ext.greendaoVersion"
  148. implementation("com.github.yuweiguocn:GreenDaoUpgradeHelper:v$rootProject.ext.greendaoHelperVersion") {
  149. exclude module: 'support-annotations'
  150. }
  151. // implementation "com.android.support.constraint:constraint-layout:$rootProject.ext.constraintLayoutVersion"
  152. implementation 'com.qiniu:qiniu-android-sdk:7.3.12'
  153. implementation 'com.hyman:flowlayout-lib:1.1.2'
  154. implementation 'androidx.multidex:multidex:2.0.0'
  155. implementation 'com.github.hackware1993:MagicIndicator:1.5.0'
  156. implementation 'com.contrarywind:Android-PickerView:4.1.9'
  157. implementation 'me.jessyan:autosize:1.1.2'
  158. implementation 'cn.bingoogolapple:bga-qrcodecore:1.1.7@aar'
  159. implementation 'cn.bingoogolapple:bga-zxing:1.1.7@aar'
  160. implementation 'com.bigkoo:convenientbanner:2.0.5'
  161. implementation 'com.shizhefei:MultiTypeView:1.0.1'
  162. implementation('com.github.Yellow5A5:ClearScreenHelper:1.0.2') {
  163. exclude group: 'com.android.support'
  164. }
  165. implementation 'cn.jzvd:jiaozivideoplayer:7.4.0'
  166. implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
  167. implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
  168. implementation 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8'
  169. // 微信
  170. implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:5.5.8'
  171. // 华为支付
  172. // implementation 'com.huawei.android.hms:iap:2.6.3.306'
  173. // implementation 'com.huawei.android.hms:hwid::2.6.3.306'
  174. // implementation 'com.huawei.android.hms:push:2.6.3.306'
  175. // QQ
  176. implementation files('libs/open_sdk_r08e585d_lite.jar')
  177. // 图片压缩
  178. implementation 'top.zibin:Luban:1.1.8'
  179. // 图片裁剪
  180. implementation 'com.github.yalantis:ucrop:2.2.3'
  181. implementation 'com.github.yalantis:ucrop:2.2.3-native'
  182. // 高德定位
  183. implementation 'com.amap.api:location:4.8.0'
  184. implementation ("com.github.bumptech.glide:glide:$rootProject.ext.glideVersion") {
  185. exclude group: "com.android.support"
  186. }
  187. implementation "com.github.bumptech.glide:okhttp3-integration:$rootProject.ext.glideVersion"
  188. implementation "com.github.bumptech.glide:annotations:$rootProject.ext.glideVersion"
  189. annotationProcessor "com.github.bumptech.glide:compiler:$rootProject.ext.glideVersion"
  190. implementation 'com.github.penfeizhou.android.animation:glide-plugin:2.12.0'
  191. // implementation "androidx.vectordrawable:vectordrawable-animated:1.1.0"
  192. // implementation "androidx.exifinterface:exifinterface:1.2.0"
  193. implementation 'jp.wasabeef:glide-transformations:4.1.0'
  194. implementation 'com.tencent.bugly:crashreport:3.1.0@aar'
  195. implementation 'com.tencent.bugly:nativecrashreport:3.7.1@aar'
  196. implementation 'com.airbnb.android:lottie:3.5.0'
  197. implementation 'com.github.yyued:SVGAPlayer-Android:2.5.14'
  198. implementation "io.github.tencent:vap:2.0.20"
  199. // implementation 'com.github.YvesCheung:SVGAGlidePlugin:4.9.3'
  200. implementation 'com.imuxuan:floatingview:1.6'
  201. testImplementation 'junit:junit:4.12'
  202. androidTestImplementation 'androidx.test.ext:junit:1.1.0'
  203. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  204. implementation 'com.github.yujinzhao123:DoubleHeadedDragonBar:1.0.4'
  205. implementation 'com.hyman:flowlayout-lib:1.1.2'
  206. implementation 'com.github.cirno-poi:VerifyEditText:1.0.0'
  207. implementation 'com.aliyun.ams:alicloud-android-push:3.1.12'
  208. // implementation 'com.aliyun.ams:alicloud-android-third-push:3.1.0@aar'
  209. // implementation 'com.aliyun.ams:huawei-push:2.6.3.305'
  210. // implementation 'com.aliyun.ams:huawei-push-base:2.6.3.305'
  211. // implementation 'com.aliyun.ams:meizu-push:3.8.7.1'
  212. // implementation 'com.aliyun.ams:third_vivopush:2.9.0.1'
  213. implementation 'com.umeng.umsdk:common:9.4.0'// 必选
  214. implementation 'com.umeng.umsdk:asms:1.2.3'// 必选
  215. implementation 'com.umeng.umsdk:apm:1.3.1' // 错误分析升级为独立SDK,看crash数据请一定集成,可选
  216. implementation 'cn.rongcloud.sdk:im_lib:4.0.3.13'
  217. implementation ('cn.rongcloud.sdk:im_kit:4.0.3.13'){
  218. exclude group: "androidx.media"
  219. exclude group: "androidx.legacy"
  220. // exclude group: "com.github.bumptech.glide"
  221. }
  222. // implementation ('cn.rongcloud.sdk:im_kit:5.1.0'){
  223. // exclude group: "com.github.bumptech.glide"
  224. // }
  225. // implementation 'io.agora.rtc:agora-rtc-sdk:1.0.0'
  226. // implementation 'com.github.zegolibrary:express-audio:2.10.0'
  227. implementation 'im.zego:express-audio:3.2.1'
  228. implementation 'com.google.android:flexbox:2.0.1'
  229. implementation 'com.tencent:mmkv-static:1.2.10'
  230. implementation 'com.github.MZCretin:ExpandableTextView:1.6.1-x'
  231. // implementation 'com.tencent.tbs.tbssdk:sdk:43939'
  232. implementation 'com.github.lzyzsd:jsbridge:1.0.4'
  233. // implementation 'com.github.wendux:DSBridge-Android:3.0-SNAPSHOT'
  234. // debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.3'
  235. implementation 'com.tencent.tav:libpag:3.2.5.1'
  236. implementation 'cn.hutool:hutool-all:5.0.6'
  237. }