apply plugin: 'com.android.application' apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'com.huawei.agconnect' apply plugin: 'com.tencent.vasdolly' apply from: '../mob.gradle' apply plugin: 'android-junk-code' def onlyArm64 = Boolean.parseBoolean(only_arm64) android { compileSdkVersion 30 defaultConfig { applicationId "com.voice.magic" minSdkVersion 21 targetSdkVersion 29 versionCode Integer.valueOf(version_code) versionName version_name testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true ndk { //设置支持的SO库架构 if (onlyArm64) { abiFilters "arm64-v8a" } else { abiFilters "armeabi-v7a", "arm64-v8a" } } flavorDimensions 'default' } //在apk文件后边生成版本号信息 android.applicationVariants.all { variant -> variant.outputs.all { def date = new Date().format("MMddHHmm", TimeZone.getTimeZone("GMT+08")) outputFileName = "yinyou_${buildType.name}_v${defaultConfig.versionName}-${date}.apk" } } lintOptions { abortOnError false disable 'MissingTranslation' disable 'ExtraTranslation' } dataBinding { enabled = true } viewBinding { enabled = true } packagingOptions { exclude 'lib/armeabi-v7a/libagora-crypto.so' } signingConfigs { v2 { storeFile file('../magic.jks') storePassword "magic2020" keyAlias "magic" keyPassword "magic2020" v2SigningEnabled true v1SigningEnabled true } v1 { storeFile file('../magic.jks') storePassword "magic2020" keyAlias "magic" keyPassword "magic2020" v2SigningEnabled false v1SigningEnabled true } } sourceSets { main { java.srcDirs = [ 'src/main/java', 'src/module_public_chat_hall/java', 'src/module_upgrade_app/java', 'src/module_mentoring_relationship/java', 'src/module_labour_union/java', 'src/module_room_chat/java', 'src/model_customer_server/java', 'src/module_music/java', 'src/module_mini_world/java', 'src/module_lottery_dialog/java', 'src/module_bank_card/java', 'src/module_super_admin/java', 'src/module_treasure_box/java', 'src/module_community/java', 'src/module_album/java', 'src/module_quick_pass/java' ] res.srcDirs = [ 'src/main/res', 'src/common/res', 'src/module_public_chat_hall/res', 'src/module_upgrade_app/res', 'src/module_mentoring_relationship/res', 'src/module_labour_union/res', 'src/module_room_chat/res', 'src/model_customer_server/res', 'src/module_music/res', 'src/module_mini_world/res', 'src/module_lottery_dialog/res', 'src/module_bank_card/res', 'src/module_super_admin/res', 'src/module_treasure_box/res', 'src/module_community/res', 'src/module_album/res', 'src/module_quick_pass/res' ] jniLibs.srcDirs = ['libs', 'aliyun-libs'] } } buildTypes { release { buildConfigField "String", "BASE_URL", "\"https://yinyou.api.shengxuanwangluo.com/\"" buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL" buildConfigField "String", "BASE_URL_STAGING", "BASE_URL" buildConfigField "String", "BASE_URL_RELEASE", "BASE_URL" minifyEnabled true shrinkResources true signingConfig signingConfigs.v2 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { buildConfigField "String", "BASE_URL", "\"http://api.uat.lecheng163.com/\"" buildConfigField "String", "BASE_URL_DEBUG", "BASE_URL" buildConfigField "String", "BASE_URL_STAGING", "\"https://yinyou.api.shengxuanwangluo.com/\"" buildConfigField "String", "BASE_URL_RELEASE", "\"https://yinyou.api.shengxuanwangluo.com/\"" minifyEnabled false shrinkResources false signingConfig signingConfigs.v1 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = "1.8" } buildToolsVersion = '30.0.3' } def Lombok = "1.18.10" dependencies { implementation fileTree(dir: 'libs', include: ['*.jar','*.aar']) implementation fileTree(dir: 'aliyun-libs', include: ['*.jar','*.aar']) testImplementation 'junit:junit:4.13.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' api 'androidx.multidex:multidex:2.0.1' debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7' api "com.orhanobut:dialogplus:1.11@aar" api "com.readystatesoftware.systembartint:systembartint:1.0.4" api "com.rengwuxian.materialedittext:library:2.1.4" api "com.github.flavienlaurent.datetimepicker:library:0.0.2" api "com.darsh.multipleimageselect:multipleimageselect:1.0.4" api "me.shaohui.advancedluban:library:1.3.5" api "pl.droidsonroids.gif:android-gif-drawable:1.2.7" api "com.makeramen:roundedimageview:2.3.0" api "com.jzxiang.pickerview:TimePickerDialog:1.0.1" api "com.github.zyyoona7:EasyPopup:1.0.2" api "com.github.donkingliang:LabelsView:1.6.5" api "com.github.yyued:SVGAPlayer-Android:2.6.1" implementation "com.orhanobut:logger:2.2.0" api "com.ms-square:expandableTextView:0.1.4" api "com.jakewharton:butterknife:10.2.3" annotationProcessor "com.jakewharton:butterknife-compiler:10.2.3" implementation "com.llew.huawei:verifier:1.0.3" annotationProcessor 'androidx.annotation:annotation:1.1.0' implementation 'io.github.h07000223:flycoTabLayout:3.0.0' api project(':core') implementation 'com.github.qiujayen:sticky-layoutmanager:1.0.1' implementation 'com.github.chenBingX:SuperTextView:v3.0.0' //支付密码输入框 api 'com.jungly:gridPasswordView:0.3' api 'com.google.android.flexbox:flexbox:3.0.0' compileOnly "org.projectlombok:lombok:${Lombok}" annotationProcessor "org.projectlombok:lombok:${Lombok}" implementation 'nl.dionsegijn:konfetti:1.1.2' //数字滚动效果 implementation 'com.github.YvesCheung:RollingText:1.2.3' // 引入原有第三方裁图源码,方便修改 api project(':android_crop_lib') //rx权限请求框架 implementation('com.github.tbruyelle:rxpermissions:0.10.2') { exclude group: 'io.reactivex.rxjava2' } //验证码控件 https://github.com/JingYeoh/VercodeEditText implementation 'com.justkiddingbaby:vercodeedittext:1.1.0' implementation 'it.sephiroth.android.library.imagezoom:library:1.0.4' // 易盾一键登录 implementation 'io.github.yidun:quicklogin:3.1.5' implementation 'com.github.fodroid:XRadioGroup:v1.5' //华为推送 implementation 'com.huawei.hms:push:6.5.0.300' //魅族推送 implementation 'com.meizu.flyme.internet:push-internal:4.1.0' //oppo推送需要 implementation 'commons-codec:commons-codec:1.6' api 'com.tencent.vasdolly:helper:3.0.3' implementation "io.github.tencent:vap:2.0.24" implementation 'com.github.mmin18:realtimeblurview:1.2.1' } repositories { flatDir { dirs 'aliyun-libs','com.huawei.agconnect' } mavenCentral() } channel { //多渠道包的输出目录,默认为new File(project.buildDir,"channel") outputDir = new File(project.buildDir, "channelapk") //多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}-${buildTime} def only64 = onlyArm64 ? "-only64" : "" apkNameFormat = 'big_goose-${buildType}only64-${flavorName}-v${versionName}-${buildTime}'.replace("only64", only64) //快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false) fastMode = false //buildTime的时间格式,默认格式:yyyyMMdd-HHmmss buildTimeDateFormat = 'MMddHHmm' //低内存模式(仅针对V2签名,默认为false):只把签名块、中央目录和EOCD读取到内存,不把最大头的内容块读取到内存,在手机上合成APK时,可以使用该模式 lowMemory = false } android.applicationVariants.all { variant -> print("variant.name=" + variant.name) switch (variant.name) {//变体名称,如果没有设置productFlavors就是buildType名称,如果有设置productFlavors就是flavor+buildType,例如(freeRelease、proRelease) case "release": androidJunkCode.configMap.put(variant.name, { packageBase = "com.mango.plugin.ui" //生成java类根包名 packageCount = 30 //生成包数量 activityCountPerPackage = 30 //每个包下生成Activity类数量 excludeActivityJavaFile = false //是否排除生成Activity的Java文件,默认false(layout和写入AndroidManifest.xml还会执行),主要用于处理类似神策全埋点编译过慢问题 otherCountPerPackage = 50 //每个包下生成其它类的数量 methodCountPerClass = 20 //每个类下生成方法数量 resPrefix = "mango_" //生成的layout、drawable、string等资源名前缀 drawableCount = 300 //生成drawable资源数量 stringCount = 300 //生成string数量 }) break } }