build.gradle 12 KB

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