build.gradle 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.jakewharton.butterknife'
  3. apply plugin: 'org.greenrobot.greendao' // apply plugin
  4. //设置发布的显示的版本号
  5. static def getVersionName() {
  6. return new Date().format("yyyyMMddHHmm")
  7. }
  8. android {
  9. signingConfigs {
  10. depot {
  11. keyAlias 'depotkey'
  12. keyPassword 'depotPSW'
  13. storeFile file('../sign/depot.jks')
  14. storePassword 'depotPSW'
  15. }
  16. }
  17. compileSdkVersion 28
  18. defaultConfig {
  19. applicationId "com.chinaitop.linxia.detop"
  20. minSdkVersion 15
  21. targetSdkVersion 22
  22. versionCode 19
  23. versionName "1.19"
  24. flavorDimensions "default"
  25. signingConfig signingConfigs.depot
  26. ndk {
  27. // 设置支持的SO库架构
  28. abiFilters 'armeabi-v7a', 'x86'//, 'x86_64'//, 'arm64-v8a'
  29. }
  30. javaCompileOptions {
  31. annotationProcessorOptions {
  32. includeCompileClasspath = true
  33. }
  34. }
  35. }
  36. // Butterknife requires Java 8.
  37. compileOptions {
  38. sourceCompatibility 1.8
  39. targetCompatibility 1.8
  40. }
  41. buildTypes {
  42. debug {}
  43. release {
  44. minifyEnabled false
  45. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  46. signingConfig signingConfigs.depot
  47. }
  48. }
  49. sourceSets {
  50. main {
  51. jniLibs.srcDirs = ['libs']
  52. }
  53. }
  54. //配置自定义打包名称
  55. android.applicationVariants.all { variant ->
  56. variant.outputs.all { output ->
  57. def outputFile = output.outputFile
  58. if (outputFile != null && outputFile.name.endsWith('release.apk')) {
  59. def fileName = "${variant.productFlavors[0].name}_depot_release_" +
  60. "${defaultConfig.versionCode}_${new Date().format("yyyyMMddHHmm")}.apk"
  61. outputFileName = fileName
  62. }
  63. }
  64. }
  65. productFlavors {
  66. tianjin {
  67. applicationId "com.chinaitop.tianjin.detop"
  68. dimension "default"
  69. manifestPlaceholders = [APP_NAME: "@string/app_name_tianjin"]
  70. signingConfig signingConfigs.depot
  71. }
  72. }
  73. lintOptions {
  74. checkReleaseBuilds false
  75. // Or, if you prefer, you can continue to check for errors in release builds,
  76. // but continue the build even when errors are found:
  77. abortOnError false
  78. }
  79. }
  80. greendao {
  81. schemaVersion 7 //指定数据库schema版本号
  82. targetGenDir 'src/main/java'//生成数据库文件的目录
  83. }
  84. dependencies {
  85. implementation fileTree(include: ['*.jar'], dir: 'libs')
  86. implementation project(':MPChartLib')
  87. implementation project(':mqlibrary')
  88. implementation 'com.android.support:gridlayout-v7:28.0.0'
  89. implementation 'com.android.support:appcompat-v7:28.0.0'
  90. implementation 'com.android.support.constraint:constraint-layout:2.0.4'
  91. // implementation 'net.zetetic:android-database-sqlcipher:3.5.7'
  92. annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc2'
  93. implementation 'com.google.android:flexbox:1.0.0'
  94. }