Skip to content

Commit 875f4ce

Browse files
lppeddpetertrr
andauthored
Support WebAssembly targets (#111)
Being WebAssembly is progressing at a fast pace, the more WASM-enabled libraries, the better. Updating to 1.9.24 is required for using Node.js 22. --------- Co-authored-by: Peter Trifanov <peter.trifanov@gmail.com>
1 parent 06b7c72 commit 875f4ce

File tree

3 files changed

+39
-13
lines changed

3 files changed

+39
-13
lines changed

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# kotlin-multiplatform-diff
2+
23
![Build and test](https://github.com/petertrr/kotlin-multiplatform-diff/workflows/Build%20and%20test/badge.svg)
34
[![License](https://img.shields.io/github/license/petertrr/kotlin-multiplatform-diff)](https://github.com/petertrr/kotlin-multiplatform-diff/blob/main/LICENSE)
45
[![codecov](https://codecov.io/gh/petertrr/kotlin-multiplatform-diff/branch/main/graph/badge.svg)](https://codecov.io/gh/petertrr/kotlin-multiplatform-diff)
@@ -7,20 +8,29 @@
78
[![Maven Central](https://img.shields.io/maven-central/v/io.github.petertrr/kotlin-multiplatform-diff)](https://mvnrepository.com/artifact/io.github.petertrr)
89
[![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)
910

10-
This is a port of [java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) to kotlin
11-
with multiplatform support. All credit for the implementation goes to original authors.
11+
This is a port of [java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) to Kotlin with multiplatform support.
12+
All credit for the implementation goes to original authors.
1213

1314
## Features
14-
All features from version 4.10 of the original library are present, except for:
15-
* Unified diff, which heavily uses file read/write and therefore needs a more complicated rewrite for kotlin-multiplatform
16-
* diff-utils-jgit, which uses JVM-only jgit library
15+
16+
All features from version `4.10` of the original library are present, except for:
17+
18+
- unified diff, which heavily uses file read/write and therefore needs a more complicated rewrite
19+
- diff-utils-jgit, which uses JVM-only jgit library
1720

1821
Please refer to the original guides for more information.
1922

20-
## Supported platforms
23+
## Supported Platforms
24+
2125
Currently, artifacts for the following platforms are supported:
22-
* JVM
23-
* JS (both browser and Node.js)
24-
* LinuxX64
25-
* MingwX64
26-
* MacosX64
26+
27+
- JVM
28+
- JS (both browser and Node.js)
29+
- WebAssembly (JS and WASI)
30+
- Native
31+
32+
The supported Native targets are (following the Kotlin/Native [target support guidelines](https://kotlinlang.org/docs/native-target-support.html)):
33+
34+
| Tier 1 | Tier 2 | Tier 3 |
35+
|:---------|:---------|:---------|
36+
| macosX64 | linuxX64 | mingwX64 |

build.gradle.kts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import io.gitlab.arturbosch.detekt.Detekt
66
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
77
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
88
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
9+
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
910

1011
plugins {
1112
kotlin("multiplatform")
@@ -51,6 +52,21 @@ kotlin {
5152
nodejs()
5253
}
5354

55+
@OptIn(ExperimentalWasmDsl::class)
56+
wasmJs {
57+
browser()
58+
nodejs()
59+
applyBinaryen()
60+
}
61+
62+
@OptIn(ExperimentalWasmDsl::class)
63+
wasmWasi {
64+
nodejs()
65+
66+
// Available since 2.0
67+
// applyBinaryen()
68+
}
69+
5470
linuxX64()
5571
mingwX64()
5672
macosX64()

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[versions]
2-
kotlin = "1.9.23"
2+
kotlin = "1.9.24"
33
detekt = "1.23.5"
4-
dokka = "1.9.10"
4+
dokka = "1.9.20"
55
nexus = "1.3.0"
66

77
[plugins]

0 commit comments

Comments
 (0)