-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
89 lines (82 loc) · 2 KB
/
build.gradle.kts
File metadata and controls
89 lines (82 loc) · 2 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.JsModuleKind.MODULE_UMD
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.dokka)
alias(libs.plugins.mavenPublish)
}
/*
* Here's the main hierarchy of variants. Any `expect` functions in one level of the tree are
* `actual` functions in a (potentially indirect) child node.
*
* ```
* common
* |-- jvm
* |-- js
* '-- native
* |- unix
* | |-- apple
* | | |-- iosArm64
* | | |-- iosX64
* | | |-- macosX64
* | | |-- tvosArm64
* | | |-- tvosX64
* | | |-- watchosArm32
* | | |-- watchosArm64
* | | '-- watchosX86
* | '-- linux
* | '-- linuxX64
* '-- mingw
* '-- mingwX64
* ```
*
* Every child of `unix` also includes a source set that depends on the pointer size:
*
* * `sizet32` for watchOS, including watchOS 64-bit architectures
* * `sizet64` for everything else
*/
kotlin {
jvm()
js(IR) {
compilations.configureEach {
compileTaskProvider.configure {
compilerOptions {
moduleKind.set(MODULE_UMD)
sourceMap.set(true)
}
}
}
nodejs { testTask { useMocha { timeout = "30s" } } }
browser()
binaries.executable()
}
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
binaries.executable()
browser {}
}
configureOrCreateNativePlatforms()
}
// Sourced from https://kotlinlang.org/docs/native-target-support.html
fun KotlinMultiplatformExtension.configureOrCreateNativePlatforms() {
// Tier 1
linuxX64()
macosArm64()
iosSimulatorArm64()
// Tier 2
linuxArm64()
watchosSimulatorArm64()
watchosArm32()
watchosArm64()
tvosSimulatorArm64()
tvosArm64()
iosArm64()
// Tier 3
androidNativeArm32()
androidNativeArm64()
androidNativeX86()
androidNativeX64()
mingwX64()
watchosDeviceArm64()
}