From 13da730da106938c46b9dcccc4380e8af6c0bfca Mon Sep 17 00:00:00 2001 From: AJ Date: Wed, 9 Aug 2023 09:57:25 -0700 Subject: [PATCH] Publish wasm target --- CHANGELOG.md | 3 +++ README.md | 2 +- colormath/build.gradle.kts | 19 +++++++++---------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 455739bf..d3bc2aae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## Unreleased +### Added +- Publish `wasm` target. This target is experimental and is not tested on CI. + ## Changed - Updated Kotlin to 1.9.0 diff --git a/README.md b/README.md index 9fb833b5..9cf75566 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ dependencies { Colormath supports the following targets: `jvm`, `mingwX64`, `linuxX64`, `macosX64`, `ios`, `watchos`, `tvos`, and `js` (for both NodeJS and Browsers). You'll need to use Gradle 6 or newer. -Artifacts for `macosArm64` are also published, but not tested with CI. +Artifacts for `macosArm64` and `wasm` are also published, but not tested with CI. #### Snapshots diff --git a/colormath/build.gradle.kts b/colormath/build.gradle.kts index 14a2f7d1..4b2135e7 100644 --- a/colormath/build.gradle.kts +++ b/colormath/build.gradle.kts @@ -1,8 +1,4 @@ -@file:Suppress("PropertyName") - -import org.jetbrains.kotlin.gradle.dsl.JvmTarget -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile +import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl plugins { kotlin("multiplatform") @@ -15,10 +11,14 @@ repositories { kotlin { jvm() - js(IR) { + js { nodejs() browser() } + @OptIn(ExperimentalWasmDsl::class) + wasm { + browser() + } linuxX64() mingwX64() @@ -50,10 +50,9 @@ kotlin { "tvosSimulatorArm64", "watchos", "watchosSimulatorArm64" - ) - .forEach { target -> - getByName(target + "Main").dependsOn(nativeMain) - } + ).forEach { target -> + getByName(target + "Main").dependsOn(nativeMain) + } val commonTest by getting { dependencies {