fixing(client)
This commit is contained in:
@@ -1,19 +1,28 @@
|
||||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.compose.multiplatform)
|
||||
alias(libs.plugins.compose.compiler)
|
||||
alias(libs.plugins.kotlin.multiplatform)
|
||||
kotlin("multiplatform")
|
||||
id("org.jetbrains.compose")
|
||||
id("org.jetbrains.kotlin.plugin.compose")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm("desktop")
|
||||
jvm {
|
||||
compilations.all {
|
||||
compilerOptions.configure {
|
||||
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
val desktopMain by getting {
|
||||
val jvmMain by getting {
|
||||
dependencies {
|
||||
implementation(libs.compose.desktop.currentOs)
|
||||
implementation(project(":client:common-ui"))
|
||||
implementation(compose.desktop.currentOs)
|
||||
implementation(compose.material3)
|
||||
implementation(compose.ui)
|
||||
implementation(compose.uiTooling)
|
||||
implementation(libs.ktor.client.cio)
|
||||
implementation(libs.kotlinx.coroutines.swing)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,11 +30,22 @@ kotlin {
|
||||
|
||||
compose.desktop {
|
||||
application {
|
||||
mainClass = "MainKt"
|
||||
mainClass = "at.mocode.client.desktop.MainKt"
|
||||
|
||||
nativeDistributions {
|
||||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
||||
packageName = "MeldestellePro"
|
||||
// targetFormats(Tar, Dmg, Msi) // TODO: Fix TargetFormat import
|
||||
packageName = "Meldestelle Desktop"
|
||||
packageVersion = "1.0.0"
|
||||
|
||||
windows {
|
||||
iconFile.set(project.file("src/jvmMain/resources/icon.ico"))
|
||||
}
|
||||
linux {
|
||||
iconFile.set(project.file("src/jvmMain/resources/icon.png"))
|
||||
}
|
||||
macOS {
|
||||
iconFile.set(project.file("src/jvmMain/resources/icon.icns"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package at.mocode.client.desktop
|
||||
|
||||
import androidx.compose.ui.window.Window
|
||||
import androidx.compose.ui.window.WindowPosition
|
||||
import androidx.compose.ui.window.WindowState
|
||||
import androidx.compose.ui.window.application
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.unit.dp
|
||||
import at.mocode.client.ui.App
|
||||
|
||||
fun main() = application {
|
||||
Window(
|
||||
onCloseRequest = ::exitApplication,
|
||||
title = "Meldestelle Desktop App",
|
||||
state = WindowState(
|
||||
position = WindowPosition(Alignment.Center),
|
||||
width = 800.dp,
|
||||
height = 600.dp
|
||||
)
|
||||
) {
|
||||
// Use the shared App component from common-ui
|
||||
// This eliminates code duplication and ensures consistent UI across platforms
|
||||
App(baseUrl = System.getProperty("meldestelle.api.url", "http://localhost:8080"))
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import androidx.compose.ui.window.Window
|
||||
import androidx.compose.ui.window.application
|
||||
import at.mocode.client.ui.App
|
||||
|
||||
fun main() = application {
|
||||
Window(onCloseRequest = ::exitApplication, title = "MeldestellePro") {
|
||||
// Wir rufen hier exakt dieselbe geteilte App() Composable-Funktion auf.
|
||||
App()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user