2024-03-03 15:18:43 +00:00
|
|
|
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
|
2024-03-03 13:57:22 +00:00
|
|
|
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
|
|
|
|
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
|
|
|
|
|
2024-03-02 23:29:17 +00:00
|
|
|
plugins {
|
|
|
|
kotlin("multiplatform")
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlin {
|
|
|
|
jvmToolchain(8)
|
|
|
|
|
|
|
|
jvm()
|
|
|
|
|
|
|
|
js(IR) {
|
|
|
|
browser()
|
|
|
|
nodejs()
|
|
|
|
}
|
|
|
|
|
2024-03-03 15:18:43 +00:00
|
|
|
@OptIn(ExperimentalWasmDsl::class)
|
|
|
|
wasmJs {
|
|
|
|
binaries.executable()
|
|
|
|
nodejs()
|
|
|
|
}
|
2024-03-02 23:29:17 +00:00
|
|
|
|
2024-03-03 15:18:43 +00:00
|
|
|
/* https://kotlinlang.org/docs/native-target-support.html#tier-1 */
|
2024-03-02 23:29:17 +00:00
|
|
|
|
|
|
|
macosX64()
|
2024-03-03 15:18:43 +00:00
|
|
|
macosArm64()
|
2024-03-02 23:29:17 +00:00
|
|
|
iosSimulatorArm64()
|
|
|
|
iosX64()
|
|
|
|
|
2024-03-03 15:18:43 +00:00
|
|
|
/* https://kotlinlang.org/docs/native-target-support.html#tier-2 */
|
|
|
|
|
|
|
|
linuxX64()
|
|
|
|
linuxArm64()
|
2024-03-02 23:29:17 +00:00
|
|
|
|
|
|
|
watchosSimulatorArm64()
|
|
|
|
watchosX64()
|
2024-03-03 15:18:43 +00:00
|
|
|
watchosArm32()
|
|
|
|
watchosArm64()
|
|
|
|
|
|
|
|
tvosSimulatorArm64()
|
|
|
|
tvosX64()
|
|
|
|
tvosArm64()
|
|
|
|
|
|
|
|
iosArm64()
|
|
|
|
|
|
|
|
/* https://kotlinlang.org/docs/native-target-support.html#tier-3 */
|
|
|
|
|
|
|
|
androidNativeArm32()
|
|
|
|
androidNativeArm64()
|
|
|
|
androidNativeX86()
|
|
|
|
androidNativeX64()
|
|
|
|
|
|
|
|
mingwX64()
|
|
|
|
|
|
|
|
watchosDeviceArm64()
|
2024-03-02 23:29:17 +00:00
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
all {
|
|
|
|
languageSettings.apply {
|
|
|
|
optIn("kotlin.contracts.ExperimentalContracts")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
commonTest {
|
|
|
|
dependencies {
|
|
|
|
implementation(kotlin("test"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
jvmTest {
|
|
|
|
dependencies {
|
|
|
|
implementation(kotlin("test-junit"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
jsTest {
|
|
|
|
dependencies {
|
|
|
|
implementation(kotlin("test-js"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<Jar> {
|
|
|
|
from(rootDir.resolve("LICENSE")) {
|
|
|
|
into("META-INF")
|
|
|
|
}
|
|
|
|
}
|
2024-03-03 13:57:22 +00:00
|
|
|
|
|
|
|
/* https://youtrack.jetbrains.com/issue/KT-63014/Running-tests-with-wasmJs-in-1.9.20-requires-Chrome-Canary#focus=Comments-27-8321383.0-0 */
|
|
|
|
rootProject.the<NodeJsRootExtension>().apply {
|
|
|
|
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
|
|
|
|
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
|
|
|
|
}
|
|
|
|
|
|
|
|
rootProject.tasks.withType<KotlinNpmInstallTask> {
|
|
|
|
args.add("--ignore-engines")
|
|
|
|
}
|