[6.4.0]
[模式拦截、车型名称修改、清扫车路由]
This commit is contained in:
@@ -8,6 +8,7 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'URLs', "\"${readFileToJson("mogo").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'mediaUrlConfig', "\"${readMediaUrlConfigFromJsonFile("mogo").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'musicUrlConfig', "\"${readMusicUrlConfigFromJsonFile("mogo").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'supportProduct', "\"${readProductWithVehicleConfigFromJsonFile("mogo").replace("\"", "\\\"")}\""
|
||||
}
|
||||
yantai {
|
||||
dimension "project"
|
||||
@@ -15,6 +16,7 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'URLs', "\"${readFileToJson("yantai").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'mediaUrlConfig', "\"${readMediaUrlConfigFromJsonFile("yantai").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'musicUrlConfig', "\"${readMusicUrlConfigFromJsonFile("yantai").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'supportBusiness', "\"${readProductWithVehicleConfigFromJsonFile("yantai").replace("\"", "\\\"")}\""
|
||||
}
|
||||
|
||||
dali {
|
||||
@@ -23,6 +25,7 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'URLs', "\"${readFileToJson("dali").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'mediaUrlConfig', "\"${readMediaUrlConfigFromJsonFile("dali").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'musicUrlConfig', "\"${readMusicUrlConfigFromJsonFile("dali").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'supportBusiness', "\"${readProductWithVehicleConfigFromJsonFile("dali").replace("\"", "\\\"")}\""
|
||||
}
|
||||
saas {
|
||||
dimension "project"
|
||||
@@ -30,6 +33,7 @@ project.android.productFlavors {
|
||||
buildConfigField 'String', 'URLs', "\"${readFileToJson("saas").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'mediaUrlConfig', "\"${readMediaUrlConfigFromJsonFile("saas").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'musicUrlConfig', "\"${readMusicUrlConfigFromJsonFile("saas").replace("\"", "\\\"")}\""
|
||||
buildConfigField 'String', 'supportBusiness', "\"${readProductWithVehicleConfigFromJsonFile("saas").replace("\"", "\\\"")}\""
|
||||
}
|
||||
|
||||
// 配置网络环境,QA、线上、演示
|
||||
|
||||
@@ -18,7 +18,6 @@ Object readMediaUrlConfigFromJsonFile(env){
|
||||
def getKey = flavorNames
|
||||
config.get(env).each {key, value ->
|
||||
// 匹配flavor对应的 json
|
||||
println "--------${flavorNames.toLowerCase()}---------${key}"
|
||||
if(flavorNames.toLowerCase().contains(key)){
|
||||
getKey = key
|
||||
return true
|
||||
@@ -31,6 +30,39 @@ Object readMediaUrlConfigFromJsonFile(env){
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取各车型宣传视频本地配置
|
||||
* @param env
|
||||
* @return
|
||||
*/
|
||||
Object readProductWithVehicleConfigFromJsonFile(env){
|
||||
try {
|
||||
// 加载config.json 文件
|
||||
File file = new File("${rootDir}/app/config/productWithVehicle.json")
|
||||
def jsonSlurper = new JsonSlurper()
|
||||
// 解析json
|
||||
def config = jsonSlurper.parse(file)
|
||||
def flavorNames = variantVehicleName()
|
||||
def jsonOutput = new JsonOutput()
|
||||
def getKey = flavorNames
|
||||
config.get(env).each {key, value ->
|
||||
// 匹配flavor对应的 json
|
||||
println "对比${flavorNames.toLowerCase()}---------${key}---${value}"
|
||||
if(flavorNames.toLowerCase().contains("${env}${key.toLowerCase()}")){
|
||||
getKey = key
|
||||
println "对比结果${flavorNames.toLowerCase()}---------${key}"
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return jsonOutput.toJson(config.get(env).get(getKey))
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 读取各车型宣传视频本地配置
|
||||
@@ -61,6 +93,17 @@ Object readMusicUrlConfigFromJsonFile(env){
|
||||
return null
|
||||
}
|
||||
|
||||
def variantVehicleName() {
|
||||
if(gradle.startParameter.taskNames.size()>0) {
|
||||
for (String taskName : gradle.startParameter.taskNames) {
|
||||
if (taskName.contains("Debug") | taskName.contains("Release")) {
|
||||
return taskName
|
||||
}
|
||||
}
|
||||
}
|
||||
return "buspassenger"
|
||||
}
|
||||
|
||||
|
||||
boolean isCurrentDriver(String flavors) {
|
||||
if(isDriver() && isCurrentFlavors(flavors)){
|
||||
@@ -114,4 +157,5 @@ ext {
|
||||
isCurrentPassenger = this.&isCurrentPassenger
|
||||
readMediaUrlConfigFromJsonFile = this.&readMediaUrlConfigFromJsonFile
|
||||
readMusicUrlConfigFromJsonFile = this.&readMusicUrlConfigFromJsonFile
|
||||
readProductWithVehicleConfigFromJsonFile = this.&readProductWithVehicleConfigFromJsonFile
|
||||
}
|
||||
@@ -7,11 +7,11 @@ project.android.productFlavors {
|
||||
|
||||
// 配置AndroidManifest.xml中用到的参数
|
||||
manifestPlaceholders = [
|
||||
CHANNEL_VALUE_TAIL : "JL",
|
||||
CHANNEL_VALUE_TAIL : "B1",
|
||||
]
|
||||
|
||||
// ①标识构建的应用身份类型,具体查看 README.md APP_IDENTITY_MODE规则
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE_TAIL', "\"JL\""
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE_TAIL', "\"B1\""
|
||||
|
||||
// ②构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
|
||||
|
||||
@@ -14,11 +14,11 @@ project.android.productFlavors {
|
||||
}
|
||||
//高德地图鉴权信息
|
||||
manifestPlaceholders = [
|
||||
CHANNEL_VALUE_TAIL: "M2",
|
||||
CHANNEL_VALUE_TAIL: "B2",
|
||||
]
|
||||
|
||||
// ①标识构建的应用身份类型,具体查看 README.md APP_IDENTITY_MODE规则
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE_TAIL', "\"M2\""
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE_TAIL', "\"B2\""
|
||||
|
||||
// ②构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'false'
|
||||
|
||||
@@ -7,16 +7,22 @@ project.android.productFlavors {
|
||||
|
||||
// 配置AndroidManifest.xml中用到的参数
|
||||
manifestPlaceholders = [
|
||||
CHANNEL_VALUE_TAIL: "FT",
|
||||
CHANNEL_VALUE_TAIL: "C1",
|
||||
]
|
||||
|
||||
// ①标识构建的应用身份类型,具体查看 README.md APP_IDENTITY_MODE规则
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE_TAIL', "\"FT\""
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE_TAIL', "\"C1\""
|
||||
|
||||
// ②构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
|
||||
|
||||
// ③不能启动自驾的档位
|
||||
buildConfigField 'java.util.Set<chassis.Chassis.GearPosition>', 'UNABLE_LAUNCH_AUTOPILOT_GEAR', 'null'
|
||||
|
||||
// ⑤清扫车 默认模式(运营/云控)
|
||||
buildConfigField 'String', 'SWEEPER_DEFAULT_MODE', '\"Cloud\"'
|
||||
|
||||
// ⑥清扫车 是否能切换模式
|
||||
buildConfigField 'boolean', 'SWEEPER_CAN_SWITCH_MODE', 'true'
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,12 @@ project.android.productFlavors {
|
||||
|
||||
// 配置AndroidManifest.xml中用到的参数
|
||||
manifestPlaceholders = [
|
||||
CHANNEL_VALUE_TAIL: "DFHQ",
|
||||
CHANNEL_VALUE_TAIL: "T1T2",
|
||||
]
|
||||
|
||||
|
||||
// ①标识构建的应用身份类型,具体查看 README.md APP_IDENTITY_MODE规则
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE_TAIL', "\"DFHQ\""
|
||||
buildConfigField 'String', 'APP_IDENTITY_MODE_TAIL', "\"T1T2\""
|
||||
|
||||
// ②构建的是否要动态更换模型
|
||||
buildConfigField 'boolean', 'IS_CAR_MODEL_CHANGE', 'true'
|
||||
|
||||
Reference in New Issue
Block a user