build.gradle 2.3 KB

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