build.gradle 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'org.greenrobot.greendao' // apply plugin
  3. //设置发布的显示的版本号
  4. static def getVersionName() {
  5. return new Date().format("yyyyMMddHHmm")
  6. }
  7. android {
  8. signingConfigs {
  9. depot {
  10. keyAlias 'depotkey'
  11. keyPassword 'depotPSW'
  12. storeFile file('depot.jks')
  13. storePassword 'depotPSW'
  14. }
  15. }
  16. compileSdkVersion 27
  17. defaultConfig {
  18. applicationId "com.chinaitop.linxia.detop"
  19. minSdkVersion 15
  20. targetSdkVersion 27
  21. versionCode 3
  22. versionName "1.2"
  23. flavorDimensions "default"
  24. ndk {
  25. // 设置支持的SO库架构
  26. abiFilters 'armeabi', 'x86'//, 'armeabi-v7a', 'x86_64', 'arm64-v8a'
  27. }
  28. javaCompileOptions {
  29. annotationProcessorOptions {
  30. includeCompileClasspath = true
  31. }
  32. }
  33. signingConfig signingConfigs.depot
  34. multiDexEnabled true
  35. }
  36. buildTypes {
  37. debug {}
  38. release {
  39. minifyEnabled false
  40. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  41. signingConfig signingConfigs.depot
  42. }
  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. def fileName = "${variant.productFlavors[0].name}_depot_release_" +
  55. "${defaultConfig.versionCode}_${new Date().format("yyyyMMddHHmm")}.apk"
  56. outputFileName = fileName
  57. }
  58. }
  59. }
  60. productFlavors {
  61. jiangxi {
  62. applicationId "com.chinaitop.linxia.detop.jiangxi"
  63. dimension "default"
  64. manifestPlaceholders = [APP_NAME: "@string/app_name"]
  65. signingConfig signingConfigs.depot
  66. }
  67. linxia {
  68. applicationId "com.chinaitop.linxia.detop"
  69. dimension "default"
  70. manifestPlaceholders = [APP_NAME: "@string/app_name"]
  71. signingConfig signingConfigs.depot
  72. }
  73. }
  74. lintOptions {
  75. checkReleaseBuilds false
  76. abortOnError false
  77. }
  78. }
  79. greendao {
  80. schemaVersion 6 //指定数据库schema版本号
  81. targetGenDir 'src/main/java'//生成数据库文件的目录
  82. }
  83. dependencies {
  84. implementation fileTree(include: ['*.jar'], dir: 'libs')
  85. // compile 'com.tencent.bugly:nativecrashreport:latest.release'
  86. // compile 'com.jakewharton:butterknife:7.0.0'
  87. implementation project(':MPChartLib')
  88. implementation project(':mqlibrary')
  89. implementation 'com.android.support:gridlayout-v7:27.0.2'
  90. implementation 'net.zetetic:android-database-sqlcipher:3.5.7'
  91. annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
  92. }