From d675f54a6426532eecc82686069ffa3943950baa Mon Sep 17 00:00:00 2001 From: Dragos Rachieru Date: Sun, 20 Oct 2024 21:22:01 +0300 Subject: [PATCH] Added config for js --- backend/rpc/build.gradle.kts | 21 ++++++++++------ .../dragossusi/ktcnc/rpc/FileSystemService.kt | 4 +++- backend/server/build.gradle.kts | 1 - build.gradle.kts | 1 - buildSrc/src/main/kotlin/Libs.kt | 15 +++++++++++- buildSrc/src/main/kotlin/Platforms.kt | 3 +++ buildSrc/src/main/kotlin/Versions.kt | 2 +- data/common/api/build.gradle.kts | 6 +++-- data/common/impl/build.gradle.kts | 6 +++-- data/gcode/api/build.gradle.kts | 6 +++-- data/gcode/remote/build.gradle.kts | 6 +++-- data/lathehal/api/build.gradle.kts | 6 +++-- data/lathehal/remote/build.gradle.kts | 6 +++-- data/lathetools/api/build.gradle.kts | 4 +++- data/lathetools/remote/build.gradle.kts | 6 +++-- data/linuxcnc/api/build.gradle.kts | 6 +++-- data/linuxcnc/remote/build.gradle.kts | 8 +++++-- .../remote/FileSystemRepositoryRemote.kt | 21 ++++++++++++++-- data/settings/api/build.gradle.kts | 6 +++-- data/settings/remote/build.gradle.kts | 6 +++-- dispatcher/build.gradle.kts | 6 +++-- editor/build.gradle.kts | 6 +++-- frontend/actor/build.gradle.kts | 6 +++-- frontend/app/build.gradle.kts | 24 +++++++++++-------- frontend/breadcrumb/build.gradle.kts | 6 +++-- frontend/canvas/build.gradle.kts | 6 +++-- frontend/clipboard/build.gradle.kts | 6 +++-- frontend/compose/build.gradle.kts | 4 +++- frontend/di/build.gradle.kts | 4 +++- frontend/domain/build.gradle.kts | 4 +++- frontend/editor/build.gradle.kts | 6 +++-- frontend/filesystem/build.gradle.kts | 6 +++-- frontend/format/build.gradle.kts | 6 ++--- frontend/listitem/build.gradle.kts | 6 +++-- frontend/numpad/build.gradle.kts | 6 ++++- frontend/screen/base/build.gradle.kts | 4 +++- .../screen/conversational/build.gradle.kts | 6 ++++- frontend/screen/manual/build.gradle.kts | 4 +++- .../screen/notifications/build.gradle.kts | 6 ++++- frontend/screen/programs/build.gradle.kts | 4 +++- frontend/screen/root/build.gradle.kts | 6 ++++- frontend/screen/status/build.gradle.kts | 5 ++-- frontend/screen/tools/build.gradle.kts | 6 ++++- frontend/scroll/build.gradle.kts | 6 +++-- frontend/widgets/build.gradle.kts | 9 ++++--- initializer/build.gradle.kts | 6 +++-- logger/build.gradle.kts | 6 +++-- model/build.gradle.kts | 6 ++++- protos/build.gradle.kts | 6 +++-- protos/src/main | 2 +- reader/gcode/build.gradle.kts | 6 +++-- reader/tbl/build.gradle.kts | 6 +++-- startup/args/build.gradle.kts | 6 +++-- 53 files changed, 240 insertions(+), 102 deletions(-) create mode 100644 buildSrc/src/main/kotlin/Platforms.kt diff --git a/backend/rpc/build.gradle.kts b/backend/rpc/build.gradle.kts index 9a8d8b7f..53348ecc 100644 --- a/backend/rpc/build.gradle.kts +++ b/backend/rpc/build.gradle.kts @@ -1,24 +1,31 @@ plugins { kotlin("multiplatform") kotlin("plugin.serialization") -// id("io.ktor.plugin") -// id("org.jetbrains.kotlinx.rpc.plugin") + id("org.jetbrains.kotlinx.rpc.plugin") +} + +repositories { + mavenCentral() } kotlin { jvm() - js(IR) { - browser() + + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { commonMain.dependencies { api(Libs.Coroutines.core) + api(Libs.Serialization.core) api(Libs.Serialization.json) -// implementation(Libs.Rpc.core) -// implementation(Libs.Rpc.serializationJson) -// implementation(Libs.datetime) + implementation(Libs.Rpc.core) + implementation(Libs.Rpc.serializationJson) + implementation(Libs.datetime) } } } diff --git a/backend/rpc/src/commonMain/kotlin/ro/dragossusi/ktcnc/rpc/FileSystemService.kt b/backend/rpc/src/commonMain/kotlin/ro/dragossusi/ktcnc/rpc/FileSystemService.kt index 10986c95..2646462e 100644 --- a/backend/rpc/src/commonMain/kotlin/ro/dragossusi/ktcnc/rpc/FileSystemService.kt +++ b/backend/rpc/src/commonMain/kotlin/ro/dragossusi/ktcnc/rpc/FileSystemService.kt @@ -1,6 +1,8 @@ package ro.dragossusi.ktcnc.rpc -interface FileSystemService { +import kotlinx.rpc.RPC + +interface FileSystemService : RPC { suspend fun getRoot(): FileResponse suspend fun getFile(path: String): FileResponse diff --git a/backend/server/build.gradle.kts b/backend/server/build.gradle.kts index f69a80ac..d8306d6f 100644 --- a/backend/server/build.gradle.kts +++ b/backend/server/build.gradle.kts @@ -1,7 +1,6 @@ plugins { kotlin("jvm") kotlin("plugin.serialization") - id("org.jetbrains.kotlinx.rpc.plugin") id("io.ktor.plugin") } diff --git a/build.gradle.kts b/build.gradle.kts index 6012df7a..5fbb8ed4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,7 +27,6 @@ plugins { id("androidx.room") version Versions.room apply false // rpc id("org.jetbrains.kotlinx.rpc.plugin") version Versions.Kotlinx.rpc apply false - id("org.jetbrains.kotlinx.rpc.platform") version Versions.Kotlinx.rpc apply false id("io.ktor.plugin") version Versions.ktor } diff --git a/buildSrc/src/main/kotlin/Libs.kt b/buildSrc/src/main/kotlin/Libs.kt index 18f49266..33b9f88a 100644 --- a/buildSrc/src/main/kotlin/Libs.kt +++ b/buildSrc/src/main/kotlin/Libs.kt @@ -51,14 +51,27 @@ object Libs { } object Serialization { + const val core = + "org.jetbrains.kotlinx:kotlinx-serialization-core:${Versions.Kotlinx.serialization}" const val json = "org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.Kotlinx.serialization}" const val json_okio = "org.jetbrains.kotlinx:kotlinx-serialization-json-okio:${Versions.Kotlinx.serialization}" } + object Ktor { + object Client { + const val core = "io.ktor:ktor-client-core:${Versions.ktor}" + const val cio = "io.ktor:ktor-client-cio:${Versions.ktor}" + } + + object Server { + const val core = "io.ktor:ktor-server-core-jvm:${Versions.ktor}" + } + } + object Rpc { - const val core = "org.jetbrains.kotlinx:kotlinx-rpc-core:${Versions.Kotlinx.rpc}" + const val core = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-core:${Versions.Kotlinx.rpc}" const val client = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-client:${Versions.Kotlinx.rpc}" const val server = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-server:${Versions.Kotlinx.rpc}" const val ktorServer = "org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server:${Versions.Kotlinx.rpc}" diff --git a/buildSrc/src/main/kotlin/Platforms.kt b/buildSrc/src/main/kotlin/Platforms.kt new file mode 100644 index 00000000..9426e515 --- /dev/null +++ b/buildSrc/src/main/kotlin/Platforms.kt @@ -0,0 +1,3 @@ +object Platforms { + val jsEnabled = false +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 05780197..851840d6 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -2,7 +2,7 @@ object Versions { const val kotlin = "2.0.10" const val ksp = "2.0.10-1.0.24" const val compose = "1.7.0" - const val material3adaptive = "1.0.0-alpha03" + const val material3adaptive = "1.0.0" const val kodein = "7.21.1" const val okio = "3.9.1" diff --git a/data/common/api/build.gradle.kts b/data/common/api/build.gradle.kts index fa3b33dc..26eb7a61 100644 --- a/data/common/api/build.gradle.kts +++ b/data/common/api/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/data/common/impl/build.gradle.kts b/data/common/impl/build.gradle.kts index 7f4b98f5..a8fc1429 100644 --- a/data/common/impl/build.gradle.kts +++ b/data/common/impl/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/data/gcode/api/build.gradle.kts b/data/gcode/api/build.gradle.kts index 77b290f5..6f16ffc3 100644 --- a/data/gcode/api/build.gradle.kts +++ b/data/gcode/api/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/data/gcode/remote/build.gradle.kts b/data/gcode/remote/build.gradle.kts index b3909009..d05688b0 100644 --- a/data/gcode/remote/build.gradle.kts +++ b/data/gcode/remote/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/data/lathehal/api/build.gradle.kts b/data/lathehal/api/build.gradle.kts index 66f08133..cc731a44 100644 --- a/data/lathehal/api/build.gradle.kts +++ b/data/lathehal/api/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/data/lathehal/remote/build.gradle.kts b/data/lathehal/remote/build.gradle.kts index c1a2e7c2..c373071a 100644 --- a/data/lathehal/remote/build.gradle.kts +++ b/data/lathehal/remote/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/data/lathetools/api/build.gradle.kts b/data/lathetools/api/build.gradle.kts index 31b5601e..a473ae22 100644 --- a/data/lathetools/api/build.gradle.kts +++ b/data/lathetools/api/build.gradle.kts @@ -7,7 +7,9 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { browser() } + } sourceSets { val commonMain by getting { diff --git a/data/lathetools/remote/build.gradle.kts b/data/lathetools/remote/build.gradle.kts index f2834365..2b8c4686 100644 --- a/data/lathetools/remote/build.gradle.kts +++ b/data/lathetools/remote/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/data/linuxcnc/api/build.gradle.kts b/data/linuxcnc/api/build.gradle.kts index 02c76cc5..e928dcc6 100644 --- a/data/linuxcnc/api/build.gradle.kts +++ b/data/linuxcnc/api/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/data/linuxcnc/remote/build.gradle.kts b/data/linuxcnc/remote/build.gradle.kts index 335c83d9..1043bfe5 100644 --- a/data/linuxcnc/remote/build.gradle.kts +++ b/data/linuxcnc/remote/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { @@ -22,6 +24,8 @@ kotlin { implementation(project(":model")) implementation(Libs.okio) implementation(Libs.Rpc.ktorClient) + implementation(Libs.Rpc.client) + implementation(Libs.Ktor.Client.core) // logging implementation(Libs.Log.logging) diff --git a/data/linuxcnc/remote/src/commonMain/kotlin/com/mindovercnc/data/linuxcnc/remote/FileSystemRepositoryRemote.kt b/data/linuxcnc/remote/src/commonMain/kotlin/com/mindovercnc/data/linuxcnc/remote/FileSystemRepositoryRemote.kt index 243cb961..0cb1a00c 100644 --- a/data/linuxcnc/remote/src/commonMain/kotlin/com/mindovercnc/data/linuxcnc/remote/FileSystemRepositoryRemote.kt +++ b/data/linuxcnc/remote/src/commonMain/kotlin/com/mindovercnc/data/linuxcnc/remote/FileSystemRepositoryRemote.kt @@ -1,15 +1,32 @@ package com.mindovercnc.data.linuxcnc.remote import com.mindovercnc.data.linuxcnc.FileSystemRepository +import io.ktor.client.* +import kotlinx.rpc.krpc.ktor.client.rpc +import kotlinx.rpc.krpc.ktor.client.rpcConfig +import kotlinx.rpc.withService import mu.KotlinLogging import ro.dragossusi.ktcnc.rpc.FileResponse import ro.dragossusi.ktcnc.rpc.FileSystemService class FileSystemRepositoryRemote( - private val fileSystemService: FileSystemService + private val httpClient: HttpClient ) : FileSystemRepository { + + private suspend fun createService() = httpClient.rpc { + url { + host = "localhost" + port = 8080 + } + rpcConfig { + serialization { + json() + } + } + }.withService() + override suspend fun getFile(path: String): FileResponse { - return fileSystemService.getFile(path) + return createService().getFile(path) } override suspend fun getNcRootAppFile(): FileResponse { diff --git a/data/settings/api/build.gradle.kts b/data/settings/api/build.gradle.kts index 66f08133..cc731a44 100644 --- a/data/settings/api/build.gradle.kts +++ b/data/settings/api/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/data/settings/remote/build.gradle.kts b/data/settings/remote/build.gradle.kts index f2d49c47..18dcd768 100644 --- a/data/settings/remote/build.gradle.kts +++ b/data/settings/remote/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/dispatcher/build.gradle.kts b/dispatcher/build.gradle.kts index 4a21ee52..77ff93fc 100644 --- a/dispatcher/build.gradle.kts +++ b/dispatcher/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/editor/build.gradle.kts b/editor/build.gradle.kts index 6801a9cf..6975fd69 100644 --- a/editor/build.gradle.kts +++ b/editor/build.gradle.kts @@ -7,8 +7,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/frontend/actor/build.gradle.kts b/frontend/actor/build.gradle.kts index 61cc3efb..ec9abd7b 100644 --- a/frontend/actor/build.gradle.kts +++ b/frontend/actor/build.gradle.kts @@ -6,8 +6,10 @@ plugins { kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/frontend/app/build.gradle.kts b/frontend/app/build.gradle.kts index cf0f1388..24a64452 100644 --- a/frontend/app/build.gradle.kts +++ b/frontend/app/build.gradle.kts @@ -11,9 +11,11 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() - binaries.executable() + if (Platforms.jsEnabled) { + js(IR) { + browser() + binaries.executable() + } } sourceSets { @@ -104,13 +106,15 @@ kotlin { } } - val jsMain by getting { - dependencies { - implementation(project(":data:gcode:remote")) - implementation(project(":data:linuxcnc:remote")) - implementation(project(":data:settings:remote")) - implementation(project(":data:lathetools:remote")) - implementation(project(":data:lathehal:remote")) + if (Platforms.jsEnabled) { + val jsMain by getting { + dependencies { + implementation(project(":data:gcode:remote")) + implementation(project(":data:linuxcnc:remote")) + implementation(project(":data:settings:remote")) + implementation(project(":data:lathetools:remote")) + implementation(project(":data:lathehal:remote")) + } } } diff --git a/frontend/breadcrumb/build.gradle.kts b/frontend/breadcrumb/build.gradle.kts index 0a5dcd64..a2d3b345 100644 --- a/frontend/breadcrumb/build.gradle.kts +++ b/frontend/breadcrumb/build.gradle.kts @@ -11,8 +11,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/frontend/canvas/build.gradle.kts b/frontend/canvas/build.gradle.kts index ebae4e57..28bca46b 100644 --- a/frontend/canvas/build.gradle.kts +++ b/frontend/canvas/build.gradle.kts @@ -6,8 +6,10 @@ plugins { kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/frontend/clipboard/build.gradle.kts b/frontend/clipboard/build.gradle.kts index b0ef655f..c7a7d4e1 100644 --- a/frontend/clipboard/build.gradle.kts +++ b/frontend/clipboard/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } compilerOptions { freeCompilerArgs.add("-Xexpect-actual-classes") } diff --git a/frontend/compose/build.gradle.kts b/frontend/compose/build.gradle.kts index dd0fb76d..4d23a765 100644 --- a/frontend/compose/build.gradle.kts +++ b/frontend/compose/build.gradle.kts @@ -10,7 +10,9 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { browser() } + } sourceSets { val commonMain by getting { diff --git a/frontend/di/build.gradle.kts b/frontend/di/build.gradle.kts index 115d0fec..a035afd3 100644 --- a/frontend/di/build.gradle.kts +++ b/frontend/di/build.gradle.kts @@ -11,7 +11,9 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { browser() } + } sourceSets { val commonMain by getting { diff --git a/frontend/domain/build.gradle.kts b/frontend/domain/build.gradle.kts index 8479c931..7509a1b9 100644 --- a/frontend/domain/build.gradle.kts +++ b/frontend/domain/build.gradle.kts @@ -11,7 +11,9 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { browser() } + } sourceSets { val commonMain by getting { diff --git a/frontend/editor/build.gradle.kts b/frontend/editor/build.gradle.kts index 3bc4c142..436de694 100644 --- a/frontend/editor/build.gradle.kts +++ b/frontend/editor/build.gradle.kts @@ -8,8 +8,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/frontend/filesystem/build.gradle.kts b/frontend/filesystem/build.gradle.kts index 329d1995..f577db2d 100644 --- a/frontend/filesystem/build.gradle.kts +++ b/frontend/filesystem/build.gradle.kts @@ -10,8 +10,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/frontend/format/build.gradle.kts b/frontend/format/build.gradle.kts index 8dcd4784..5e8bd33f 100644 --- a/frontend/format/build.gradle.kts +++ b/frontend/format/build.gradle.kts @@ -1,12 +1,12 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - plugins { kotlin("multiplatform") } version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { browser() } + } sourceSets { val commonMain by getting { diff --git a/frontend/listitem/build.gradle.kts b/frontend/listitem/build.gradle.kts index cdd5d32b..d74e1e77 100644 --- a/frontend/listitem/build.gradle.kts +++ b/frontend/listitem/build.gradle.kts @@ -10,8 +10,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/frontend/numpad/build.gradle.kts b/frontend/numpad/build.gradle.kts index 681b9c60..ddaa5e5e 100644 --- a/frontend/numpad/build.gradle.kts +++ b/frontend/numpad/build.gradle.kts @@ -12,7 +12,11 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { + browser() + } + } sourceSets { val commonMain by getting { diff --git a/frontend/screen/base/build.gradle.kts b/frontend/screen/base/build.gradle.kts index 90602d29..50e3af98 100644 --- a/frontend/screen/base/build.gradle.kts +++ b/frontend/screen/base/build.gradle.kts @@ -11,7 +11,9 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { browser() } + } sourceSets { val commonMain by getting { diff --git a/frontend/screen/conversational/build.gradle.kts b/frontend/screen/conversational/build.gradle.kts index c52ca303..382e517d 100644 --- a/frontend/screen/conversational/build.gradle.kts +++ b/frontend/screen/conversational/build.gradle.kts @@ -11,7 +11,11 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { + browser() + } + } sourceSets { val commonMain by getting { diff --git a/frontend/screen/manual/build.gradle.kts b/frontend/screen/manual/build.gradle.kts index bec93c3b..4a1ac866 100644 --- a/frontend/screen/manual/build.gradle.kts +++ b/frontend/screen/manual/build.gradle.kts @@ -12,7 +12,9 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { browser() } + } sourceSets { val commonMain by getting { diff --git a/frontend/screen/notifications/build.gradle.kts b/frontend/screen/notifications/build.gradle.kts index bec93c3b..9ab0154f 100644 --- a/frontend/screen/notifications/build.gradle.kts +++ b/frontend/screen/notifications/build.gradle.kts @@ -12,7 +12,11 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { + browser() + } + } sourceSets { val commonMain by getting { diff --git a/frontend/screen/programs/build.gradle.kts b/frontend/screen/programs/build.gradle.kts index 1640dc07..7ec934f2 100644 --- a/frontend/screen/programs/build.gradle.kts +++ b/frontend/screen/programs/build.gradle.kts @@ -11,7 +11,9 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { browser() } + } sourceSets { val commonMain by getting { diff --git a/frontend/screen/root/build.gradle.kts b/frontend/screen/root/build.gradle.kts index 6094a920..26b6d6a2 100644 --- a/frontend/screen/root/build.gradle.kts +++ b/frontend/screen/root/build.gradle.kts @@ -11,7 +11,11 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { + browser() + } + } sourceSets { val commonMain by getting { diff --git a/frontend/screen/status/build.gradle.kts b/frontend/screen/status/build.gradle.kts index de2d7a59..a5894e20 100644 --- a/frontend/screen/status/build.gradle.kts +++ b/frontend/screen/status/build.gradle.kts @@ -1,4 +1,3 @@ -import org.jetbrains.compose.ExperimentalComposeLibrary import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -11,7 +10,9 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { browser() } + } sourceSets { val commonMain by getting { diff --git a/frontend/screen/tools/build.gradle.kts b/frontend/screen/tools/build.gradle.kts index 2a9e6275..11878265 100644 --- a/frontend/screen/tools/build.gradle.kts +++ b/frontend/screen/tools/build.gradle.kts @@ -12,7 +12,11 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { + browser() + } + } sourceSets { val commonMain by getting { diff --git a/frontend/scroll/build.gradle.kts b/frontend/scroll/build.gradle.kts index 1a2194b0..83d43f30 100644 --- a/frontend/scroll/build.gradle.kts +++ b/frontend/scroll/build.gradle.kts @@ -8,8 +8,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/frontend/widgets/build.gradle.kts b/frontend/widgets/build.gradle.kts index 6d980164..f0af0d2d 100644 --- a/frontend/widgets/build.gradle.kts +++ b/frontend/widgets/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.compose.ExperimentalComposeLibrary - plugins { kotlin("multiplatform") kotlin("plugin.compose") @@ -10,8 +8,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { @@ -33,7 +33,6 @@ kotlin { // compose implementation(compose.materialIconsExtended) implementation(compose.material3) - @OptIn(ExperimentalComposeLibrary::class) implementation(compose.components.resources) implementation(project(":frontend:numpad")) diff --git a/initializer/build.gradle.kts b/initializer/build.gradle.kts index c7bee090..6f902b36 100644 --- a/initializer/build.gradle.kts +++ b/initializer/build.gradle.kts @@ -4,8 +4,10 @@ plugins { kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/logger/build.gradle.kts b/logger/build.gradle.kts index ca54e4bc..90cd6c9b 100644 --- a/logger/build.gradle.kts +++ b/logger/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/model/build.gradle.kts b/model/build.gradle.kts index f765a0c6..d7bf2418 100644 --- a/model/build.gradle.kts +++ b/model/build.gradle.kts @@ -7,7 +7,11 @@ version = Versions.app kotlin { jvm() - js(IR) { browser() } + if (Platforms.jsEnabled) { + js(IR) { + browser() + } + } sourceSets { val commonMain by getting { diff --git a/protos/build.gradle.kts b/protos/build.gradle.kts index f4651664..cadf8cbb 100644 --- a/protos/build.gradle.kts +++ b/protos/build.gradle.kts @@ -5,8 +5,10 @@ plugins { kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { diff --git a/protos/src/main b/protos/src/main index 212267c3..209644ca 160000 --- a/protos/src/main +++ b/protos/src/main @@ -1 +1 @@ -Subproject commit 212267c3da736b7de6ac4e9ba1af00fadf83329b +Subproject commit 209644ca6399d83cbbcff0e122c39a31863c06ce diff --git a/reader/gcode/build.gradle.kts b/reader/gcode/build.gradle.kts index 91203435..2f5f6ef2 100644 --- a/reader/gcode/build.gradle.kts +++ b/reader/gcode/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { val commonMain by getting { diff --git a/reader/tbl/build.gradle.kts b/reader/tbl/build.gradle.kts index 7d4ad078..0f831eed 100644 --- a/reader/tbl/build.gradle.kts +++ b/reader/tbl/build.gradle.kts @@ -4,8 +4,10 @@ version = Versions.app kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets { val commonMain by getting { diff --git a/startup/args/build.gradle.kts b/startup/args/build.gradle.kts index 9131eabe..3fa69c9e 100644 --- a/startup/args/build.gradle.kts +++ b/startup/args/build.gradle.kts @@ -6,8 +6,10 @@ plugins { kotlin { jvm() - js(IR) { - browser() + if (Platforms.jsEnabled) { + js(IR) { + browser() + } } sourceSets {