build.gradle 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'kotlin-android'
  3. apply plugin: 'kotlin-android-extensions'
  4. apply plugin: 'kotlin-kapt'
  5. apply plugin: 'realm-android'
  6. apply plugin: 'com.huawei.agconnect'
  7. ext {
  8. //定义变量
  9. signingConfigKeyAlias = ""
  10. signingConfigKeyPassword = ""
  11. signingConfigStoreFilePath = ""
  12. signingConfigStorePassword = ""
  13. jpushAppKey = ""
  14. baiduSpeechAppId = ""
  15. baiduSpeechSecret = ""
  16. baiduSpeechAppKey = ""
  17. baiduMapAppKey = ""
  18. jpushIMPassword = ""
  19. xiaomiAppId=""
  20. xiaomiAppKey=""
  21. oppoAppKey=""
  22. oppoAppId=""
  23. oppoAppSecret=""
  24. vivoAppKey=""
  25. vivoAppId=""
  26. }
  27. def loadProperties() {
  28. Properties properties = new Properties()
  29. properties.load(project.rootProject.file('local.properties').newDataInputStream())
  30. // 打包apk使用的密钥文件相关信息,请填写到local.properties文件中
  31. project.signingConfigKeyAlias = properties.getProperty("signingConfig.keyAlias")
  32. project.signingConfigKeyPassword = properties.getProperty("signingConfig.keyPassword")
  33. project.signingConfigStoreFilePath = properties.getProperty("signingConfig.storeFilePath")
  34. project.signingConfigStorePassword = properties.getProperty("signingConfig.storePassword")
  35. //release key
  36. project.jpushAppKey = project.property("JPUSH_APPKEY").toString()
  37. project.baiduSpeechAppId = project.property("BAIDU_SPEECH_APPID").toString()
  38. project.baiduSpeechSecret = project.property("BAIDU_SPEECH_SECRET").toString()
  39. project.baiduSpeechAppKey = project.property("BAIDU_SPEECH_APPKEY").toString()
  40. project.baiduMapAppKey = project.property("BAIDU_MAP_APPKEY").toString()
  41. project.xiaomiAppId=project.property("XIAOMI_APPID").toString()
  42. project.xiaomiAppKey=project.property("XIAOMI_APPKEY").toString()
  43. // project.oppoAppKey=project.property("OPPO_APPKEY").toString()
  44. // project.oppoAppId=project.property("OPPO_APPID").toString()
  45. // project.oppoAppSecret=project.property("OPPO_APPSECRET").toString()
  46. // project.vivoAppKey=project.property("VIVO_APPKEY").toString()
  47. // project.vivoAppId=project.property("VIVO_APPID").toString()
  48. }
  49. loadProperties()
  50. task printVersionName {
  51. def v = project.property("o2.versionName").toString()
  52. println("${v}")
  53. }
  54. android {
  55. compileSdkVersion 31
  56. buildToolsVersion "30.0.3"
  57. sourceSets {
  58. main {
  59. jniLibs.srcDir 'libs'
  60. assets.srcDirs = ['assets']
  61. res.srcDirs = ['src/main/res', 'src/main/res/raw']
  62. }
  63. }
  64. signingConfigs {
  65. release {
  66. v1SigningEnabled true
  67. v2SigningEnabled true
  68. keyAlias project.signingConfigKeyAlias
  69. keyPassword project.signingConfigKeyPassword
  70. storeFile file(project.signingConfigStoreFilePath)
  71. storePassword project.signingConfigStorePassword
  72. }
  73. debug {
  74. v1SigningEnabled true
  75. v2SigningEnabled true
  76. keyAlias project.signingConfigKeyAlias
  77. keyPassword project.signingConfigKeyPassword
  78. storeFile file(project.signingConfigStoreFilePath)
  79. storePassword project.signingConfigStorePassword
  80. // keyAlias 'androiddebugkey'
  81. // storeFile file('debug.keystore')
  82. // keyPassword 'android'
  83. }
  84. }
  85. defaultConfig {
  86. applicationId "com.dccr.oa"
  87. minSdkVersion 21
  88. targetSdkVersion 31
  89. versionCode project.property("o2.versionCode").toInteger()
  90. versionName project.property("o2.versionName").toString()
  91. multiDexEnabled true
  92. ndk {
  93. //选择要添加的对应cpu类型的.so库。
  94. // abiFilters 'armeabi', 'armeabi-v7a'
  95. // abiFilters 'armeabi-v7a', 'arm64-v8a'
  96. abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
  97. }
  98. multiDexKeepProguard file('multidex_keep_file.pro')
  99. vectorDrawables.useSupportLibrary = true
  100. dataBinding {
  101. enabled = true
  102. }
  103. }
  104. compileOptions {
  105. sourceCompatibility JavaVersion.VERSION_1_8
  106. targetCompatibility JavaVersion.VERSION_1_8
  107. }
  108. buildTypes {
  109. debug {
  110. signingConfig signingConfigs.release
  111. buildConfigField "Boolean", "InnerServer", "true"
  112. buildConfigField "Boolean", "LOG_ENABLE", "true"
  113. buildConfigField "Boolean", "NEED_UPDATE", "true"
  114. buildConfigField "Boolean", "LOG_FILE", "true"
  115. manifestPlaceholders = [JPUSH_PKGNAME : defaultConfig.applicationId,
  116. JPUSH_APPKEY : project.jpushAppKey,
  117. XIAOMI_APPID : project.xiaomiAppId,
  118. XIAOMI_APPKEY : project.xiaomiAppKey,
  119. BAIDU_SPEECH_APPID : project.baiduSpeechAppId,
  120. BAIDU_SPEECH_SECRET: project.baiduSpeechSecret,
  121. BAIDU_SPEECH_APPKEY: project.baiduSpeechAppKey,
  122. BAIDU_MAP_APPKEY : project.baiduMapAppKey]
  123. zipAlignEnabled true
  124. minifyEnabled true
  125. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  126. }
  127. release {
  128. signingConfig signingConfigs.release
  129. buildConfigField "Boolean", "InnerServer", "true"
  130. buildConfigField "Boolean", "LOG_ENABLE", "false"
  131. buildConfigField "Boolean", "NEED_UPDATE", "true"
  132. buildConfigField "Boolean", "LOG_FILE", "true"
  133. manifestPlaceholders = [JPUSH_PKGNAME : defaultConfig.applicationId,
  134. JPUSH_APPKEY : project.jpushAppKey,
  135. XIAOMI_APPID : project.xiaomiAppId,
  136. XIAOMI_APPKEY : project.xiaomiAppKey,
  137. BAIDU_SPEECH_APPID : project.baiduSpeechAppId,
  138. BAIDU_SPEECH_SECRET: project.baiduSpeechSecret,
  139. BAIDU_SPEECH_APPKEY: project.baiduSpeechAppKey,
  140. BAIDU_MAP_APPKEY : project.baiduMapAppKey]
  141. zipAlignEnabled true
  142. minifyEnabled true
  143. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  144. //apk包重命名
  145. applicationVariants.all { variant ->
  146. variant.outputs.all {
  147. outputFileName = "${variant.productFlavors[0].name}-${variant.versionName}.apk"
  148. }
  149. }
  150. }
  151. }
  152. android {
  153. lintOptions {
  154. abortOnError false
  155. }
  156. }
  157. lintOptions {
  158. checkReleaseBuilds false
  159. abortOnError false
  160. }
  161. flavorDimensions "type"
  162. productFlavors {
  163. O2PLATFORM {
  164. manifestPlaceholders = [JPUSH_CHANNEL: "pgy"]
  165. }
  166. huawei {
  167. manifestPlaceholders = [JPUSH_CHANNEL: "huawei"]
  168. }
  169. xiaomi {
  170. manifestPlaceholders = [JPUSH_CHANNEL: "xiaomi"]
  171. }
  172. }
  173. }
  174. buildscript {
  175. repositories {
  176. mavenCentral()
  177. }
  178. dependencies {
  179. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  180. classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
  181. }
  182. }
  183. repositories {
  184. flatDir {
  185. dirs 'libs'
  186. }
  187. //o2oa
  188. maven { url "../o2_flutter/buildAAR/host/outputs/repo" }
  189. maven {
  190. url 'https://storage.googleapis.com/download.flutter.io'
  191. }
  192. }
  193. dependencies {
  194. // 百度地图
  195. implementation files('libs/BaiduLBS_Android.jar')
  196. // 扫码
  197. implementation 'com.google.zxing:core:3.4.1'
  198. implementation files('libs/pinyin4j-2.5.0.jar')
  199. implementation files('libs/universal-image-loader-1.9.5.jar')
  200. // implementation(name: 'material-calendarview-fancy-1.1', ext: 'aar')
  201. implementation 'com.jakewharton.threetenabp:threetenabp:1.1.1'
  202. implementation 'com.github.prolificinteractive:material-calendarview:2.0.0'
  203. implementation project(path: ':o2_auth_sdk')
  204. // // flutter 相关的aar
  205. // flutter模块开发调试用
  206. // implementation project(':flutter')
  207. // debugImplementation 'io.flutter.plugins.pathprovider:path_provider_android_debug:1.0'
  208. implementation 'io.flutter.plugins.pathprovider:path_provider_android_release:1.0'
  209. // debugImplementation 'io.flutter.plugins.sharedpreferences:shared_preferences_android_debug:1.0'
  210. implementation 'io.flutter.plugins.sharedpreferences:shared_preferences_android_release:1.0'
  211. // debugImplementation 'net.o2oa.app.flutter.o2_flutter:flutter_debug:1.0'
  212. implementation 'net.o2oa.app.flutter.o2_flutter:flutter_release:1.0'
  213. implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  214. implementation "org.jetbrains.anko:anko-common:$anko_version"
  215. implementation('androidx.legacy:legacy-support-v4:1.0.0')
  216. implementation('androidx.recyclerview:recyclerview:1.2.1') {
  217. exclude module: 'support-v4'
  218. }
  219. implementation('androidx.appcompat:appcompat:1.2.0')
  220. implementation('androidx.cardview:cardview:1.0.0')
  221. implementation('com.google.android.material:material:1.2.0')
  222. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  223. implementation 'androidx.multidex:multidex:2.0.1'
  224. implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4'
  225. implementation('com.github.bumptech.glide:glide:4.12.0')
  226. implementation 'com.afollestad.material-dialogs:core:0.8.5.9'
  227. implementation(name: 'changeskin-1.3.0', ext: 'aar')
  228. implementation 'io.o2oa:signatureview:1.0.0'
  229. implementation 'com.github.fancylou:CalendarView:v1.2.0'
  230. implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
  231. implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'
  232. implementation 'com.borax12.materialdaterangepicker:library:1.9'
  233. implementation 'com.yanzhenjie.recyclerview:x:1.3.2'
  234. implementation 'com.race604.waveloading:library:1.1.1'
  235. implementation 'com.squareup.retrofit2:retrofit:2.4.0'
  236. implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
  237. implementation 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
  238. implementation 'com.squareup.okhttp3:okhttp:3.11.0'
  239. implementation 'io.reactivex:rxjava:1.1.6'
  240. implementation 'io.reactivex:rxandroid:1.2.1'
  241. /////////////////////////////////////////////////推送///////////////////////
  242. implementation project(':jiguang')
  243. implementation 'com.contrarywind:Android-PickerView:4.1.9'
  244. //滚动选择器
  245. implementation 'com.jzxiang.pickerview:TimePickerDialog:1.0.1'
  246. //链式方式获取Activity返回结果
  247. implementation 'com.github.lwugang:ActivityResult:59b23e3682'
  248. //google architecture component
  249. // ViewModel and LiveData
  250. implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
  251. // alternatively - just ViewModel
  252. implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
  253. // use -ktx for Kotlin
  254. // alternatively - just LiveData
  255. implementation 'androidx.lifecycle:lifecycle-livedata:2.2.0'
  256. // Support library depends on this lightweight import
  257. implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'
  258. //noinspection LifecycleAnnotationProcessorWithJava8
  259. annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.2.0'
  260. implementation 'com.google.code.gson:gson:2.8.5'
  261. //GSYVideo播放器
  262. implementation('com.shuyu:GSYVideoPlayer:8.0.0')
  263. //mp3录音
  264. implementation 'com.github.zhaolewei:ZlwAudioRecorder:v1.07'
  265. //gif 播放
  266. implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24'
  267. // 图片放大缩小
  268. implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0'
  269. implementation 'com.huawei.hms:push:6.12.0.300'
  270. testImplementation 'junit:junit:4.12'
  271. }
  272. tasks.whenTaskAdded { task ->
  273. if (task.name == "lint") {
  274. task.enabled = false
  275. }
  276. }