blob: ee5d821f01b00bc4c9b5905056c6d55836685d87 [file]
plugins {
id("common-configuration")
id("test-federation-convention")
id("com.autonomousapps.dependency-analysis")
kotlin("multiplatform")
id("binaryen-configuration")
}
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
kotlin {
jvm()
js {
binaries.executable()
}
wasmJs {
binaries.executable()
}
if (kotlinBuildProperties.isInIdeaSync.get()) {
// this magic is needed because of explicit dependency of common
// source set on the stdlib
val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
@Suppress("DEPRECATION")
when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
} else {
linuxX64()
macosArm64()
mingwX64()
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlinStdlib())
}
}
}
}
sourceSets {
"main" { projectDefault() }
"test" { none() }
}
tasks.register("distAnnotations") {
dependsOn("jvmJar", "jsJar", "wasmJsJar")
}