Skip to content

Commit

Permalink
Add wasmJs support (#45)
Browse files Browse the repository at this point in the history
* add wasmJs support

* revert formatting

* update readme

* revert kotlin and statelyIso updates
  • Loading branch information
luca992 authored Jan 4, 2024
1 parent 763305a commit c3b99c9
Show file tree
Hide file tree
Showing 6 changed files with 917 additions and 25 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The following targets are currently supported:

- jvm
- js
- wasmJs
- iosX64
- iosArm64
- iosSimulatorArm64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.gradle.jvm.toolchain.JvmVendorSpec
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.creating
import org.gradle.kotlin.dsl.getValue
import org.gradle.kotlin.dsl.getting
import org.gradle.kotlin.dsl.invoke
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.the
Expand All @@ -25,6 +26,7 @@ import org.jetbrains.dokka.gradle.DokkaPlugin
import org.jetbrains.kotlin.gradle.dsl.JsModuleKind
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

internal class ConventionPlugin : Plugin<Project> {
override fun apply(project: Project) = with(project) {
Expand Down Expand Up @@ -159,6 +161,11 @@ private fun KotlinMultiplatformExtension.configureTargets(project: Project) {
browser()
nodejs()
}
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser()
binaries.executable()
}
iosX64()
iosArm64()
iosSimulatorArm64()
Expand Down Expand Up @@ -186,6 +193,9 @@ private fun KotlinMultiplatformExtension.configureTargets(project: Project) {
dependsOn(commonMain.get())
}
jsMain.get().dependsOn(nonJvm)
val wasmJsMain by getting {
dependsOn(nonJvm)
}
appleMain.get().dependsOn(nonJvm)
linuxMain.get().dependsOn(nonJvm)
mingwMain.get().dependsOn(nonJvm)
Expand Down
8 changes: 1 addition & 7 deletions cache4k/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ kotlin {
}
commonTest {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation(kotlin("test"))
implementation(libs.coroutines.test)
}
}
Expand All @@ -29,10 +28,5 @@ kotlin {
implementation(libs.lincheck)
}
}
jsTest {
dependencies {
implementation(kotlin("test-js"))
}
}
}
}
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ binaryCompabilityValidator = "0.13.2"
toolchainsResolver = "0.5.0"
detekt = "1.23.1"
mavenPublish = "0.25.3"
coroutines = "1.7.2"
atomicfu = "0.21.0"
coroutines = "1.8.0-RC2"
atomicfu = "0.23.1"
lincheck = "2.17"
statelyIso = "2.0.5"

Expand Down
Loading

0 comments on commit c3b99c9

Please sign in to comment.