build.gradle 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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. }
  101. release {
  102. signingConfig signingConfigs.release
  103. buildConfigField "Boolean", "InnerServer", "false"
  104. buildConfigField "Boolean", "LOG_ENABLE", "false"
  105. buildConfigField "Boolean", "LOG_FILE", "true"
  106. manifestPlaceholders = [JPUSH_PKGNAME : defaultConfig.applicationId,
  107. JPUSH_APPKEY : project.jpushAppKey,
  108. JM_IM_USER_PASSWORD: project.jpushIMPassword,
  109. BAIDU_SPEECH_APPID : project.baiduSpeechAppId,
  110. BAIDU_SPEECH_SECRET: project.baiduSpeechSecret,
  111. BAIDU_SPEECH_APPKEY: project.baiduSpeechAppKey,
  112. BAIDU_MAP_APPKEY : project.baiduMapAppKey,
  113. BUGLY_APPID : project.buglyAppId]
  114. zipAlignEnabled true
  115. minifyEnabled true
  116. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  117. //apk包重命名
  118. applicationVariants.all { variant ->
  119. variant.outputs.all {
  120. outputFileName = "${variant.productFlavors[0].name}-${variant.versionName}.apk"
  121. }
  122. }
  123. }
  124. }
  125. dataBinding {
  126. enabled true
  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('com.android.support:support-v4:26.1.0') {
  182. force = true
  183. }
  184. implementation('com.android.support:recyclerview-v7:26.1.0') {
  185. exclude module: 'support-v4'
  186. }
  187. implementation 'com.android.support:appcompat-v7:26.1.0'
  188. implementation 'com.android.support:cardview-v7:26.1.0'
  189. implementation 'com.android.support:design:26.1.0'
  190. implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  191. implementation 'com.android.support:multidex:1.0.3'
  192. implementation 'com.github.PhilJay:MPAndroidChart:v2.2.4'
  193. implementation('com.github.bumptech.glide:glide:3.7.0') {
  194. force = true
  195. }
  196. implementation 'com.afollestad.material-dialogs:core:0.8.5.9'
  197. implementation 'net.muliba.fancyfilepickerlibrary:fancyfilepickerlibrary:3.0.2'
  198. implementation 'net.muliba.changeskin:changeskin:1.2.2'
  199. implementation 'io.o2oa:signatureview:1.0.0'
  200. implementation 'net.zoneland.o2.calendarview:library:1.1.2'
  201. implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
  202. implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'
  203. implementation 'com.borax12.materialdaterangepicker:library:1.9'
  204. implementation 'com.yanzhenjie:recyclerview-swipe:1.1.4'
  205. implementation 'com.race604.waveloading:library:1.1.1'
  206. implementation 'com.squareup.retrofit2:retrofit:2.4.0'
  207. implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
  208. implementation 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
  209. implementation 'com.squareup.okhttp3:okhttp:3.11.0'
  210. implementation 'io.reactivex:rxjava:1.1.6'
  211. implementation 'io.reactivex:rxandroid:1.2.1'
  212. implementation 'com.tencent.bugly:crashreport:2.6.6'
  213. //
  214. implementation 'cn.jiguang.sdk:jpush:3.1.2'
  215. implementation 'cn.jiguang.sdk:jmessage:2.5.0'
  216. // 此处以JMessage 2.5.0 版本为例。
  217. implementation 'cn.jiguang.sdk:jcore:1.1.9'
  218. //im
  219. implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
  220. implementation 'com.jakewharton:butterknife:8.4.0'
  221. kapt 'com.jakewharton:butterknife-compiler:8.4.0'
  222. implementation 'com.github.chrisbanes.photoview:library:1.2.4'
  223. implementation 'com.facebook.fresco:fresco:0.8.1'
  224. implementation 'org.greenrobot:eventbus:3.0.0'
  225. implementation 'com.contrarywind:Android-PickerView:3.2.4'
  226. //滚动选择器
  227. implementation 'com.jzxiang.pickerview:TimePickerDialog:1.0.1'
  228. //链式方式获取Activity返回结果
  229. implementation 'com.github.lwugang:ActivityResult:59b23e3682'
  230. //google architecture component
  231. def lifecycle_version = "1.1.1"
  232. // ViewModel and LiveData
  233. implementation "android.arch.lifecycle:extensions:$lifecycle_version"
  234. // alternatively - just ViewModel
  235. implementation "android.arch.lifecycle:viewmodel:$lifecycle_version"
  236. // use -ktx for Kotlin
  237. // alternatively - just LiveData
  238. implementation "android.arch.lifecycle:livedata:$lifecycle_version"
  239. // Support library depends on this lightweight import
  240. implementation "android.arch.lifecycle:runtime:$lifecycle_version"
  241. annotationProcessor "android.arch.lifecycle:compiler:$lifecycle_version"
  242. //noinspection GradleDependency
  243. kapt "com.android.databinding:compiler:$gradle_version"
  244. testImplementation 'junit:junit:4.12'
  245. implementation 'com.google.code.gson:gson:2.8.5'
  246. }
  247. tasks.whenTaskAdded { task ->
  248. if (task.name == "lint") {
  249. task.enabled = false
  250. }
  251. }