forked from siyuan-note/siyuan-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flavors.gradle
59 lines (49 loc) · 1.66 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
54
55
56
57
58
59
// 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 {
// 小米
xiaomi profileLqr() >> {
buildConfigField "String", "CHANNEL", '"xiaomi"'
resValue "string", "app_name", "思源笔记"
}
// Vivo/OPPO/荣耀
vo profileLqr() >> {
buildConfigField "String", "CHANNEL", '"voh"'
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", "SiYuan"
}
// 官方
official profileLqr() >> {
buildConfigField "String", "CHANNEL", '"official"'
resValue "string", "app_name", "SiYuan"
}
// 遍历 productFlavors 多渠道,设置渠道号
productFlavors.all {
flavor -> flavor.manifestPlaceholders.put("CHANNEL", name)
}
}
}