feat: cible desktop macOS via :desktopApp:run
This commit is contained in:
4 files changed
+58
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.compose.compiler)
|
||||
alias(libs.plugins.compose.multiplatform)
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions { jvmTarget.set(JvmTarget.JVM_17) }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":sharedUI"))
|
||||
implementation(compose.desktop.currentOs)
|
||||
}
|
||||
|
||||
compose.desktop {
|
||||
application {
|
||||
mainClass = "com.livrets.desktop.MainKt"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.livrets.desktop
|
||||
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.Window
|
||||
import androidx.compose.ui.window.application
|
||||
import androidx.compose.ui.window.rememberWindowState
|
||||
import com.livrets.App
|
||||
|
||||
fun main() = application {
|
||||
Window(
|
||||
onCloseRequest = ::exitApplication,
|
||||
title = "Livrets",
|
||||
state = rememberWindowState(width = 480.dp, height = 800.dp),
|
||||
) {
|
||||
App(filesDirPath = storageDir())
|
||||
}
|
||||
}
|
||||
|
||||
private fun storageDir(): String =
|
||||
System.getProperty("user.home") + "/.livrets"
|
||||
Reference in new issue
Block a user