-
Notifications
You must be signed in to change notification settings - Fork 92
/
flavors.gradle
53 lines (44 loc) · 1.52 KB
/
flavors.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
// It accepts an optional parameter `abiList`, which is a list containing ABI (Application Binary Interface) types.
// If the `abiList` parameter is not provided, it defaults to using `arm64-v8a`.
def profileLqr(abiList = null) {
return {
ndk {
//noinspection ChromeOsAbiSupport
abiFilters = abiList == null ? ['arm64-v8a'] : abiList
}
}
}
android {
// Specifies the flavor dimensions you want to use. The order in which you
// list the dimensions determines their priority, from highest to lowest,
// when Gradle merges variant sources and configurations. You must assign
// each product flavor you configure to one of the flavor dimensions.
flavorDimensions "version"
// 多渠道打包配置
productFlavors {
// 小米/Vivo/OPPO/荣耀
cn profileLqr() >> {
buildConfigField "String", "CHANNEL", '"cn"'
resValue "string", "app_name", "思源笔记"
}
// Google Play
googleplay profileLqr() >> {
buildConfigField "String", "CHANNEL", '"googleplay"'
resValue "string", "app_name", "SiYuan"
}
// 华为
huawei profileLqr() >> {
buildConfigField "String", "CHANNEL", '"huawei"'
resValue "string", "app_name", "思源笔记"
}
// 官方
official profileLqr() >> {
buildConfigField "String", "CHANNEL", '"official"'
resValue "string", "app_name", "SiYuan"
}
// 遍历 productFlavors 多渠道,设置渠道号
productFlavors.all {
flavor -> flavor.manifestPlaceholders.put("CHANNEL", name)
}
}
}