forked from cashapp/redwood
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddAllTargets.gradle
60 lines (52 loc) · 1.32 KB
/
addAllTargets.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
60
plugins.withId('org.jetbrains.kotlin.multiplatform') {
kotlin {
if (plugins.hasPlugin('com.android.library')) {
android {
publishLibraryVariants('release')
}
}
iosArm64()
iosX64()
iosSimulatorArm64()
js {
browser()
}
jvm()
macosArm64()
macosX64()
sourceSets {
nativeMain {
dependsOn(commonMain)
}
nativeTest {
dependsOn(commonTest)
}
iosMain {
dependsOn(nativeMain)
}
iosTest {
dependsOn(nativeTest)
}
macosMain {
dependsOn(nativeMain)
}
macosTest {
dependsOn(nativeTest)
}
}
targets.all { target ->
// Some Kotlin targets do not have this property, but native ones always will.
if (target.hasProperty('platformType') && target.platformType.name == "native") {
if (target.name.startsWith('ios')) {
target.compilations.main.source(sourceSets.iosMain)
target.compilations.test.source(sourceSets.iosTest)
} else if (target.name.startsWith('macos')) {
target.compilations.main.source(sourceSets.macosMain)
target.compilations.test.source(sourceSets.macosTest)
} else {
throw new AssertionError("Unknown target ${target.name}")
}
}
}
}
}