Add App version in the admin screen.
This commit is contained in:
parent
193b0d85d5
commit
05cc533cbf
4 changed files with 31 additions and 4 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import com.codingfeline.buildkonfig.compiler.FieldSpec.Type.STRING
|
||||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
||||
|
||||
plugins {
|
||||
|
|
@ -5,8 +6,11 @@ plugins {
|
|||
alias(libs.plugins.composeMultiplatform)
|
||||
alias(libs.plugins.kotlinMultiplatform)
|
||||
alias(libs.plugins.kotlinSerialization)
|
||||
alias(libs.plugins.buildkonfig)
|
||||
}
|
||||
|
||||
fun getVersion() = "1.3.0"
|
||||
|
||||
kotlin {
|
||||
jvm("desktop")
|
||||
|
||||
|
|
@ -59,6 +63,14 @@ kotlin {
|
|||
}
|
||||
}
|
||||
|
||||
buildkonfig {
|
||||
packageName = "com.pixelized.desktop.lwa"
|
||||
|
||||
defaultConfigs {
|
||||
buildConfigField(STRING, "version", getVersion())
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/JetBrains/compose-multiplatform/blob/master/tutorials/Native_distributions_and_local_execution/README.md#basic-usage
|
||||
compose.desktop {
|
||||
application {
|
||||
|
|
@ -68,7 +80,7 @@ compose.desktop {
|
|||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
||||
|
||||
packageName = "Table de Lwa"
|
||||
packageVersion = "1.3.0"
|
||||
packageVersion = getVersion()
|
||||
description = "Application de support au jeux de rôle dans l'univers de Lwa."
|
||||
copyright = "© 2020 Pixelized. All rights reserved."
|
||||
vendor = "Pixelized"
|
||||
|
|
|
|||
|
|
@ -231,6 +231,7 @@
|
|||
<string name="level_up__skill_level">niv : %1$d -</string>
|
||||
|
||||
<string name="game_master__title">Admin</string>
|
||||
<string name="game_master__version">version : %1$s</string>
|
||||
<string name="game_master__action">GameMaster</string>
|
||||
<string name="game_master__action__save">Sauvegarder</string>
|
||||
<string name="game_master__character__filter">Filtrer par nom :</string>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import androidx.compose.ui.unit.dp
|
|||
import androidx.navigation.NavHostController
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.pixelized.desktop.lwa.BuildKonfig
|
||||
import com.pixelized.desktop.lwa.ui.navigation.screen.destination.gamemaster.GMActionDestination
|
||||
import com.pixelized.desktop.lwa.ui.navigation.screen.destination.gamemaster.composableGameMasterActionPage
|
||||
import com.pixelized.desktop.lwa.ui.navigation.screen.destination.gamemaster.composableGameMasterAlterationEditPage
|
||||
|
|
@ -44,6 +45,7 @@ import com.pixelized.desktop.lwa.ui.theme.lwa
|
|||
import lwacharactersheet.composeapp.generated.resources.Res
|
||||
import lwacharactersheet.composeapp.generated.resources.game_master__action
|
||||
import lwacharactersheet.composeapp.generated.resources.game_master__title
|
||||
import lwacharactersheet.composeapp.generated.resources.game_master__version
|
||||
import org.jetbrains.compose.resources.stringResource
|
||||
import org.koin.compose.viewmodel.koinViewModel
|
||||
|
||||
|
|
@ -83,9 +85,19 @@ private fun GameMasterContent(
|
|||
topBar = {
|
||||
TopAppBar(
|
||||
title = {
|
||||
Text(
|
||||
text = stringResource(Res.string.game_master__title),
|
||||
)
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(space = 4.dp),
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier.alignByBaseline(),
|
||||
text = stringResource(Res.string.game_master__title),
|
||||
)
|
||||
Text(
|
||||
modifier = Modifier.alignByBaseline(),
|
||||
style = MaterialTheme.lwa.typography.base.caption,
|
||||
text = stringResource(Res.string.game_master__version, BuildKonfig.version),
|
||||
)
|
||||
}
|
||||
},
|
||||
actions = {
|
||||
Row(
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ turtle = "0.10.0"
|
|||
logback = "1.5.17"
|
||||
coil = "3.1.0"
|
||||
ui-graphics-android = "1.7.8"
|
||||
buildkonfig = "0.17.0"
|
||||
|
||||
[plugins]
|
||||
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }
|
||||
|
|
@ -19,6 +20,7 @@ kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
|||
kotlinSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
||||
ktor = { id = "io.ktor.plugin", version.ref = "ktor" }
|
||||
buildkonfig = { id = "com.codingfeline.buildkonfig", version.ref = "buildkonfig" }
|
||||
|
||||
[libraries]
|
||||
# Test & preview
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue