feat: cible desktop macOS via :desktopApp:run
This commit is contained in:
4 files changed
+58
No files matched your search
@@ -27,6 +27,16 @@ Jeu d'entraînement aux tables de multiplication (Kotlin Multiplatform, Android
|
|||||||
|
|
||||||
Ouvrir `iosApp/iosApp.xcodeproj` dans Xcode et lancer le scheme `iosApp` sur un simulateur.
|
Ouvrir `iosApp/iosApp.xcodeproj` dans Xcode et lancer le scheme `iosApp` sur un simulateur.
|
||||||
|
|
||||||
|
### macOS desktop
|
||||||
|
|
||||||
|
Lancer l'application en fenêtre (480×800) depuis le terminal :
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./gradlew :desktopApp:run
|
||||||
|
```
|
||||||
|
|
||||||
|
Les données sont stockées dans `~/.livrets/`.
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -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"
|
||||||
@@ -30,4 +30,5 @@ dependencyResolutionManagement {
|
|||||||
}
|
}
|
||||||
include(":sharedUI")
|
include(":sharedUI")
|
||||||
include(":androidApp")
|
include(":androidApp")
|
||||||
|
include(":desktopApp")
|
||||||
|
|
||||||
Reference in new issue
Block a user