apply plugin: 'com.android.application' def releaseTime() { return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC")) } android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] useLibrary 'org.apache.http.legacy' compileOptions { targetCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8 } defaultConfig { applicationId "com.xwkj.rwxffk" minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion 28 versionCode 1 versionName "1" testInstrumentationRunner rootProject.ext.dependencies["androidJUnitRunner"] flavorDimensions "1" } signingConfigs { debug { keyAlias 'zkjc_police' keyPassword 'jlszkjc777888' storeFile file("../sign/keystore.jks") storePassword 'jlszkjc777888' // v2SigningEnabled false } release { keyAlias 'zkjc_police' keyPassword 'jlszkjc777888' storeFile file("../sign/keystore.jks") storePassword 'jlszkjc777888' // v2SigningEnabled false } } buildTypes { debug { buildConfigField "boolean", "LOG_DEBUG", "true" buildConfigField "boolean", "USE_CANARY", "true" minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release { buildConfigField "boolean", "LOG_DEBUG", "false" buildConfigField "boolean", "USE_CANARY", "false" /*minifyEnabled false shrinkResources true zipAlignEnabled true*/ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } productFlavors { //应用商店版本 appstore { resValue "string", "app_name", "任务下发反馈" signingConfig signingConfigs.release manifestPlaceholders = [UMENG_CHANNEL: "appstore", CATEGORY: "android.intent.category.DEFAULT", APP_ICON: "@mipmap/ic_launcher"] } //非应用商店版本 unappstore { resValue "string", "app_name", "任务下发反馈" signingConfig signingConfigs.release manifestPlaceholders = [UMENG_CHANNEL: "unappstore", CATEGORY: "android.intent.category.LAUNCHER", APP_ICON: "@mipmap/ic_launcher"] } } productFlavors.all { flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name, CATEGORY_VALUE: flavor.manifestPlaceholders.CATEGORY, APP_ICON: flavor.manifestPlaceholders.APP_ICON] // flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name] } applicationVariants.all { variant -> variant.outputs.all { if (variant.buildType.name == 'release') { // release:输出文件名必须命名为 outputFileName outputFileName = "${variant.productFlavors[0].name}_${variant.productFlavors[0].applicationId}_${buildType.name}_v${variant.versionName}_${releaseTime()}.apk" // output.outputFile = new File(output.outputFile.parent, apkName) } else { // debug 输出文件名必须命名为 outputFileName outputFileName = "${variant.productFlavors[0].name}_${project.getName()}_${buildType.name}.apk" // output.outputFile = new File(output.outputFile.parent, apkName) } } } lintOptions { disable 'InvalidPackage' disable "ResourceType" abortOnError false } } repositories { flatDir { dirs 'libs', '../common/libs' } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) // implementation 'me.jessyan:arms:2.5.2' // implementation 'me.jessyan:arms-imageloader-glide:2.5.2' //view implementation rootProject.ext.dependencies["autosize"] annotationProcessor(rootProject.ext.dependencies["butterknife-compiler"]) { exclude module: 'support-annotations' } //tools annotationProcessor rootProject.ext.dependencies["dagger2-compiler"] //注意 Arms 核心库现在并不会依赖某个 EventBus, 要想使用 EventBus, 还请在项目中自行依赖对应的 EventBus //现在支持两种 EventBus, greenrobot 的 EventBus 和畅销书 《Android源码设计模式解析与实战》的作者 何红辉 所作的 AndroidEventBus //依赖后 Arms 会自动检测您依赖的 EventBus 并自动注册 //建议使用 AndroidEventBus, 特别是组件化项目, 原因请看 https://github.com/hehonghui/AndroidEventBus/issues/49 //这种做法可以让使用者有自行选择三方库的权利, 并且还可以减轻 Arms 的体积 implementation rootProject.ext.dependencies["androideventbus"] // implementation rootProject.ext.dependencies["eventbus"] //test debugImplementation rootProject.ext.dependencies["canary-debug"] releaseImplementation rootProject.ext.dependencies["canary-release"] testImplementation rootProject.ext.dependencies["canary-release"] testImplementation rootProject.ext.dependencies["junit"] implementation project(':thirdparty') implementation project(':common') }