From bcc88f71e4f8cc01789b04dc5d7e8d3b942b6fe6 Mon Sep 17 00:00:00 2001 From: rnentjes Date: Mon, 17 Mar 2025 18:13:58 +0000 Subject: [PATCH] Update build scripts and configure multiplatform project Added a Gradle build script for the test-app module with Kotlin Multiplatform configuration, including JS and JVM targets. Upgraded Kotlin plugin version to 2.1.10, updated dependencies, and adjusted the JS distribution path. Renamed the JS file in UndertowServer configuration for accuracy. --- build.gradle.kts | 2 +- test-app/build.gradle.kts | 59 +++++++++++++++++++ test-app/data/db.txt | 1 + .../jvmMain/kotlin/nl/astraeus/vst/ui/Test.kt | 2 +- 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 test-app/build.gradle.kts create mode 100644 test-app/data/db.txt diff --git a/build.gradle.kts b/build.gradle.kts index f28d17e..9e35bb4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi plugins { - kotlin("multiplatform") version "2.1.0" + kotlin("multiplatform") version "2.1.10" `maven-publish` signing } diff --git a/test-app/build.gradle.kts b/test-app/build.gradle.kts new file mode 100644 index 0000000..99e3a67 --- /dev/null +++ b/test-app/build.gradle.kts @@ -0,0 +1,59 @@ +@file:OptIn(ExperimentalKotlinGradlePluginApi::class) + +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi + +plugins { + kotlin("multiplatform") version "2.1.10" +} + +group = "nl.astraeus" +version = "2.0.0-SNAPSHOT" + +repositories { + mavenCentral() + maven { + setUrl("https://gitea.astraeus.nl/api/packages/rnentjes/maven") + } + maven { + setUrl("https://gitea.astraeus.nl:8443/api/packages/rnentjes/maven") + } +} + +kotlin { + js { + compilerOptions { + target.set("es2015") + } + browser { + commonWebpackConfig { + sourceMaps = true + } + binaries.executable() + distribution { + outputDirectory.set(File("$projectDir/web/")) + } + } + } + jvm { + withJava() + } + + sourceSets { + val commonMain by getting { + dependencies { + api("nl.astraeus:vst-ui-base") + } + } + val jsMain by getting { + dependencies { + api("nl.astraeus:kotlin-komponent:1.2.4") + } + } + val jsTest by getting { + dependencies { + implementation(kotlin("test")) + } + } + val jvmMain by getting + } +} diff --git a/test-app/data/db.txt b/test-app/data/db.txt new file mode 100644 index 0000000..f18d60c --- /dev/null +++ b/test-app/data/db.txt @@ -0,0 +1 @@ +The db will be created in this directory \ No newline at end of file diff --git a/test-app/src/jvmMain/kotlin/nl/astraeus/vst/ui/Test.kt b/test-app/src/jvmMain/kotlin/nl/astraeus/vst/ui/Test.kt index cf906e9..a9f029e 100644 --- a/test-app/src/jvmMain/kotlin/nl/astraeus/vst/ui/Test.kt +++ b/test-app/src/jvmMain/kotlin/nl/astraeus/vst/ui/Test.kt @@ -16,6 +16,6 @@ fun main() { UndertowServer.start( "Vst UI-base Test", - "/vst-ui-base-test.js" + "/test-app.js" ) }