[6.10.0]
[fea] [音乐、媒体信息分离车型]
This commit is contained in:
@@ -13,17 +13,9 @@ Object readMediaUrlConfigFromJsonFile(env){
|
||||
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
|
||||
if(flavorNames.toLowerCase().contains(key)){
|
||||
getKey = key
|
||||
return true
|
||||
}
|
||||
}
|
||||
return jsonOutput.toJson(config.get(env).get(getKey))
|
||||
printf("----------------"+config.get(env))
|
||||
return jsonOutput.toJson(config.get(env))
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
@@ -32,35 +24,6 @@ Object readMediaUrlConfigFromJsonFile(env){
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 读取各车型宣传视频本地配置
|
||||
* @param env
|
||||
* @return
|
||||
*/
|
||||
Object readMusicUrlConfigFromJsonFile(env){
|
||||
try {
|
||||
// 加载config.json 文件
|
||||
File file = new File("${rootDir}/app/config/MusicUrlConfig.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
|
||||
if(flavorNames.toLowerCase().contains(key)){
|
||||
getKey = key
|
||||
return true
|
||||
}
|
||||
}
|
||||
return jsonOutput.toJson(config.get(env).get(getKey))
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
def variantVehicleName() {
|
||||
if(gradle.startParameter.taskNames.size()>0) {
|
||||
for (String taskName : gradle.startParameter.taskNames) {
|
||||
@@ -106,5 +69,4 @@ ext {
|
||||
isDriver = this.&isDriver
|
||||
isBaiLing = this.&isBaiLing
|
||||
readMediaUrlConfigFromJsonFile = this.&readMediaUrlConfigFromJsonFile
|
||||
readMusicUrlConfigFromJsonFile = this.&readMusicUrlConfigFromJsonFile
|
||||
}
|
||||
Reference in New Issue
Block a user