• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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        wasmWasiTest {
52            dependencies {
53                implementation kotlin('test-wasm-wasi')
54            }
55        }
56        jvmTest {
57            dependencies {
58                implementation kotlin('test')
59                implementation kotlin('test-junit')
60            }
61        }
62    }
63    targets {
64        configure([]) {
65            tasks.getByName(compilations.main.compileKotlinTaskName).kotlinOptions {
66                jvmTarget = "1.8"
67            }
68        }
69    }
70}
71
72// Drop this configuration when the Node.JS version in KGP will support wasm gc milestone 4
73// check it here:
74// https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/js/nodejs/NodeJsRootExtension.kt
75rootProject.extensions.findByType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension.class).with {
76    // canary nodejs that supports recent Wasm GC changes
77    it.nodeVersion = "21.0.0-v8-canary202309167e82ab1fa2"
78    it.nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
79}
80