263 lines
9.8 KiB
Groovy
263 lines
9.8 KiB
Groovy
apply plugin: 'com.android.application'
|
||
apply plugin: 'com.alibaba.arouter'
|
||
apply plugin: 'kotlin-android'
|
||
apply plugin: 'kotlin-android-extensions'
|
||
apply plugin: 'android-aspectjx'
|
||
|
||
Properties properties = new Properties();
|
||
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())
|
||
|
||
android {
|
||
compileSdkVersion rootProject.ext.android.compileSdkVersion
|
||
defaultConfig {
|
||
minSdkVersion rootProject.ext.android.minSdkVersion
|
||
targetSdkVersion rootProject.ext.android.targetSdkVersion
|
||
versionCode rootProject.versionCode as int
|
||
versionName rootProject.versionName
|
||
applicationId rootProject.ext.android.applicationId
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||
|
||
javaCompileOptions {
|
||
annotationProcessorOptions {
|
||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||
}
|
||
}
|
||
|
||
multiDexEnabled true
|
||
}
|
||
|
||
packagingOptions {
|
||
exclude 'META-INF/proguard/coroutines.pro'
|
||
exclude 'META-INF/*'
|
||
}
|
||
|
||
signingConfigs {
|
||
release {
|
||
keyAlias = 'CarLauncher'
|
||
storeFile file('../keystore/car_launcher.jks')
|
||
storePassword 'ZDauto123456'
|
||
keyPassword 'ZDauto123456'
|
||
}
|
||
}
|
||
buildTypes {
|
||
debug {
|
||
debuggable true
|
||
minifyEnabled false
|
||
zipAlignEnabled false
|
||
shrinkResources false
|
||
signingConfig signingConfigs.release
|
||
manifestPlaceholders = [
|
||
MAP_SDK_VERSION: properties.getProperty("MAP_SDK_VERSION")
|
||
]
|
||
}
|
||
release {
|
||
minifyEnabled false
|
||
zipAlignEnabled false
|
||
shrinkResources false
|
||
signingConfig signingConfigs.release
|
||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||
manifestPlaceholders = [
|
||
MAP_SDK_VERSION: properties.getProperty("MAP_SDK_VERSION")
|
||
]
|
||
}
|
||
}
|
||
compileOptions {
|
||
sourceCompatibility 1.8
|
||
targetCompatibility 1.8
|
||
}
|
||
|
||
sourceSets {
|
||
main {
|
||
manifest.srcFile 'src/main/AndroidManifest.xml'
|
||
}
|
||
launcher {
|
||
manifest.srcFile 'src/launcher/AndroidManifest.xml'
|
||
}
|
||
independent {
|
||
manifest.srcFile 'src/independent/AndroidManifest.xml'
|
||
}
|
||
f8xxLauncherOnlineRelease {
|
||
manifest.srcFile 'src/f8xxLauncherOnlineRelease/AndroidManifest.xml'
|
||
}
|
||
fPadLenovoLauncherOnlineRelease {
|
||
manifest.srcFile 'src/launcher/AndroidManifest.xml'
|
||
}
|
||
}
|
||
|
||
flavorDimensions "product", "basic", "env"
|
||
|
||
productFlavors {
|
||
//独立app
|
||
independent {
|
||
dimension "basic"
|
||
// 是否启动位置服务
|
||
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'false'
|
||
// 是否作为 launcher 运行
|
||
buildConfigField 'boolean', 'IS_LAUNCHER', 'false'
|
||
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
||
// 是否支持目的地导航策略
|
||
buildConfigField 'boolean', 'IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH', 'true'
|
||
}
|
||
// launcher app
|
||
launcher {
|
||
dimension "basic"
|
||
// 是否启动位置服务
|
||
buildConfigField 'boolean', 'LAUNCH_LOCATION_SERVICE', 'true'
|
||
// 是否作为 launcher 运行
|
||
buildConfigField 'boolean', 'IS_LAUNCHER', 'true'
|
||
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
|
||
// 是否支持目的地导航策略
|
||
buildConfigField 'boolean', 'IS_SUPPORT_SCHEDULE_CALCULATE_NOT_HOME_COMPANY_DISTANCE_FOR_PUSH', 'false'
|
||
}
|
||
// 配置网络环境,QA、线上、演示
|
||
qa {
|
||
dimension "env"
|
||
buildConfigField 'int', 'NET_ENV', '2'
|
||
}
|
||
online {
|
||
dimension "env"
|
||
buildConfigField 'int', 'NET_ENV', '3'
|
||
}
|
||
demo {
|
||
dimension "env"
|
||
buildConfigField 'int', 'NET_ENV', '4'
|
||
}
|
||
}
|
||
|
||
// 配置.so支持的CPU架构
|
||
apply from: "./functions/abiFilters.gradle"
|
||
// 配置不同渠道参数,直接影响功能完整度
|
||
apply from: "./productFlavors/bydauto.gradle"
|
||
apply from: "./productFlavors/f8Amap.gradle"
|
||
apply from: "./productFlavors/f8xx.gradle"
|
||
apply from: "./productFlavors/f80x.gradle"
|
||
apply from: "./productFlavors/fochbus.gradle"
|
||
apply from: "./productFlavors/fochtaxi.gradle"
|
||
apply from: "./productFlavors/fPadLenovo.gradle"
|
||
apply from: "./productFlavors/fPadLenovoOchBus.gradle"
|
||
apply from: "./productFlavors/fPadLenovoOchTaxi.gradle"
|
||
apply from: "./productFlavors/phone.gradle"
|
||
|
||
packagingOptions {
|
||
exclude 'META-INF/io.netty.versions.properties'
|
||
}
|
||
|
||
sourceSets {
|
||
main {
|
||
res.srcDirs = ['src/main/res', 'src/main/res-night']
|
||
}
|
||
}
|
||
}
|
||
|
||
repositories {
|
||
flatDir {
|
||
dirs 'libs'
|
||
}
|
||
}
|
||
|
||
aspectjx {
|
||
include "com.mogo.chat"
|
||
}
|
||
|
||
dependencies {
|
||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||
|
||
//Crash日志收集
|
||
implementation rootProject.ext.dependencies.crashSdk
|
||
implementation rootProject.ext.dependencies.androidxappcompat
|
||
implementation rootProject.ext.dependencies.arouter
|
||
implementation rootProject.ext.dependencies.boostmultidex
|
||
debugImplementation rootProject.ext.dependencies.debugleakcanary
|
||
releaseImplementation rootProject.ext.dependencies.releaseleakcanary
|
||
|
||
implementation rootProject.ext.dependencies.callchatprovider
|
||
implementation rootProject.ext.dependencies.callchat
|
||
|
||
implementation rootProject.ext.dependencies.mogologlib
|
||
compileOnly rootProject.ext.dependencies.adasapi
|
||
compileOnly rootProject.ext.dependencies.adasconfigapi
|
||
|
||
if (Boolean.valueOf(RELEASE)) {
|
||
implementation rootProject.ext.dependencies.mogocommons
|
||
implementation rootProject.ext.dependencies.modulecommon
|
||
implementation rootProject.ext.dependencies.modulesearch
|
||
implementation rootProject.ext.dependencies.mogomoduleauth
|
||
implementation rootProject.ext.dependencies.modulesplash
|
||
implementation rootProject.ext.dependencies.mogoservice
|
||
implementation rootProject.ext.dependencies.moduleV2x
|
||
implementation rootProject.ext.dependencies.moduleshare
|
||
implementation rootProject.ext.dependencies.tanluupload
|
||
implementation rootProject.ext.dependencies.mogomonitor
|
||
implementation rootProject.ext.dependencies.guideshow
|
||
implementation rootProject.ext.dependencies.moduleextensions
|
||
implementation rootProject.ext.dependencies.modulemap
|
||
implementation rootProject.ext.dependencies.moduleSmallMap
|
||
implementation rootProject.ext.dependencies.httpdnsmogo
|
||
} else {
|
||
implementation project(':foudations:mogo-commons')
|
||
implementation project(':modules:mogo-module-common')
|
||
implementation project(':modules:mogo-module-search')
|
||
implementation project(':modules:mogo-module-authorize')
|
||
implementation project(':modules:mogo-module-service')
|
||
implementation project(':modules:mogo-module-splash')
|
||
implementation project(':modules:mogo-module-service')
|
||
implementation project(':modules:mogo-module-v2x')
|
||
implementation project(':modules:mogo-module-share')
|
||
implementation project(':libraries:tanlulib')
|
||
implementation project(':modules:mogo-module-monitor')
|
||
implementation project(':modules:mogo-module-extensions')
|
||
implementation project(':modules:mogo-module-map')
|
||
implementation project(':modules:mogo-module-smp')
|
||
implementation project(':modules:mogo-module-obu-mogo')
|
||
implementation project(':modules:mogo-module-hmi')
|
||
implementation project(':modules:mogo-module-adas')
|
||
implementation project(':foudations:httpdns-mogo')
|
||
}
|
||
|
||
apply from: "./functions/aicloudservices.gradle"
|
||
apply from: "./functions/basedmap.gradle"
|
||
apply from: "./functions/perform.gradle"
|
||
apply from: "./functions/socketpush.gradle"
|
||
apply from: "./functions/leftpanel.gradle"
|
||
apply from: "./functions/skin.gradle"
|
||
apply from: "./functions/crashreport.gradle"
|
||
apply from: "./functions/widgets.gradle"
|
||
apply from: "./functions/tts.gradle"
|
||
apply from: "./functions/backwidget.gradle"
|
||
apply from: "./functions/mediaui.gradle"
|
||
apply from: "./functions/bizguide.gradle"
|
||
apply from: "./functions/och.gradle"
|
||
|
||
// implementation group: "com.tencent.matrix", name: "matrix-android-lib", version: '0.6.6', changing: true
|
||
// implementation group: "com.tencent.matrix", name: "matrix-android-commons", version: '0.6.6', changing: true
|
||
// implementation group: "com.tencent.matrix", name: "matrix-trace-canary", version:'0.6.6', changing: true
|
||
// implementation group: "com.tencent.matrix", name: "matrix-io-canary", version: '0.6.6', changing: true
|
||
|
||
}
|
||
|
||
//apply plugin: 'com.tencent.matrix-plugin'
|
||
//matrix {
|
||
// trace {
|
||
// enable = true //if you don't want to use trace canary, set false
|
||
// baseMethodMapFile = "${project.projectDir}/matrixOutput/Debug.methodmap"
|
||
// blackListFile = "${project.projectDir}/matrixTrace/blackMethodList.txt"
|
||
// }
|
||
//}
|
||
|
||
android.applicationVariants.all { variant ->
|
||
def buildTime = new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT+08:00"))
|
||
def flavor = variant.productFlavors.collect { it.name }.join('-')
|
||
|
||
variant.outputs.all { output ->
|
||
outputFileName = [
|
||
rootProject.applicationName,
|
||
"v${variant.versionName}",
|
||
buildTime,
|
||
flavor.length() > 0 ? "[${flavor}]" : "",
|
||
variant.buildType.name
|
||
].findAll { it.length() > 0 }.join('_') << ".apk"
|
||
}
|
||
}
|
||
|
||
apply from: "./regroup.gradle"
|