Merge pull request #566 from 000Sanya/master

implement support of wasm/js for browser
This commit is contained in:
2025-04-04 20:24:44 +06:00
committed by GitHub
28 changed files with 811 additions and 0 deletions

View File

@@ -4,6 +4,8 @@ kt = "2.1.20"
kt-serialization = "1.8.0"
kt-coroutines = "1.10.1"
kotlinx-browser = "0.3"
kslog = "1.4.1"
jb-compose = "1.7.3"
@@ -55,6 +57,7 @@ kt-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-and
kt-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kt-coroutines" }
kt-coroutines-debug = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-debug", version.ref = "kt-coroutines" }
kotlinx-browser = { module = "org.jetbrains.kotlinx:kotlinx-browser-wasm-js", version.ref = "kotlinx-browser" }
ktor-io = { module = "io.ktor:ktor-io", version.ref = "ktor" }
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }

View File

@@ -27,6 +27,10 @@ kotlin {
}
}
}
wasmJs {
browser()
nodejs()
}
androidTarget {
publishAllLibraryVariants()
compilations.all {
@@ -91,6 +95,11 @@ kotlin {
implementation kotlin('test-js')
}
}
wasmJsTest {
dependencies {
implementation kotlin('test-wasm-js')
}
}
nativeMain.dependsOn commonMain
linuxX64Main.dependsOn nativeMain
mingwX64Main.dependsOn nativeMain

View File

@@ -27,6 +27,10 @@ kotlin {
}
}
}
wasmJs {
browser()
nodejs()
}
androidTarget {
publishAllLibraryVariants()
compilations.all {
@@ -71,6 +75,11 @@ kotlin {
implementation kotlin('test-js')
}
}
wasmJsTest {
dependencies {
implementation kotlin('test-wasm-js')
}
}
nativeMain.dependsOn commonMain
linuxX64Main.dependsOn nativeMain
mingwX64Main.dependsOn nativeMain

View File

@@ -27,6 +27,10 @@ kotlin {
}
}
}
wasmJs {
browser()
nodejs()
}
linuxX64()
mingwX64()
@@ -55,6 +59,11 @@ kotlin {
implementation kotlin('test-js')
}
}
wasmJsTest {
dependencies {
implementation kotlin('test-wasm-js')
}
}
nativeMain.dependsOn commonMain
linuxX64Main.dependsOn nativeMain

View File

@@ -27,6 +27,10 @@ kotlin {
}
}
}
wasmJs {
browser()
nodejs()
}
androidTarget {
publishAllLibraryVariants()
compilations.all {
@@ -72,6 +76,11 @@ kotlin {
implementation kotlin('test-js')
}
}
wasmJsTest {
dependencies {
implementation kotlin('test-wasm-js')
}
}
androidUnitTest {
dependencies {
implementation kotlin('test-junit')