build.gradle 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. apply plugin: 'com.android.application'
  2. //apply plugin: 'AndResGuard'
  3. android {
  4. signingConfigs {
  5. udapda {
  6. keyAlias 'xuslectronic_key'
  7. keyPassword 'pdakeystone'
  8. storeFile file('C:\\sigin\\xuslectronic_keystone.jks')
  9. storePassword 'pdakeystone'
  10. }
  11. }
  12. compileSdkVersion rootProject.ext.android.compileSdkVersion
  13. buildToolsVersion rootProject.ext.android.buildToolsVersion
  14. defaultConfig {
  15. applicationId "com.uas.xuslectronic"
  16. minSdkVersion rootProject.ext.android.minSdkVersion
  17. targetSdkVersion rootProject.ext.android.targetSdkVersion
  18. versionCode rootProject.ext.android.versionCode
  19. versionName rootProject.ext.android.versionName
  20. javaCompileOptions {
  21. annotationProcessorOptions {
  22. includeCompileClasspath = true
  23. }
  24. }
  25. }
  26. buildTypes {
  27. release {
  28. minifyEnabled false
  29. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  30. }
  31. }
  32. packagingOptions {
  33. exclude 'META-INF/LICENSE.txt'
  34. exclude 'META-INF/NOTICE.txt'
  35. }
  36. applicationVariants.all { variant ->
  37. variant.outputs.all { output ->
  38. def outputFile = output.outputFile
  39. def fileName
  40. if (outputFile != null && outputFile.name.endsWith('.apk')) {
  41. if (variant.buildType.name.equals('release')) {
  42. def releaseInfo = getVersionName()
  43. fileName = "xuslectronic_RELEASE_${releaseInfo}.apk"
  44. } else if (variant.buildType.name.equals('debug')) {
  45. def debugInfo = getVersionName()
  46. fileName = "UAS_MES_xuslectronic_DEBUG_${debugInfo}.apk"
  47. }
  48. outputFileName = fileName
  49. }
  50. }
  51. }
  52. compileOptions {
  53. targetCompatibility 1.8
  54. sourceCompatibility 1.8
  55. }
  56. }
  57. dependencies {
  58. implementation fileTree(include: ['*.jar'], dir: 'libs')
  59. testImplementation 'junit:junit:4.12'
  60. api files('libs/volley.jar')
  61. api files('libs/gson-2.2.4.jar')
  62. api project(':pulltoreflashlibrary')
  63. api project(':progresslitelibrary')
  64. api project(':lib-zxing')
  65. implementation deps.appcompatV7
  66. implementation deps.stetho
  67. implementation deps.fastjson
  68. implementation deps.xUtils
  69. implementation deps.okhttp
  70. implementation project(':bluetooth')
  71. implementation deps.switchView
  72. implementation deps.BaseRecyclerViewAdapterHelper
  73. implementation deps.smartRefreshLayout
  74. implementation deps.smartRefreshHeader
  75. implementation deps.recyclerview
  76. implementation deps.permisson
  77. implementation deps.basePopup
  78. implementation deps.smartTable
  79. implementation 'com.umeng.umsdk:common:9.4.0'// 必选
  80. implementation 'com.umeng.umsdk:asms:1.2.3'// 必选
  81. implementation 'com.umeng.umsdk:apm:1.4.0' // 错误分析升级为独立SDK,看crash数据请一定集成,可选
  82. implementation 'org.greenrobot:eventbus:3.1.1'
  83. }
  84. def getVersionName() {
  85. return rootProject.ext.android.versionName
  86. }
  87. /*andResGuard {
  88. // mappingFile = file("./resource_mapping.txt")
  89. mappingFile = null
  90. use7zip = true
  91. useSign = true
  92. // 打开这个开关,会keep住所有资源的原始路径,只混淆资源的名字
  93. keepRoot = false
  94. whiteList = [
  95. // for your icon
  96. "R.mipmap.icon",
  97. // for fabric
  98. "R.string.com.crashlytics.*",
  99. // for google-services
  100. "R.string.google_app_id",
  101. "R.string.gcm_defaultSenderId",
  102. "R.string.default_web_client_id",
  103. "R.string.ga_trackingId",
  104. "R.string.firebase_database_url",
  105. "R.string.google_api_key",
  106. "R.string.google_crash_reporting_api_key",
  107. //for umeng
  108. "R.anim.umeng*",
  109. "R.string.umeng*",
  110. "R.string.UM*",
  111. "R.string.tb_*",
  112. "R.layout.umeng*",
  113. "R.layout.socialize_*",
  114. "R.layout.*messager*",
  115. "R.layout.tb_*",
  116. "R.color.umeng*",
  117. "R.color.tb_*",
  118. "R.style.*UM*",
  119. "R.style.umeng*",
  120. "R.drawable.umeng*",
  121. "R.drawable.tb_*",
  122. "R.drawable.sina*",
  123. "R.drawable.qq_*",
  124. "R.drawable.tb_*",
  125. "R.id.umeng*",
  126. "R.id.*messager*",
  127. "R.id.progress_bar_parent",
  128. "R.id.socialize_*",
  129. "R.id.webView",
  130. //for jpush
  131. "R.drawable.jpush_notification_icon"
  132. ]
  133. compressFilePattern = [
  134. "*.png",
  135. "*.jpg",
  136. "*.jpeg",
  137. "*.gif",
  138. ]
  139. sevenzip {
  140. artifact = 'com.tencent.mm:SevenZip:1.2.13'
  141. //path = "/usr/local/bin/7za"
  142. }
  143. *//**
  144. * 可选: 如果不设置则会默认覆盖assemble输出的apk
  145. **//*
  146. // finalApkBackupPath = "${project.rootDir}/final.apk"
  147. *//**
  148. * 可选: 指定v1签名时生成jar文件的摘要算法
  149. * 默认值为“SHA-1”
  150. **//*
  151. // digestalg = "SHA-256"
  152. }*/