forked from MobileTipsters/android-daily-tips
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MultiDimensionalFlavorConfigFields.gradle
45 lines (38 loc) · 1.13 KB
/
MultiDimensionalFlavorConfigFields.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
/*
* Providing build config fields on multi-dimensional flavor types
*/
android {
flavorDimensions Dimensions.default, Dimensions.type
productFlavors {
prod {
dimension Dimensions.default
}
beta {
dimension Dimensions.default
}
alpha {
dimension Dimensions.default
}
dev {
dimension Dimensions.default
}
free {
dimension Dimensions.type
}
paid {
dimension Dimensions.type
}
}
// Use combination of the flavor names
libraryVariants.all { variant ->
if (variant.getName().startsWith("prodPaid")) {
variant.buildConfigField 'String', "key", "value"
} else if (variant.getName().startsWith("betaPaid")) {
variant.buildConfigField 'String', "key", "value"
} else if (variant.getName().startsWith("alphaPaid")) {
variant.buildConfigField 'String', "key", "value"
} else if (variant.getName().startsWith("devPaid")) {
variant.buildConfigField 'String', "key", "value"
}
}
}