build.gradle 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.neenbedankt.android-apt'
  3. static def buildTime() {
  4. return new Date().format("yyyyMMdd");
  5. }
  6. android {
  7. signingConfigs {
  8. release {
  9. // keyAlias ''
  10. // keyPassword ''
  11. // storeFile file('')
  12. // storePassword ''
  13. }
  14. }
  15. compileSdkVersion rootProject.ext.compileSdkVersion
  16. buildToolsVersion rootProject.ext.buildToolsVersion
  17. defaultConfig {
  18. applicationId "com.guiying.androidmodulepattern"
  19. minSdkVersion rootProject.ext.minSdkVersion
  20. targetSdkVersion rootProject.ext.targetSdkVersion
  21. versionCode rootProject.ext.versionCode
  22. versionName rootProject.ext.versionName
  23. multiDexEnabled true
  24. //打包时间
  25. resValue "string", "build_time", buildTime()
  26. }
  27. buildTypes {
  28. release {
  29. //更改AndroidManifest.xml中预先定义好占位符信息
  30. //manifestPlaceholders = [app_icon: "@drawable/icon"]
  31. // 不显示Log
  32. buildConfigField "boolean", "LEO_DEBUG", "false"
  33. //是否zip对齐
  34. zipAlignEnabled true
  35. // 缩减resource文件
  36. shrinkResources true
  37. //Proguard
  38. minifyEnabled true
  39. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  40. //签名
  41. signingConfig signingConfigs.release
  42. }
  43. debug {
  44. //给applicationId添加后缀“.debug”
  45. applicationIdSuffix ".debug"
  46. //manifestPlaceholders = [app_icon: "@drawable/launch_beta"]
  47. buildConfigField "boolean", "LOG_DEBUG", "true"
  48. zipAlignEnabled false
  49. shrinkResources false
  50. minifyEnabled false
  51. debuggable true
  52. }
  53. }
  54. //执行lint检查,有任何的错误或者警告提示,都会终止构建,可以将其关掉
  55. lintOptions {
  56. checkReleaseBuilds false
  57. abortOnError false
  58. }
  59. }
  60. dependencies {
  61. compile fileTree(dir: 'libs', include: ['*.jar'])
  62. if (isModule.toBoolean()) {
  63. compile project(':lib_common')
  64. } else {
  65. compile project(':module_main')
  66. compile project(':module_girls')
  67. compile project(':module_news')
  68. }
  69. //router
  70. apt "com.github.mzule.activityrouter:compiler:$rootProject.aptCompilerVersion"
  71. }