build.gradle 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.zhongzhuanzhuangche"
  15. minSdkVersion 15
  16. // targetSdkVersion 22
  17. targetSdkVersion 28
  18. versionCode 1
  19. versionName "2.8"
  20. ndk {
  21. abiFilters "armeabi"
  22. }
  23. signingConfig signingConfigs.release
  24. }
  25. buildTypes {
  26. release {
  27. signingConfig signingConfigs.release
  28. minifyEnabled false
  29. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  30. }
  31. }
  32. lintOptions {
  33. checkReleaseBuilds false
  34. // Or, if you prefer, you can continue to check for errors in release builds,
  35. // but continue the build even when errors are found:
  36. abortOnError false
  37. }
  38. // Butterknife requires Java 8.
  39. compileOptions {
  40. sourceCompatibility 1.8
  41. targetCompatibility 1.8
  42. }
  43. sourceSets {
  44. main {
  45. jniLibs.srcDirs = ['libs']
  46. }
  47. }
  48. // 配置自定义打包名称
  49. android.applicationVariants.all { variant ->
  50. variant.outputs.all { output ->
  51. def outputFile = output.outputFile
  52. if (outputFile != null && outputFile.name.endsWith('release.apk')) {
  53. //打包名称 xxxx_yunnan_2.0_201911011522.apk
  54. def fileName = "到站中转-汽车装车" +// 业务名称
  55. "_" +
  56. // 渠道
  57. "${variant.productFlavors[0].name}" +
  58. "_" +
  59. // 版本号
  60. "${defaultConfig.versionName}" +
  61. "_" +
  62. // 时间
  63. "${new Date().format("yyyyMMddHHmm")}" +
  64. // 后缀
  65. ".apk"
  66. outputFileName = fileName
  67. }
  68. }
  69. }
  70. flavorDimensions "city"
  71. productFlavors {
  72. // 云南
  73. yunnan {
  74. dimension "city"
  75. manifestPlaceholders = [CHANNEL_ID_VALUE: "yunnan"]
  76. }
  77. // 山西
  78. shanxi {
  79. dimension "city"
  80. manifestPlaceholders = [CHANNEL_ID_VALUE: "shanxi"]
  81. }
  82. // 天津
  83. tianjin {
  84. dimension "city"
  85. manifestPlaceholders = [CHANNEL_ID_VALUE: "tianjin"]
  86. }
  87. // // 普洱
  88. // puer {
  89. // dimension "city"
  90. // manifestPlaceholders = [CHANNEL_ID_VALUE: "puer"]
  91. // }
  92. }
  93. }
  94. dependencies {
  95. implementation fileTree(dir: 'libs', include: ['*.jar'])
  96. implementation project(path: ':mylibrary')
  97. implementation 'com.jakewharton:butterknife:9.0.0'
  98. annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0'
  99. }