Skip to content

Commit

Permalink
Add wasm target.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteckman committed Dec 9, 2023
1 parent 5e769d9 commit f974880
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 32 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Changed

- Update to Compose version 1.5.10
- Update Kotlin version to 1.9.20
- Update to Compose version 1.6.0-alpha01
- Update Kotlin version to 1.9.21
- Add wasm target
- Moved package for AreaStyle, LineStyle, Point, DefaultPoint, and KoalaPlotTheme
- Line/Area chart scaling applied to paths instead of canvas so PathEffects scale the same as drawing on an unscaled
Canvas
Expand Down
51 changes: 29 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

buildscript {
dependencies {
classpath("org.jetbrains.dokka:dokka-base:_") // needed for dokka custom format config
Expand Down Expand Up @@ -28,16 +30,25 @@ version = "0.5.0-dev2"

kotlin {
explicitApi()
jvm()
js(IR) {
browser()
}

androidTarget {
publishLibraryVariants("release")
}
iosX64()

iosArm64()
iosSimulatorArm64()
iosX64()

js(IR) {
browser()
}

jvm()

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser()
}

sourceSets {
val commonMain by getting {
Expand Down Expand Up @@ -117,19 +128,15 @@ tasks.register<org.jetbrains.dokka.gradle.DokkaTask>("dokkaCustomFormat") {

pluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> {
customStyleSheets = listOf(file("src/docs/dokka/logo-styles.css"))
customAssets = listOf(
file("src/docs/assets/images/logo-icon.svg")
)
customAssets = listOf(file("src/docs/assets/images/logo-icon.svg"))
}
}

tasks["build"].dependsOn.add("dokkaCustomFormat")

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf(
"-opt-in=kotlin.RequiresOptIn"
)
freeCompilerArgs = freeCompilerArgs + listOf("-opt-in=kotlin.RequiresOptIn")
jvmTarget = "11"
}

Expand All @@ -141,16 +148,16 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
}
}

afterEvaluate {
// https://discuss.kotlinlang.org/t/disabling-androidandroidtestrelease-source-set-in-gradle-kotlin-dsl-script/21448
project.extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.let { ext ->
ext.sourceSets.removeAll { sourceSet ->
setOf(
// "androidAndroidTestRelease",
"androidTestFixtures",
"androidTestFixturesDebug",
"androidTestFixturesRelease",
).contains(sourceSet.name)
afterEvaluate { // https://discuss.kotlinlang.org/t/disabling-androidandroidtestrelease-source-set-in-gradle-kotlin-dsl-script/21448
project.extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()
?.let { ext ->
ext.sourceSets.removeAll { sourceSet ->
setOf(
// "androidAndroidTestRelease",
"androidTestFixtures",
"androidTestFixturesDebug",
"androidTestFixturesRelease",
).contains(sourceSet.name)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ tasks.withType<AbstractPublishToMaven>().configureEach {
dependsOn.add("signJsPublication")
dependsOn.add("signJvmPublication")
dependsOn.add("signKotlinMultiplatformPublication")
dependsOn.add("signWasmJsPublication")

if (name.contains("ios", ignoreCase = true)) {
dependsOn.add("signIosArm64Publication")
Expand All @@ -66,7 +67,8 @@ publishing {
// Provide artifacts information required by Maven Central
pom {
name.set("koalaplot-core")
description.set("Koala Plot is a Compose Multiplatform based charting and plotting library written in Kotlin")
description.set("Koala Plot is a Compose Multiplatform based charting and " +
"plotting library written in Kotlin")
url.set("https://github.com/KoalaPlot/koalaplot-core")

licenses {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ kotlin.native.cocoapods.generate.wrapper=true
kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.native.ignoreDisabledTargets=true
org.jetbrains.compose.experimental.wasm.enabled=true
13 changes: 6 additions & 7 deletions versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@
## unused
plugin.android=8.1.1

version.kotlin=1.9.20
version.kotlin=1.9.21
## # available=2.0.0-Beta1

version.kotlinx.coroutines=1.7.3
## # available=1.8.0-RC

plugin.org.jetbrains.compose=1.5.10
## # available=1.6.0-dev1258
## # available=1.6.0-dev1265
## # available=1.6.0-dev1268
plugin.org.jetbrains.compose=1.6.0-alpha01

version.org.jetbrains.dokka..dokka-base=1.9.10

plugin.org.jetbrains.dokka=1.9.10

plugin.io.gitlab.arturbosch.detekt=1.23.3
plugin.io.gitlab.arturbosch.detekt=1.23.4

version.io.gitlab.arturbosch.detekt..detekt-formatting=1.23.3
version.io.gitlab.arturbosch.detekt..detekt-formatting=1.23.4

0 comments on commit f974880

Please sign in to comment.