apply plugin: 'com.android.application' apply plugin: 'com.neenbedankt.android-apt' static def buildTime() { return new Date().format("yyyyMMdd"); } android { signingConfigs { release { // keyAlias '' // keyPassword '' // storeFile file('') // storePassword '' } } compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion defaultConfig { applicationId "com.guiying.androidmodulepattern" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode rootProject.ext.versionCode versionName rootProject.ext.versionName multiDexEnabled true //打包时间 resValue "string", "build_time", buildTime() } buildTypes { release { //更改AndroidManifest.xml中预先定义好占位符信息 //manifestPlaceholders = [app_icon: "@drawable/icon"] // 不显示Log buildConfigField "boolean", "LEO_DEBUG", "false" //是否zip对齐 zipAlignEnabled true // 缩减resource文件 shrinkResources true //Proguard minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' //签名 signingConfig signingConfigs.release } debug { //给applicationId添加后缀“.debug” applicationIdSuffix ".debug" //manifestPlaceholders = [app_icon: "@drawable/launch_beta"] buildConfigField "boolean", "LOG_DEBUG", "true" zipAlignEnabled false shrinkResources false minifyEnabled false debuggable true } } //执行lint检查,有任何的错误或者警告提示,都会终止构建,可以将其关掉 lintOptions { checkReleaseBuilds false abortOnError false } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) if (isModule.toBoolean()) { compile project(':lib_common') } else { compile project(':module_main') compile project(':module_girls') compile project(':module_news') } //router apt "com.github.mzule.activityrouter:compiler:$rootProject.aptCompilerVersion" }