build.gradle 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. apply plugin: 'com.android.application'
  2. def releaseTime() {
  3. return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
  4. }
  5. android {
  6. compileSdkVersion 29
  7. useLibrary 'org.apache.http.legacy'
  8. compileOptions {
  9. targetCompatibility JavaVersion.VERSION_1_8
  10. sourceCompatibility JavaVersion.VERSION_1_8
  11. }
  12. defaultConfig {
  13. applicationId "com.xwkj.control"
  14. minSdkVersion rootProject.ext.android["minSdkVersion"]
  15. targetSdkVersion 29
  16. versionCode 38
  17. versionName "3.8"
  18. testInstrumentationRunner rootProject.ext.dependencies["androidJUnitRunner"]
  19. flavorDimensions "1"
  20. }
  21. signingConfigs {
  22. debug {
  23. keyAlias 'zkjc_police'
  24. keyPassword 'jlszkjc777888'
  25. storeFile file("../sign/keystore.jks")
  26. storePassword 'jlszkjc777888'
  27. // v2SigningEnabled false
  28. }
  29. release {
  30. keyAlias 'zkjc_police'
  31. keyPassword 'jlszkjc777888'
  32. storeFile file("../sign/keystore.jks")
  33. storePassword 'jlszkjc777888'
  34. // v2SigningEnabled false
  35. }
  36. }
  37. buildTypes {
  38. debug {
  39. buildConfigField "boolean", "LOG_DEBUG", "true"
  40. buildConfigField "boolean", "USE_CANARY", "true"
  41. minifyEnabled false
  42. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  43. }
  44. release {
  45. buildConfigField "boolean", "LOG_DEBUG", "false"
  46. buildConfigField "boolean", "USE_CANARY", "false"
  47. /*minifyEnabled false
  48. shrinkResources true
  49. zipAlignEnabled true*/
  50. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  51. }
  52. }
  53. productFlavors {
  54. //应用商店版本
  55. appstore {
  56. resValue "string", "app_name", "手机控制"
  57. signingConfig signingConfigs.release
  58. manifestPlaceholders = [UMENG_CHANNEL: "appstore", CATEGORY: "android.intent.category.DEFAULT", APP_ICON: "@mipmap/ic_launcher"]
  59. }
  60. //非应用商店版本
  61. unappstore {
  62. resValue "string", "app_name", "手机控制"
  63. signingConfig signingConfigs.release
  64. manifestPlaceholders = [UMENG_CHANNEL: "unappstore", CATEGORY: "android.intent.category.LAUNCHER", APP_ICON: "@mipmap/ic_launcher"]
  65. }
  66. }
  67. productFlavors.all { flavor ->
  68. flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name, CATEGORY_VALUE: flavor.manifestPlaceholders.CATEGORY, APP_ICON: flavor.manifestPlaceholders.APP_ICON]
  69. // flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
  70. }
  71. applicationVariants.all { variant ->
  72. variant.outputs.all {
  73. if (variant.buildType.name == 'release') {
  74. // release:输出文件名必须命名为 outputFileName
  75. outputFileName = "${variant.productFlavors[0].name}_${variant.productFlavors[0].applicationId}_${buildType.name}_v${variant.versionName}_${releaseTime()}.apk"
  76. // output.outputFile = new File(output.outputFile.parent, apkName)
  77. } else {
  78. // debug 输出文件名必须命名为 outputFileName
  79. outputFileName = "${variant.productFlavors[0].name}_${project.getName()}_${buildType.name}.apk"
  80. // output.outputFile = new File(output.outputFile.parent, apkName)
  81. }
  82. }
  83. }
  84. lintOptions {
  85. disable 'InvalidPackage'
  86. disable "ResourceType"
  87. abortOnError false
  88. }
  89. }
  90. repositories {
  91. flatDir {
  92. dirs 'libs', '../common/libs'
  93. }
  94. }
  95. dependencies {
  96. implementation fileTree(include: ['*.jar'], dir: 'libs')
  97. /* implementation 'me.jessyan:arms:2.5.2'
  98. implementation 'me.jessyan:arms-imageloader-glide:2.5.2'*/
  99. //view
  100. implementation rootProject.ext.dependencies["autosize"]
  101. implementation 'androidx.appcompat:appcompat:1.0.2'
  102. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  103. annotationProcessor(rootProject.ext.dependencies["butterknife-compiler"]) {
  104. exclude module: 'support-annotations'
  105. }
  106. //tools
  107. annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
  108. implementation rootProject.ext.dependencies["picasso"]
  109. //注意 Arms 核心库现在并不会依赖某个 EventBus, 要想使用 EventBus, 还请在项目中自行依赖对应的 EventBus
  110. //现在支持两种 EventBus, greenrobot 的 EventBus 和畅销书 《Android源码设计模式解析与实战》的作者 何红辉 所作的 AndroidEventBus
  111. //依赖后 Arms 会自动检测您依赖的 EventBus 并自动注册
  112. //建议使用 AndroidEventBus, 特别是组件化项目, 原因请看 https://github.com/hehonghui/AndroidEventBus/issues/49
  113. //这种做法可以让使用者有自行选择三方库的权利, 并且还可以减轻 Arms 的体积
  114. // implementation rootProject.ext.dependencies["androideventbus"]
  115. // implementation rootProject.ext.dependencies["eventbus"]
  116. //test
  117. debugImplementation rootProject.ext.dependencies["canary-debug"]
  118. releaseImplementation rootProject.ext.dependencies["canary-release"]
  119. testImplementation rootProject.ext.dependencies["canary-release"]
  120. testImplementation rootProject.ext.dependencies["junit"]
  121. implementation rootProject.ext.dependencies["eventbus"]
  122. // implementation rootProject.ext.dependencies["design"]
  123. implementation project(':thirdparty')
  124. implementation project(':common')
  125. implementation 'com.google.android.material:material:1.1.0'
  126. implementation 'com.xm.permissions:XmPermissions:1.0.1'
  127. implementation 'com.github.chrisbanes.photoview:library:1.2.4'
  128. implementation 'org.java-websocket:Java-WebSocket:1.5.3'
  129. implementation project(path: ':library')
  130. implementation 'com.dou361.ijkplayer:jjdxm-ijkplayer:1.0.5'
  131. implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
  132. implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
  133. implementation 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8'
  134. }