1plugins { 2 id 'org.jetbrains.kotlin.multiplatform' 3} 4 5repositories { 6 mavenCentral() 7 maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" } 8 // Coroutines from the outer project are published by previous CI buils step 9 mavenLocal() 10} 11 12kotlin { 13 jvm() 14 js(IR) { 15 nodejs() 16 } 17 wasmJs() { 18 nodejs() 19 } 20 21 macosArm64() 22 macosX64() 23 linuxArm64() 24 linuxX64() 25 mingwX64() 26 27 sourceSets { 28 commonMain { 29 dependencies { 30 implementation kotlin('stdlib-common') 31 implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" 32 } 33 } 34 commonTest { 35 dependencies { 36 implementation kotlin('test-common') 37 implementation kotlin('test-annotations-common') 38 implementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version" 39 } 40 } 41 jsTest { 42 dependencies { 43 implementation kotlin('test-js') 44 } 45 } 46 wasmJsTest { 47 dependencies { 48 implementation kotlin('test-wasm-js') 49 } 50 } 51 jvmTest { 52 dependencies { 53 implementation kotlin('test') 54 implementation kotlin('test-junit') 55 } 56 } 57 } 58 targets { 59 configure([]) { 60 tasks.getByName(compilations.main.compileKotlinTaskName).kotlinOptions { 61 jvmTarget = "1.8" 62 } 63 } 64 } 65} 66 67// Drop this configuration when the Node.JS version in KGP will support wasm gc milestone 4 68// check it here: 69// https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/js/nodejs/NodeJsRootExtension.kt 70rootProject.extensions.findByType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension.class).with { 71 // canary nodejs that supports recent Wasm GC changes 72 it.nodeVersion = "21.0.0-v8-canary202309167e82ab1fa2" 73 it.nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary" 74}