123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- plugins {
- id 'com.android.application'
- }
- def releaseTime() {
- return new Date().format("yyyyMMddHHmmss", TimeZone.getTimeZone("CTT"))
- }
- android {
- compileSdk 30
- defaultConfig {
- applicationId "com.efunbox.reader"
- minSdk 21
- //noinspection ExpiredTargetSdkVersion
- targetSdk 28
- versionCode 40
- versionName "4.0"
- testInstrumentationRunner
- flavorDimensions "versionCode"
- manifestPlaceholders = [UMENG_CHANNEL_VALUE: "2006"]//添加一个默认渠道号
- multiDexEnabled true
- ndk {
- abiFilters "arm64-v8a"
- abiFilters "armeabi-v7a"
- abiFilters "armeabi"
- abiFilters "x86"
- // 添加x86必须添加x86_64
- abiFilters "x86_64"
- }
- }
- signingConfigs {
- efunboxKey {
- keyAlias "edufound_key"
- keyPassword "edufound321"
- storeFile file("C:/Users/candy/Desktop/efunbox/edufound.keystore")
- storePassword "edufound123"
- v1SigningEnabled true
- v2SigningEnabled true
- }
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- signingConfig signingConfigs.efunboxKey
- applicationVariants.all { variant ->
- variant.outputs.each { output ->
- def outputFile = output.outputFileName
- if (outputFile != null && output.outputFileName.endsWith('.apk')) {
- def fileName = "efunbox_reader_v${defaultConfig.versionCode}_${releaseTime()}_${variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE}_r.apk"
- def channel = variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE;
- def newoutputFile = "";
- if (channel == ("3006")) {
- newoutputFile = "\\义方\\"
- } else if (channel == ("3002")) {
- newoutputFile = "\\天猫精灵\\"
- } else if (channel == ("3003")) {
- newoutputFile = "\\小度音响\\"
- } else if (channel == ("2016")) {
- newoutputFile = "\\小爱音响\\"
- } else if (channel == ("3004")) {
- newoutputFile = "\\联想pad\\"
- } else if (channel == ("3007")) {
- newoutputFile = "\\京东方\\"
- } else if (channel == ("3008")) {
- newoutputFile = "\\华为pad联运\\"
- } else if (channel == ("3009")) {
- newoutputFile = "\\步步高\\"
- } else if (channel == ("3010")) {
- newoutputFile = "\\讯飞pad\\"
- }
- output.outputFileName = new File(newoutputFile, fileName)
- }
- }
- }
- }
- debug {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- signingConfig signingConfigs.efunboxKey
- zipAlignEnabled true
- }
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- buildFeatures {
- viewBinding true
- }
- sourceSets {
- main {
- jniLibs.srcDirs = ['libs']
- res.srcDirs = [
- 'src/main/res', //默认只有这一个路径
- ]
- }
- }
- productFlavors {
- //义方
- channel_efunbox {
- signingConfig signingConfigs.efunboxKey
- manifestPlaceholders = [
- appCode: "3006",
- appIcon: "@drawable/icon",
- ]
- }
- //百度(小度音响)
- channel_baidu {
- signingConfig signingConfigs.efunboxKey
- manifestPlaceholders = [
- appCode: "3003",
- appIcon: "@drawable/icon",
- ]
- }
- //天猫精灵
- channel_tmail {
- signingConfig signingConfigs.efunboxKey
- manifestPlaceholders = [
- appCode: "3002",
- appIcon: "@drawable/icon",
- ]
- }
- //小爱音响
- channel_xayx {
- applicationIdSuffix ".xiaoai"
- signingConfig signingConfigs.efunboxKey
- manifestPlaceholders = [
- appCode: "2016",
- appIcon: "@drawable/icon",
- ]
- }
- //联想渠道
- channel_lenovo {
- signingConfig signingConfigs.efunboxKey
- manifestPlaceholders = [
- appCode: "3004",
- appIcon: "@drawable/icon",
- ]
- }
- //京东方
- channel_jingdongfang {
- signingConfig signingConfigs.efunboxKey
- manifestPlaceholders = [
- appCode: "3007",
- appIcon: "@drawable/icon",
- ]
- }
- //华为Pad联运
- channel_huawei_lianyun {
- // apply plugin: "com.huawei.agconnect"
- // applicationIdSuffix ".huawei"
- // signingConfig signingConfigs.efunboxKey
- manifestPlaceholders = [
- appCode: "3008",
- appIcon: "@drawable/icon",
- ]
- }
- //步步高pad
- channel_bubugao {
- signingConfig signingConfigs.efunboxKey
- manifestPlaceholders = [
- appCode: "3009",
- appIcon: "@drawable/icon",
- ]
- }
- //讯飞pad
- channel_xunfei {
- signingConfig signingConfigs.efunboxKey
- manifestPlaceholders = [
- appCode: "3010",
- appIcon: "@drawable/icon",
- ]
- }
- }
- productFlavors.all {
- flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: manifestPlaceholders.appCode, icon: manifestPlaceholders.appIcon]
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- }
- dependencies {
- api userLibs.get('appcompat')
- api userLibs.get('material')
- api userLibs.get('constraintlayout')
- api userLibs.get('gson')
- api userLibs.get('recyclerview')
- testImplementation testLibs.get('junit')
- androidTestImplementation testLibs.get('junitAndroid')
- androidTestImplementation testLibs.get('espresso')
- if (isRelease) {
- api project(':app-pay')
- api project(':app-video')
- }
- api project(':app-base')
- }
|