build.gradle 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.jakewharton.butterknife'
  3. android {
  4. signingConfigs {
  5. release {
  6. storeFile file('../sign/intelhouse.jks')
  7. storePassword 'intelhousePSW'
  8. keyAlias = 'intelhousekey'
  9. keyPassword 'intelhousePSW'
  10. }
  11. }
  12. compileSdkVersion 28
  13. defaultConfig {
  14. applicationId "com.mq.handhelddevice"
  15. minSdkVersion 15
  16. // targetSdkVersion 22
  17. targetSdkVersion 28
  18. versionCode 1
  19. versionName "3.0"
  20. ndk {
  21. abiFilters "armeabi"
  22. }
  23. signingConfig signingConfigs.release
  24. }
  25. buildTypes {
  26. release {
  27. signingConfig signingConfigs.release
  28. minifyEnabled false
  29. // 指定混淆规则,需要压缩优化的混淆要把proguard-android.txt换成proguard-android.txt
  30. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  31. }
  32. }
  33. lintOptions {
  34. checkReleaseBuilds false
  35. // Or, if you prefer, you can continue to check for errors in release builds,
  36. // but continue the build even when errors are found:
  37. abortOnError false
  38. }
  39. // Butterknife requires Java 8.
  40. compileOptions {
  41. sourceCompatibility 1.8
  42. targetCompatibility 1.8
  43. }
  44. sourceSets {
  45. main {
  46. jniLibs.srcDirs = ['libs']
  47. }
  48. }
  49. // 配置自定义打包名称
  50. android.applicationVariants.all { variant ->
  51. variant.outputs.all { output ->
  52. def outputFile = output.outputFile
  53. if (outputFile != null && outputFile.name.endsWith('release.apk')) {
  54. //打包名称 xxxx_yunnan_2.0_201911011522.apk
  55. def fileName = "汽车火车-值仓" +// 业务名称
  56. "_" +
  57. // 渠道
  58. "${variant.productFlavors[0].name}" +
  59. "_" +
  60. // 版本号
  61. "${defaultConfig.versionName}" +
  62. "_" +
  63. // 时间
  64. "${new Date().format("yyyyMMddHHmm")}" +
  65. // 后缀
  66. ".apk"
  67. outputFileName = fileName
  68. }
  69. }
  70. }
  71. flavorDimensions "city"
  72. productFlavors {
  73. // 云南
  74. yunnan {
  75. dimension "city"
  76. manifestPlaceholders = [CHANNEL_ID_VALUE: "yunnan"]
  77. }
  78. // 山西
  79. shanxi {
  80. dimension "city"
  81. manifestPlaceholders = [CHANNEL_ID_VALUE: "shanxi"]
  82. }
  83. // 天津
  84. tianjin {
  85. dimension "city"
  86. manifestPlaceholders = [CHANNEL_ID_VALUE: "tianjin"]
  87. }
  88. // // 普洱
  89. // puer {
  90. // dimension "city"
  91. // manifestPlaceholders = [CHANNEL_ID_VALUE: "puer"]
  92. // }
  93. }
  94. }
  95. dependencies {
  96. implementation fileTree(dir: 'libs', include: ['*.jar'])
  97. implementation project(path: ':mylibrary')
  98. implementation 'com.jakewharton:butterknife:9.0.0'
  99. annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0'
  100. }