-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigs.gradle
56 lines (48 loc) · 1.77 KB
/
configs.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
ext {
cfgs = [
compileSdkVersion : 31,
buildToolsVersion : "29.0.2",
minSdkVersion : 26,
targetSdkVersion : 31,
versionCode : 1, //国内版要比国外版本高一个
versionName : "1.0.0523",
lifecycleVersion : "2.4.0",
]
// 测试服
def SERVER_TYPE_TEST = "test"
// 正式服
def SERVER_TYPE_PRODUCT = "product"
def taskName = project.gradle.startParameter.taskNames[0]
if (taskName == null) {
taskName = ""
}
// 打印当前执行的任务名称
println "GradleLog TaskNameOutput " + taskName
def serverType = SERVER_TYPE_PRODUCT
if (taskName.endsWith("Debug")) {
serverType = SERVER_TYPE_TEST
}
// 从 Gradle 命令中读取参数配置,例如:./gradlew assembleRelease -P ServerType="test"
if (project.hasProperty("ServerType")) {
serverType = project.properties["ServerType"]
}
// 打印当前服务器配置
println "GradleLog ServerTypeOutput " + serverType
// 微信 AppId
WX_APP_ID = "wx1cf3bf2a1deac41f"
// 微信 Secret
WX_APP_SECRET = "8b5f1400b7d0f181c87c75588a75d3fb"
switch(serverType) {
case SERVER_TYPE_TEST:
LOG_ENABLE = true
BUGLY_ID = "386dc8af41"
HOST_URL = "http://test.blackview4g.com:8123/arpha-kids-service/api/"
//HOST_URL = " http://kids-app.arpha.com:8123/arpha-kids-service/api/"
break
case SERVER_TYPE_PRODUCT:
LOG_ENABLE = false
BUGLY_ID = "386dc8af41"
HOST_URL = " http://kids-app.arpha.com:8123/arpha-kids-service/api/"
break
}
}