build.gradle 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. apply plugin: 'com.android.application'
  2. def releaseTime() {
  3. return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
  4. }
  5. android {
  6. compileSdkVersion rootProject.ext.android["compileSdkVersion"]
  7. useLibrary 'org.apache.http.legacy'
  8. compileOptions {
  9. targetCompatibility JavaVersion.VERSION_1_8
  10. sourceCompatibility JavaVersion.VERSION_1_8
  11. }
  12. aaptOptions.cruncherEnabled = false
  13. aaptOptions.useNewCruncher = false
  14. defaultConfig {
  15. applicationId "com.xwkj.rhzf"
  16. minSdkVersion rootProject.ext.android["minSdkVersion"]
  17. targetSdkVersion 28
  18. versionCode 52
  19. versionName "5.2"
  20. testInstrumentationRunner rootProject.ext.dependencies["androidJUnitRunner"]
  21. flavorDimensions "1"
  22. ndk {
  23. abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86"
  24. }
  25. }
  26. sourceSets {
  27. main {
  28. jniLibs.srcDirs = ['libs']
  29. }
  30. }
  31. signingConfigs {
  32. debug {
  33. keyAlias 'zkjc_police'
  34. keyPassword 'jlszkjc777888'
  35. storeFile file("../sign/keystore.jks")
  36. storePassword 'jlszkjc777888'
  37. // v2SigningEnabled false
  38. }
  39. release {
  40. keyAlias 'zkjc_police'
  41. keyPassword 'jlszkjc777888'
  42. storeFile file("../sign/keystore.jks")
  43. storePassword 'jlszkjc777888'
  44. // v2SigningEnabled false
  45. }
  46. }
  47. buildTypes {
  48. debug {
  49. buildConfigField "boolean", "LOG_DEBUG", "true"
  50. buildConfigField "boolean", "USE_CANARY", "true"
  51. minifyEnabled false
  52. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  53. }
  54. release {
  55. buildConfigField "boolean", "LOG_DEBUG", "false"
  56. buildConfigField "boolean", "USE_CANARY", "false"
  57. /*minifyEnabled false
  58. shrinkResources true
  59. zipAlignEnabled true*/
  60. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  61. }
  62. }
  63. productFlavors {
  64. //应用商店版本
  65. sqjw {
  66. resValue "string", "app_name", "入户走访"
  67. signingConfig signingConfigs.release
  68. manifestPlaceholders = [UMENG_CHANNEL: "sqjw", CATEGORY: "android.intent.category.DEFAULT", APP_ICON: "@mipmap/ic_launcher"]
  69. }
  70. //非应用商店版本
  71. jdrh {
  72. resValue "string", "app_name", "入户走访"
  73. signingConfig signingConfigs.release
  74. manifestPlaceholders = [UMENG_CHANNEL: "jdrh", CATEGORY: "android.intent.category.LAUNCHER", APP_ICON: "@mipmap/ic_launcher"]
  75. }
  76. }
  77. productFlavors.all { flavor ->
  78. flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name, CATEGORY_VALUE: flavor.manifestPlaceholders.CATEGORY, APP_ICON: flavor.manifestPlaceholders.APP_ICON]
  79. // flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
  80. }
  81. applicationVariants.all { variant ->
  82. variant.outputs.all {
  83. if (variant.buildType.name == 'release') {
  84. // release:输出文件名必须命名为 outputFileName
  85. outputFileName = "${variant.productFlavors[0].name}_${variant.productFlavors[0].applicationId}_${buildType.name}_v${variant.versionName}_${releaseTime()}.apk"
  86. // output.outputFile = new File(output.outputFile.parent, apkName)
  87. } else {
  88. // debug 输出文件名必须命名为 outputFileName
  89. outputFileName = "${variant.productFlavors[0].name}_${project.getName()}_${buildType.name}.apk"
  90. // output.outputFile = new File(output.outputFile.parent, apkName)
  91. }
  92. }
  93. }
  94. configurations.all {
  95. resolutionStrategy {
  96. force 'androidx.core:core-ktx:1.6.0'
  97. }
  98. }
  99. lintOptions {
  100. disable 'InvalidPackage'
  101. disable "ResourceType"
  102. abortOnError false
  103. }
  104. }
  105. repositories {
  106. flatDir {
  107. dirs 'libs', '../common/libs'
  108. }
  109. }
  110. dependencies {
  111. implementation fileTree(include: ['*.jar'], dir: 'libs')
  112. /* implementation 'me.jessyan:arms:2.5.2'
  113. implementation 'me.jessyan:arms-imageloader-glide:2.5.2'*/
  114. //view
  115. implementation 'androidx.appcompat:appcompat:1.0.2'
  116. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  117. annotationProcessor(rootProject.ext.dependencies["butterknife-compiler"]) {
  118. exclude module: 'support-annotations'
  119. }
  120. //tools
  121. annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
  122. //注意 Arms 核心库现在并不会依赖某个 EventBus, 要想使用 EventBus, 还请在项目中自行依赖对应的 EventBus
  123. //现在支持两种 EventBus, greenrobot 的 EventBus 和畅销书 《Android源码设计模式解析与实战》的作者 何红辉 所作的 AndroidEventBus
  124. //依赖后 Arms 会自动检测您依赖的 EventBus 并自动注册
  125. //建议使用 AndroidEventBus, 特别是组件化项目, 原因请看 https://github.com/hehonghui/AndroidEventBus/issues/49
  126. //这种做法可以让使用者有自行选择三方库的权利, 并且还可以减轻 Arms 的体积
  127. // implementation rootProject.ext.dependencies["androideventbus"]
  128. // implementation rootProject.ext.dependencies["eventbus"]
  129. //test
  130. debugImplementation rootProject.ext.dependencies["canary-debug"]
  131. releaseImplementation rootProject.ext.dependencies["canary-release"]
  132. testImplementation rootProject.ext.dependencies["canary-release"]
  133. testImplementation rootProject.ext.dependencies["junit"]
  134. implementation rootProject.ext.dependencies["eventbus"]
  135. // implementation rootProject.ext.dependencies["design"]
  136. implementation project(':thirdparty')
  137. implementation project(':common')
  138. implementation 'com.github.chrisbanes.photoview:library:1.2.4'
  139. implementation rootProject.ext.dependencies["toast"]
  140. implementation rootProject.ext.dependencies["picasso"]
  141. // implementation 'me.jessyan:progressmanager:1.5.0'
  142. //页面引导
  143. // implementation 'com.binioter:guideview:1.0.0'
  144. implementation 'io.github.youth5201314:banner:2.2.2'
  145. implementation 'com.google.android.material:material:1.1.0'
  146. //粒子爆炸效果
  147. // implementation 'tyrantgit:explosionfield:1.0.1'
  148. //
  149. //添加StatusBarUtil的依赖
  150. implementation 'com.jaeger.statusbarutil:library:1.5.1'
  151. // implementation 'net.lingala.zip4j:zip4j:1.3.2'
  152. implementation 'com.xm.permissions:XmPermissions:1.0.1'
  153. implementation rootProject.ext.dependencies["SmartRefreshLayout"]
  154. implementation rootProject.ext.dependencies["SmartRefreshHeader"]
  155. implementation rootProject.ext.dependencies["SmartRefreshFooter"]
  156. implementation 'com.github.chrisbanes.photoview:library:1.2.4'
  157. implementation(name: 'imagepicker-release', ext: 'aar')
  158. //implementation 'com.contrarywind:Android-PickerView:4.1.8'
  159. implementation 'com.teprinciple:updateapputilsx:2.3.0'
  160. implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
  161. implementation(name: 'ocrsdk', ext: 'aar')
  162. implementation project(path: ':ocr_ui')
  163. //视频相关
  164. implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.2.4'
  165. implementation 'com.github.gcacace:signature-pad:1.3.1'
  166. implementation 'fm.jiecao:jiecaovideoplayer:5.5.4'
  167. implementation project(path: ':camera')
  168. //扫一扫支持全屏、从相册选择:需要支持7.0以下
  169. implementation 'com.google.zxing:core:3.3.3'
  170. implementation 'com.github.maning0303:MNZXingCode:V2.1.8'
  171. implementation 'q.rorbin:badgeview:1.1.3'
  172. implementation 'com.xiaosu:VerticalRollingTextView:2.0.9'
  173. implementation 'com.google.android.flexbox:flexbox:3.0.0'
  174. api 'com.google.vr:sdk-panowidget:1.80.0'
  175. implementation 'androidx.percentlayout:percentlayout:1.0.0'
  176. implementation 'de.hdodenhof:circleimageview:2.0.0'
  177. implementation 'com.contrarywind:Android-PickerView:4.1.8'
  178. //依赖版本错误可能导致Class not found, Android O minsdk, jdk版本等异常
  179. implementation 'org.postgresql:postgresql:42.1.2'
  180. }