Skip to content

Commit

Permalink
Add Kotlin/JS and WASM targets, bump version to 0.9.0
Browse files Browse the repository at this point in the history
This commit introduces support for Kotlin/JS and WASM targets including browser, nodejs, and d8. It also updates the project version from 0.8.0 to 0.9.0. Additionally, it adds a new entry to .gitignore to exclude kotlin-js-store.
  • Loading branch information
smyrgeorge committed Oct 22, 2024
1 parent 1d3ce6c commit e2f8f4e
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
kotlin-js-store

# Created by https://www.toptal.com/developers/gitignore/api/java,rust,macos,maven,gradle,kotlin,eclipse,windows,intellij,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=java,rust,macos,maven,gradle,kotlin,eclipse,windows,intellij,visualstudiocode

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.github.smyrgeorge.log4k.multiplatform
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension

class MultiplatformConventions : Plugin<Project> {
Expand All @@ -20,6 +21,26 @@ class MultiplatformConventions : Plugin<Project> {
Pair("linuxX64") { linuxX64() },
Pair("mingwX64") { mingwX64() },
Pair("jvm") { jvm() },
Pair("js") {
js {
browser()
nodejs()
}
},
@OptIn(ExperimentalWasmDsl::class)
Pair("wasmJs") {
wasmJs {
browser()
nodejs()
d8()
}
},
@OptIn(ExperimentalWasmDsl::class)
Pair("wasmWasi") {
wasmWasi {
nodejs()
}
},
)

targets.forEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.github.smyrgeorge.log4k.multiplatform
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension

class MultiplatformExamplesConventions : Plugin<Project> {
Expand All @@ -20,6 +21,26 @@ class MultiplatformExamplesConventions : Plugin<Project> {
Pair("linuxX64") { linuxX64 { binaries { executable() } } },
Pair("mingwX64") { mingwX64 { binaries { executable() } } },
Pair("jvm") { jvm { withJava() } },
Pair("js") {
js {
browser()
nodejs()
}
},
@OptIn(ExperimentalWasmDsl::class)
Pair("wasmJs") {
wasmJs {
browser()
nodejs()
d8()
}
},
@OptIn(ExperimentalWasmDsl::class)
Pair("wasmWasi") {
wasmWasi {
nodejs()
}
},
)

targets.forEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.github.smyrgeorge.log4k.multiplatform
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

object Utils {
private val os = DefaultNativePlatform.getCurrentOperatingSystem()
Expand Down Expand Up @@ -71,10 +72,13 @@ object Utils {
"linuxArm64",
"linuxX64",
"mingwX64",
"jvm"
"jvm",
// "js",
// "wasmJs",
// "wasmWasi"
)

else -> it.split(",").map { t -> t.trim() }
}
} ?: (listOf(defaultTarget) + "jvm") // Default for local development.
}
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group = "io.github.smyrgeorge"
version = "0.8.0"
version = "0.9.0"

plugins {
alias(libs.plugins.dokka)
Expand Down

0 comments on commit e2f8f4e

Please sign in to comment.