build.gradle 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.neenbedankt.android-apt'
  3. def buildTime() {
  4. return new Date().format("yyyyMMdd");
  5. }
  6. android {
  7. compileSdkVersion rootProject.ext.compileSdkVersion
  8. buildToolsVersion rootProject.ext.buildToolsVersion
  9. defaultConfig {
  10. applicationId "com.guiying.androidmodulepattern"
  11. minSdkVersion rootProject.ext.minSdkVersion
  12. targetSdkVersion rootProject.ext.targetSdkVersion
  13. versionCode rootProject.ext.versionCode
  14. versionName rootProject.ext.versionName
  15. //multiDexEnabled true
  16. //打包时间
  17. resValue "string", "build_time", buildTime()
  18. }
  19. buildTypes {
  20. release {
  21. //更改AndroidManifest.xml中预先定义好占位符信息
  22. //manifestPlaceholders = [app_icon: "@drawable/icon"]
  23. // 不显示Log
  24. buildConfigField "boolean", "LEO_DEBUG", "false"
  25. //是否zip对齐
  26. zipAlignEnabled true
  27. // 缩减resource文件
  28. shrinkResources true
  29. //Proguard
  30. minifyEnabled true
  31. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  32. //签名
  33. //signingConfig signingConfigs.release
  34. }
  35. debug {
  36. //给applicationId添加后缀“.debug”
  37. applicationIdSuffix ".debug"
  38. //manifestPlaceholders = [app_icon: "@drawable/launch_beta"]
  39. buildConfigField "boolean", "LOG_DEBUG", "true"
  40. zipAlignEnabled false
  41. shrinkResources false
  42. minifyEnabled false
  43. debuggable true
  44. }
  45. }
  46. }
  47. dependencies {
  48. compile fileTree(dir: 'libs', include: ['*.jar'])
  49. if (!isModule.toBoolean()) {
  50. compile project(':main')
  51. compile project(':girls')
  52. compile project(':news')
  53. } else {
  54. compile project(':common')
  55. }
  56. //router
  57. apt "com.github.mzule.activityrouter:compiler:$rootProject.aptCompilerVersion"
  58. }