build.gradle 9.0 KB

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