-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle.kts
55 lines (44 loc) · 1.31 KB
/
settings.gradle.kts
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
enableFeaturePreview("GRADLE_METADATA")
include(":todo-common")
include(":todo-common-internal")
include(":todo-reaktive")
include(":todo-coroutines")
//include(":todo-darwin-umbrella")
/*
doIfAndroidTargetAvailable {
include(":todo-app-android")
}
*/
includeBuild("../MVIKotlin")
doIfJsTargetAvailable {
include(":todo-app-js")
}
if (find("check_publication")?.toString()?.toBoolean() == true) {
include(":tools:check-publication")
}
enum class BuildType {
ALL, METADATA, NON_NATIVE, ANDROID, JVM, JS, LINUX, IOS, MAC_OS
}
val ExtensionAware.buildType: BuildType
get() =
find("build_type")
?.toString()
?.let(BuildType::valueOf)
?: BuildType.ALL
fun ExtensionAware.find(key: String) =
if (extra.has(key)) extra.get(key) else null
fun doIfJvmTargetAvailable(block: () -> Unit) {
if (buildType in setOf(BuildType.ALL, BuildType.METADATA, BuildType.NON_NATIVE, BuildType.JVM)) {
block()
}
}
fun doIfAndroidTargetAvailable(block: () -> Unit) {
if (buildType in setOf(BuildType.ALL, BuildType.METADATA, BuildType.NON_NATIVE, BuildType.ANDROID)) {
block()
}
}
fun doIfJsTargetAvailable(block: () -> Unit) {
if (buildType in setOf(BuildType.ALL, BuildType.METADATA, BuildType.NON_NATIVE, BuildType.JS)) {
block()
}
}