build.gradle 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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. ext {
  7. //定义变量
  8. signingConfigKeyAlias = ""
  9. signingConfigKeyPassword = ""
  10. signingConfigStoreFilePath = ""
  11. signingConfigStorePassword = ""
  12. jpushAppKey = ""
  13. baiduSpeechAppId = ""
  14. baiduSpeechSecret = ""
  15. baiduSpeechAppKey = ""
  16. baiduMapAppKey = ""
  17. jpushIMPassword = ""
  18. buglyAppId = ""
  19. }
  20. def loadProperties() {
  21. Properties properties = new Properties()
  22. properties.load(project.rootProject.file('local.properties').newDataInputStream())
  23. project.signingConfigKeyAlias = properties.getProperty("signingConfig.keyAlias")
  24. project.signingConfigKeyPassword = properties.getProperty("signingConfig.keyPassword")
  25. project.signingConfigStoreFilePath = properties.getProperty("signingConfig.storeFilePath")
  26. project.signingConfigStorePassword = properties.getProperty("signingConfig.storePassword")
  27. //release key
  28. project.jpushAppKey = properties.getProperty("JPUSH_APPKEY")
  29. project.baiduSpeechAppId = properties.getProperty("BAIDU_SPEECH_APPID")
  30. project.baiduSpeechSecret = properties.getProperty("BAIDU_SPEECH_SECRET")
  31. project.baiduSpeechAppKey = properties.getProperty("BAIDU_SPEECH_APPKEY")
  32. project.baiduMapAppKey = properties.getProperty("BAIDU_MAP_APPKEY")
  33. project.buglyAppId = properties.getProperty("BUGLY_APPID")
  34. }
  35. loadProperties()
  36. task printVersionName {
  37. def v = project.property("o2.versionName").toString()
  38. println("${v}")
  39. }
  40. android {
  41. compileSdkVersion 28
  42. buildToolsVersion "28.0.3"
  43. sourceSets {
  44. main {
  45. jniLibs.srcDir 'libs'
  46. assets.srcDirs = ['assets']
  47. res.srcDirs = ['src/main/res', 'src/main/res/raw']
  48. }
  49. }
  50. signingConfigs {
  51. release {
  52. v1SigningEnabled true
  53. v2SigningEnabled true
  54. keyAlias project.signingConfigKeyAlias
  55. keyPassword project.signingConfigKeyPassword
  56. storeFile file(project.signingConfigStoreFilePath)
  57. storePassword project.signingConfigStorePassword
  58. }
  59. debug {
  60. v1SigningEnabled true
  61. v2SigningEnabled true
  62. keyAlias 'androiddebugkey'
  63. storeFile file('debug.keystore')
  64. keyPassword 'android'
  65. }
  66. }
  67. defaultConfig {
  68. applicationId "net.zoneland.x.bpm.mobile.v1.zoneXBPM"
  69. minSdkVersion 19
  70. targetSdkVersion 28
  71. versionCode project.property("o2.versionCode").toInteger()
  72. versionName project.property("o2.versionName").toString()
  73. multiDexEnabled true
  74. ndk {
  75. //选择要添加的对应cpu类型的.so库。
  76. abiFilters 'armeabi', 'armeabi-v7a'
  77. }
  78. multiDexKeepProguard file('multidex_keep_file.pro')
  79. vectorDrawables.useSupportLibrary = true
  80. dataBinding {
  81. enabled = true
  82. }
  83. }
  84. compileOptions {
  85. sourceCompatibility JavaVersion.VERSION_1_8
  86. targetCompatibility JavaVersion.VERSION_1_8
  87. }
  88. buildTypes {
  89. debug {
  90. signingConfig signingConfigs.debug
  91. buildConfigField "Boolean", "InnerServer", "true"
  92. buildConfigField "Boolean", "LOG_ENABLE", "true"
  93. buildConfigField "Boolean", "LOG_FILE", "true"
  94. manifestPlaceholders = [JPUSH_PKGNAME : defaultConfig.applicationId,
  95. JPUSH_APPKEY : project.jpushAppKey,
  96. BAIDU_SPEECH_APPID : project.baiduSpeechAppId,
  97. BAIDU_SPEECH_SECRET: project.baiduSpeechSecret,
  98. BAIDU_SPEECH_APPKEY: project.baiduSpeechAppKey,
  99. BAIDU_MAP_APPKEY : project.baiduMapAppKey,
  100. BUGLY_APPID : project.buglyAppId]
  101. zipAlignEnabled true
  102. minifyEnabled true
  103. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  104. }
  105. release {
  106. signingConfig signingConfigs.release
  107. buildConfigField "Boolean", "InnerServer", "false"
  108. buildConfigField "Boolean", "LOG_ENABLE", "false"
  109. buildConfigField "Boolean", "LOG_FILE", "true"
  110. manifestPlaceholders = [JPUSH_PKGNAME : defaultConfig.applicationId,
  111. JPUSH_APPKEY : project.jpushAppKey,
  112. BAIDU_SPEECH_APPID : project.baiduSpeechAppId,
  113. BAIDU_SPEECH_SECRET: project.baiduSpeechSecret,
  114. BAIDU_SPEECH_APPKEY: project.baiduSpeechAppKey,
  115. BAIDU_MAP_APPKEY : project.baiduMapAppKey,
  116. BUGLY_APPID : project.buglyAppId]
  117. zipAlignEnabled true
  118. minifyEnabled true
  119. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  120. //apk包重命名
  121. applicationVariants.all { variant ->
  122. variant.outputs.all {
  123. outputFileName = "${variant.productFlavors[0].name}-${variant.versionName}.apk"
  124. }
  125. }
  126. }
  127. }
  128. android {
  129. lintOptions {
  130. abortOnError false
  131. }
  132. }
  133. lintOptions {
  134. checkReleaseBuilds false
  135. abortOnError false
  136. }
  137. flavorDimensions "type"
  138. productFlavors {
  139. O2PLATFORM {
  140. manifestPlaceholders = [JPUSH_CHANNEL: "pgy"]
  141. }
  142. huawei {
  143. manifestPlaceholders = [JPUSH_CHANNEL: "huawei"]
  144. }
  145. xiaomi {
  146. manifestPlaceholders = [JPUSH_CHANNEL: "xiaomi"]
  147. }
  148. }
  149. }
  150. buildscript {
  151. repositories {
  152. mavenCentral()
  153. }
  154. dependencies {
  155. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  156. classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
  157. }
  158. }
  159. repositories {
  160. flatDir {
  161. dirs 'libs'
  162. }
  163. }
  164. dependencies {
  165. implementation files('libs/BaiduLBS_Android.jar')
  166. implementation files('libs/bdasr_V3_20180320_9066860.jar')
  167. implementation files('libs/com.baidu.tts_2.3.1.20170808_e39ea89.jar')
  168. implementation files('libs/zxing.jar')
  169. implementation files('libs/pinyin4j-2.5.0.jar')
  170. implementation files('libs/universal-image-loader-1.9.5.jar')
  171. implementation files('libs/tbs_sdk_thirdapp_v4.3.0.1072_43646_sharewithdownloadwithfile_withoutGame_obfs_20190429_175122.jar')
  172. implementation(name: 'material-calendarview-fancy-1.1', ext: 'aar')
  173. // implementation(name: 'o2_auth_sdk-release', ext: 'aar')
  174. implementation project(path: ':o2_auth_sdk')
  175. implementation(name: 'flutterpack-release', ext: 'aar')
  176. implementation(name: 'shared_preferences-release', ext: 'aar')
  177. implementation(name: 'image_picker-release', ext: 'aar')
  178. implementation(name: 'path_provider-release', ext: 'aar')
  179. implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  180. implementation "org.jetbrains.anko:anko-common:$anko_version"
  181. implementation('androidx.legacy:legacy-support-v4:1.0.0') {
  182. force = true
  183. }
  184. implementation('androidx.recyclerview:recyclerview:1.1.0') {
  185. exclude module: 'support-v4'
  186. }
  187. implementation('androidx.appcompat:appcompat:1.2.0') {
  188. force = true
  189. }
  190. implementation('androidx.cardview:cardview:1.0.0') {
  191. force = true
  192. }
  193. implementation('com.google.android.material:material:1.2.0') {
  194. force = true
  195. }
  196. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  197. implementation 'androidx.multidex:multidex:2.0.1'
  198. implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4'
  199. implementation('com.github.bumptech.glide:glide:3.7.0') {
  200. force = true
  201. }
  202. implementation 'com.afollestad.material-dialogs:core:0.8.5.9'
  203. implementation 'net.muliba.fancyfilepickerlibrary:fancyfilepickerlibrary:4.0.0'
  204. implementation 'net.muliba.changeskin:changeskin:1.2.2'
  205. implementation 'io.o2oa:signatureview:1.0.0'
  206. implementation 'net.zoneland.o2.calendarview:library:1.1.2'
  207. implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
  208. implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'
  209. implementation 'com.borax12.materialdaterangepicker:library:1.9'
  210. // implementation 'com.yanzhenjie:recyclerview-swipe:1.1.4'
  211. //d
  212. implementation 'com.yanzhenjie.recyclerview:x:1.3.2'
  213. implementation 'com.race604.waveloading:library:1.1.1'
  214. implementation 'com.squareup.retrofit2:retrofit:2.4.0'
  215. implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
  216. implementation 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
  217. implementation 'com.squareup.okhttp3:okhttp:3.11.0'
  218. implementation 'io.reactivex:rxjava:1.1.6'
  219. implementation 'io.reactivex:rxandroid:1.2.1'
  220. implementation 'com.tencent.bugly:crashreport:2.6.6'
  221. //
  222. implementation 'cn.jiguang.sdk:jpush:3.1.2'
  223. // implementation 'cn.jiguang.sdk:jmessage:2.5.0'
  224. // 此处以JMessage 2.5.0 版本为例。
  225. implementation 'cn.jiguang.sdk:jcore:1.1.9'
  226. //im
  227. // implementation 'com.michaelpardo:activeandroid:3.1.0'
  228. // implementation 'com.jakewharton:butterknife:8.4.0'
  229. // kapt 'com.jakewharton:butterknife-compiler:8.4.0'
  230. // implementation 'com.github.chrisbanes.photoview:library:1.2.4'
  231. // implementation 'com.facebook.fresco:fresco:0.8.1'
  232. // implementation 'org.greenrobot:eventbus:3.0.0'
  233. implementation 'com.contrarywind:Android-PickerView:3.2.4'
  234. //滚动选择器
  235. implementation 'com.jzxiang.pickerview:TimePickerDialog:1.0.1'
  236. //链式方式获取Activity返回结果
  237. implementation 'com.github.lwugang:ActivityResult:59b23e3682'
  238. //google architecture component
  239. // ViewModel and LiveData
  240. implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
  241. // alternatively - just ViewModel
  242. implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
  243. // use -ktx for Kotlin
  244. // alternatively - just LiveData
  245. implementation 'androidx.lifecycle:lifecycle-livedata:2.2.0'
  246. // Support library depends on this lightweight import
  247. implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'
  248. //noinspection LifecycleAnnotationProcessorWithJava8
  249. annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.2.0'
  250. //noinspection GradleDependency
  251. // kapt 'androidx.databinding:databinding-compiler:3.0.1'
  252. implementation 'com.google.code.gson:gson:2.8.5'
  253. //GSYVideo播放器
  254. implementation('com.shuyu:GSYVideoPlayer:6.0.3')
  255. // {
  256. // exclude group: 'com.android.support', module: 'recyclerview-v7'
  257. // exclude group: 'com.android.support', module: 'appcompat-v7'
  258. // exclude group: 'com.android.support', module: 'cardview-v7'
  259. // exclude group: 'com.android.support', module: 'support-v4'
  260. // exclude group: 'com.android.support', module: 'design'
  261. // exclude group: 'com.android.support', module: 'support-compat'
  262. // exclude group: 'com.android.support', module: 'support-annotations'
  263. // exclude group: 'com.android.support', module: 'support-media-compat'
  264. // }
  265. //mp3录音
  266. implementation 'com.github.zhaolewei:ZlwAudioRecorder:v1.07'
  267. testImplementation 'junit:junit:4.12'
  268. }
  269. tasks.whenTaskAdded { task ->
  270. if (task.name == "lint") {
  271. task.enabled = false
  272. }
  273. }