apply plugin: 'com.android.application' def releaseTime() { return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC")) } //必须配置 def mfph = [ //包名 "apk.applicationId" : "com.xwkj.sqjw", ] 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.sqjw" minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion 28 versionCode 100 versionName "1.00" testInstrumentationRunner rootProject.ext.dependencies["androidJUnitRunner"] flavorDimensions "1" multiDexEnabled true manifestPlaceholders = mfph ndk { abiFilters 'x86_64','arm64-v8a' //不支持armeabi } } sourceSets { main { jniLibs.srcDirs = ['libs'] } } 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' } } //此处配置必须添加 否则无法正确运行 aaptOptions { additionalParameters '--auto-add-overlay' //noCompress 'foo', 'bar' ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~" } productFlavors { //应用商店版本 sqjw { resValue "string", "app_name", "社区警务" signingConfig signingConfigs.release manifestPlaceholders = [UMENG_CHANNEL: "sqjw", CATEGORY: "android.intent.category.DEFAULT", APP_ICON: "@mipmap/ic_launcher"] } //非应用商店版本 jdrh { resValue "string", "app_name", "警地融合" signingConfig signingConfigs.release manifestPlaceholders = [UMENG_CHANNEL: "jdrh", 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) } } } configurations.all { resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' } } lintOptions { disable 'InvalidPackage' disable "ResourceType" abortOnError false } } repositories { flatDir { dirs 'libs', '../common/libs' } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(include: ['*.aar'], dir: 'libs') // 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') implementation project(':downloaderHelper') implementation rootProject.ext.dependencies["recyclerview-v7"] implementation rootProject.ext.dependencies["support-v4"] implementation rootProject.ext.dependencies["appcompat-v7"] implementation rootProject.ext.dependencies["fastjson"] implementation rootProject.ext.dependencies["fresco"] implementation rootProject.ext.dependencies["picasso"] implementation rootProject.ext.dependencies["animated-gif"] implementation rootProject.ext.dependencies["webpsupport"] implementation rootProject.ext.dependencies["animated-webp"] implementation rootProject.ext.dependencies["glide"] implementation rootProject.ext.dependencies["multidex"] implementation 'androidx.webkit:webkit:1.3.0' }