build.gradle 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'org.greenrobot.greendao'
  3. apply plugin: 'bugly'
  4. //设置发布的显示的版本号
  5. static def getVersionName() {
  6. return new Date().format("yyyyMMddHHmm")
  7. }
  8. android {
  9. compileSdkVersion 26
  10. buildToolsVersion "26.0.2"
  11. defaultConfig {
  12. applicationId "hf.lskj.com.carstockcount"
  13. minSdkVersion 19
  14. targetSdkVersion 26
  15. versionCode 1
  16. versionName '1.0.0'
  17. // testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  18. //添加部分
  19. javaCompileOptions {
  20. annotationProcessorOptions {
  21. includeCompileClasspath true
  22. }
  23. }
  24. }
  25. signingConfigs {
  26. //配置keystore签名
  27. release {
  28. v1SigningEnabled true
  29. v2SigningEnabled true
  30. storeFile file('intelhouse.jks')
  31. storePassword "intelhousePSW"
  32. keyAlias "intelhousekey"
  33. keyPassword "intelhousePSW"
  34. }
  35. }
  36. buildTypes {
  37. debug {}
  38. release {
  39. signingConfig signingConfigs.release
  40. minifyEnabled false
  41. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  42. }
  43. }
  44. sourceSets {
  45. main {
  46. jniLibs.srcDirs = ['libs']
  47. }
  48. }
  49. //配置自定义打包名称
  50. // applicationVariants.all { variant ->
  51. // variant.outputs.each { output ->
  52. // def outputFile = output.outputFile
  53. // if (outputFile != null && outputFile.name.endsWith('.apk')) {
  54. // if (variant.buildType.name.equals('release')) {
  55. // def originalName= outputFile.name.substring(0,outputFile.name.indexOf('.apk'))
  56. // variant.mergedFlavor.versionName = getVersionName()
  57. // def fileName = originalName+"${variant.mergedFlavor.versionName}.apk"
  58. // output.outputFile = new File(outputFile.parent, fileName)
  59. // }
  60. //
  61. // }
  62. // }
  63. // }
  64. lintOptions {
  65. checkReleaseBuilds false
  66. abortOnError false
  67. }
  68. productFlavors {
  69. }
  70. }
  71. bugly {
  72. appId = 'c7b34b5874' // 注册时分配的App ID
  73. appKey = '9663ec33-8e14-47e4-94cf-8939f9ea0e78' // 注册时分配的App Key
  74. }
  75. greendao {
  76. schemaVersion 12 //指定数据库schema版本号
  77. targetGenDir 'src/main/java'//生成数据库文件的目录
  78. }
  79. dependencies {
  80. compile fileTree(include: ['*.jar'], dir: 'libs')
  81. // androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  82. // exclude group: 'com.android.support', module: 'support-annotations'
  83. // })
  84. compile 'com.tencent.bugly:crashreport:latest.release'
  85. compile 'org.greenrobot:eventbus:3.0.0'
  86. compile 'com.android.support.constraint:constraint-layout:1.0.2'
  87. compile 'com.android.support:appcompat-v7:26.0.2'
  88. compile 'com.google.code.gson:gson:2.8.0'
  89. compile 'com.jakewharton:butterknife:7.0.1'
  90. compile 'org.greenrobot:greendao:3.2.2'
  91. compile 'com.android.support:design:26.0.2'
  92. compile 'com.android.support:support-v4:26.0.2'
  93. compile 'com.squareup.okhttp3:okhttp:3.8.1'
  94. // testCompile 'junit:junit:4.12'
  95. }