3d5003d476
- Switch to building stdlib with bootstrap compiler since IR is stable enough - Build stdlib with coreLibs by default - Include JS IR stdlib to kotlin distribution
37 lines
1.1 KiB
Kotlin
37 lines
1.1 KiB
Kotlin
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
|
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType.IR
|
|
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
|
|
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
|
|
|
|
plugins {
|
|
kotlin("multiplatform")
|
|
}
|
|
|
|
kotlin {
|
|
js(IR) {
|
|
nodejs()
|
|
}
|
|
sourceSets {
|
|
val jsMain by getting {
|
|
kotlin.srcDirs("builtins", "internal", "runtime")
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType<KotlinCompile<*>>().configureEach {
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
|
"-Xallow-kotlin-package",
|
|
"-Xallow-result-return-type",
|
|
"-Xuse-experimental=kotlin.Experimental",
|
|
"-Xuse-experimental=kotlin.ExperimentalMultiplatform",
|
|
"-Xuse-experimental=kotlin.contracts.ExperimentalContracts",
|
|
"-Xinline-classes",
|
|
"-Xopt-in=kotlin.RequiresOptIn",
|
|
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
|
|
"-Xopt-in=kotlin.ExperimentalStdlibApi"
|
|
)
|
|
}
|
|
|
|
tasks.named("compileKotlinJs") {
|
|
(this as KotlinCompile<*>).kotlinOptions.freeCompilerArgs += "-Xir-module-name=kotlin"
|
|
} |