Skip to content

Commit 2f85687

Browse files
committed
增加sdk demo config文件并调整解析配置文件的脚本
Change-Id: Ibbd04818e8ca4bf6102733cd3784df166a558f47
1 parent 955a3c4 commit 2f85687

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

app-config.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
"XgUSAAccessId": "1530001537",
88
"XgUSAAccessKey": "A1S4XT4V7XSM",
99
"TencentMapSDKValue": "ZV6BZ-3ATCP-5BZDE-VFIJI-I7NO6-TIBAG",
10-
"TencentIotLinkSDKDemoAppkey": " ",
11-
"TencentIotLinkSDKDemoAppSecret": " "
10+
"HEweatherKey": ""
1211
}

app/build.gradle

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ apply plugin: 'com.google.firebase.crashlytics'
1010

1111
apply plugin: 'com.google.firebase.firebase-perf'
1212

13+
rootProject.ext.configPath = "../app-config.json"
14+
1315
apply from: "../parse_json.gradle"
1416

1517
android {
@@ -48,7 +50,7 @@ android {
4850
buildConfigField 'String', 'XgAccessKey', "\"${getValueById('XgAccessKey')}\""
4951
buildConfigField 'String', 'XgUSAAccessId', "\"${getValueById('XgUSAAccessId')}\""
5052
buildConfigField 'String', 'XgUSAAccessKey', "\"${getValueById('XgUSAAccessKey')}\""
51-
buildConfigField 'String', 'WeatherKey', "\"${getValueById('WeatherKey')}\""
53+
buildConfigField 'String', 'WeatherKey', "\"${getValueById('HEweatherKey')}\""
5254
multiDexEnabled true
5355
}
5456

config.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ ext {
88
versionName: versionAppName,
99
versionCode: 2
1010
]
11+
12+
configPath = ""
1113
}

parse_json.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import groovy.json.JsonSlurper
22

3-
def jsonFile = file('../app-config.json')
3+
def jsonFile = file(rootProject.ext.configPath)
44
def parsedJson = new JsonSlurper().parseText(jsonFile.text)
55
ext.getValueById = { key ->
66
return parsedJson[key]
7-
}
7+
}

sdkdemo-config.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"TencentIotLinkSDKDemoAppkey": " ",
3+
"TencentIotLinkSDKDemoAppSecret": " "
4+
}

sdkdemo/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ apply plugin: 'com.google.gms.google-services'
88

99
apply plugin: 'com.google.firebase.crashlytics'
1010

11+
rootProject.ext.configPath = "../sdkdemo-config.json"
12+
1113
apply from: "../parse_json.gradle"
1214

1315
android {

0 commit comments

Comments
 (0)