Fix instruments list order - Windows & configure nativeDist, windows installer, build number "v1.0.0 (build ..)"
This commit is contained in:
parent
fffb24ad30
commit
5bdd9fd711
5 changed files with 68 additions and 19 deletions
|
|
@ -14,6 +14,8 @@ plugins {
|
|||
|
||||
val gitVersionCode = getGitCommitCount()
|
||||
val gitVersionName = getGVN()
|
||||
val windowsVersion = getWindowsVersion(gitVersionName)
|
||||
val debianVersion = getDebianVersion(gitVersionName)
|
||||
val desktopVersionName = getCleanDesktopVersion(gitVersionName)
|
||||
kotlin {
|
||||
/*linuxX64 {
|
||||
|
|
@ -145,15 +147,30 @@ compose.desktop {
|
|||
nativeDistributions {
|
||||
targetFormats(TargetFormat.Exe, TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
||||
packageName = "Feufaro"
|
||||
packageVersion = desktopVersionName
|
||||
jvmArgs("-Dapp.version=$gitVersionName")
|
||||
packageVersion = windowsVersion/*desktopVersionName*/
|
||||
description = "L'application pour lire, éditer et analyser vos partitions Solfa. Ecrivez et créez des harmonies, écoutez ses mélodies et organisez votre playlist en toute simplicité."
|
||||
copyright = "© 2025 dot.mg"
|
||||
vendor = "dotMG Feufarooo"
|
||||
jvmArgs("-Dapp.version=$gitVersionName",
|
||||
"-Dapp.build=$gitVersionCode"
|
||||
)
|
||||
modules("java.base", "java.desktop", "jdk.unsupported", "java.naming")
|
||||
|
||||
windows {
|
||||
packageVersion = windowsVersion
|
||||
iconFile.set(project.file("icons/icon.ico"))
|
||||
menuGroup = "Feufaro"
|
||||
perUserInstall = true
|
||||
dirChooser = true
|
||||
shortcut = true
|
||||
menu = true
|
||||
}
|
||||
linux {
|
||||
packageVersion = debianVersion
|
||||
iconFile.set(project.file("icons/icon-linux.png"))
|
||||
shortcut = true
|
||||
appCategory = "AudioVideo"
|
||||
debMaintainer = "feufar.ooo"
|
||||
}
|
||||
buildTypes.release.proguard {
|
||||
isEnabled.set(false)
|
||||
|
|
@ -263,3 +280,23 @@ fun getCleanDesktopVersion(versionName: String): String {
|
|||
val regex = Regex("""^\d+(\.\d+)*""")
|
||||
return regex.find(versionName)?.value ?: "1.0.0"
|
||||
}
|
||||
|
||||
fun getWindowsVersion(rawVersion: String): String {
|
||||
val cleanVersion = rawVersion.trimStart('v', 'V')
|
||||
val numbers = Regex("""\d+""").findAll(cleanVersion).map { it.value.toLong() }.toList()
|
||||
val major = numbers.getOrNull(0)?.coerceIn(0, 255) ?: 1
|
||||
val minor = numbers.getOrNull(1)?.coerceIn(0, 255) ?: 0
|
||||
val build = gitVersionCode.coerceIn(0, 65535)
|
||||
|
||||
return "$major.$minor.$build"
|
||||
}
|
||||
|
||||
fun getDebianVersion(rawVersion: String): String {
|
||||
var clean = rawVersion.trimStart('v', 'V')
|
||||
clean = clean.replace(Regex("""[^a-zA-Z0-9.\+\-~]"""), "-")
|
||||
if (clean.isEmpty() || !clean.first().isDigit()) {
|
||||
clean = "0.$clean".trimEnd('.')
|
||||
}
|
||||
|
||||
return clean
|
||||
}
|
||||
|
|
@ -16,17 +16,26 @@ actual fun rememberAppVersion(): String {
|
|||
val packageName = context.packageName
|
||||
|
||||
val packageInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
pm.getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(0))
|
||||
pm.getPackageInfo(
|
||||
packageName,
|
||||
PackageManager.PackageInfoFlags.of(0)
|
||||
)
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
pm.getPackageInfo(packageName, 0)
|
||||
}
|
||||
|
||||
packageInfo.versionName ?: "0.0.0"
|
||||
val versionName = packageInfo.versionName ?: "0.0.0"
|
||||
val build = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
packageInfo.longVersionCode
|
||||
} else {
|
||||
@Suppress("DEPRECATION")
|
||||
packageInfo.versionCode.toLong()
|
||||
}
|
||||
|
||||
"$versionName (build $build)"
|
||||
} catch (e: Exception) {
|
||||
println("AppVersion Error: ${e.message}")
|
||||
e.printStackTrace()
|
||||
"0.0.0"
|
||||
"v0.0.0 (build 0)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -124,9 +124,9 @@ fun AboutDialog(onDismiss: () -> Unit) {
|
|||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceEvenly
|
||||
) {
|
||||
InfoIconItem(icon = Icons.Default.Language, label = "Site Web")
|
||||
InfoIconItem(icon = Icons.Default.Email, label = "Contact")
|
||||
InfoIconItem(icon = Icons.Default.Code, label = "Licence")
|
||||
InfoIconItem(icon = Icons.Default.Language, label = "Site Web", onClick = { })
|
||||
InfoIconItem(icon = Icons.Default.Email, label = "Contact", onClick = { })
|
||||
InfoIconItem(icon = Icons.Default.Code, label = "Licence", onClick = { })
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
|
|
@ -142,12 +142,10 @@ fun AboutDialog(onDismiss: () -> Unit) {
|
|||
}
|
||||
|
||||
@Composable
|
||||
fun InfoIconItem(icon: ImageVector, label: String) {
|
||||
fun InfoIconItem(icon: ImageVector, label: String, onClick: () -> Unit) {
|
||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
||||
IconButton(
|
||||
onClick = {
|
||||
|
||||
},
|
||||
onClick = onClick,
|
||||
modifier = Modifier
|
||||
.size(48.dp)
|
||||
.background(MaterialTheme.colorScheme.surfaceVariant, CircleShape)
|
||||
|
|
|
|||
|
|
@ -82,7 +82,11 @@ fun Settings(
|
|||
expandedAudio = (target == "Audio")
|
||||
}
|
||||
|
||||
val instruments = remember { player?.getAvalaibleInstruments() ?: emptyList() }
|
||||
val instruments = remember {
|
||||
(player?.getAvalaibleInstruments() ?: emptyList())
|
||||
.distinctBy { it.program }
|
||||
.sortedBy { it.program }
|
||||
}
|
||||
var globalInstrumentProgram by remember {
|
||||
mutableStateOf(player?.getVoiceInstrument() ?: 1)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ import androidx.compose.runtime.Composable
|
|||
|
||||
@Composable
|
||||
actual fun rememberAppVersion(): String {
|
||||
return System.getProperty("jpackage.app-version")
|
||||
?: System.getProperty("app.version")
|
||||
?: "0.0.0"
|
||||
val version = System.getProperty("app.version") ?: "0.0.0"
|
||||
val build = System.getProperty("app.build") ?: "0"
|
||||
|
||||
return "$version (build $build)"
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue