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 gitVersionCode = getGitCommitCount()
|
||||||
val gitVersionName = getGVN()
|
val gitVersionName = getGVN()
|
||||||
|
val windowsVersion = getWindowsVersion(gitVersionName)
|
||||||
|
val debianVersion = getDebianVersion(gitVersionName)
|
||||||
val desktopVersionName = getCleanDesktopVersion(gitVersionName)
|
val desktopVersionName = getCleanDesktopVersion(gitVersionName)
|
||||||
kotlin {
|
kotlin {
|
||||||
/*linuxX64 {
|
/*linuxX64 {
|
||||||
|
|
@ -145,15 +147,30 @@ compose.desktop {
|
||||||
nativeDistributions {
|
nativeDistributions {
|
||||||
targetFormats(TargetFormat.Exe, TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
targetFormats(TargetFormat.Exe, TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
|
||||||
packageName = "Feufaro"
|
packageName = "Feufaro"
|
||||||
packageVersion = desktopVersionName
|
packageVersion = windowsVersion/*desktopVersionName*/
|
||||||
jvmArgs("-Dapp.version=$gitVersionName")
|
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")
|
modules("java.base", "java.desktop", "jdk.unsupported", "java.naming")
|
||||||
|
|
||||||
windows {
|
windows {
|
||||||
|
packageVersion = windowsVersion
|
||||||
iconFile.set(project.file("icons/icon.ico"))
|
iconFile.set(project.file("icons/icon.ico"))
|
||||||
|
menuGroup = "Feufaro"
|
||||||
|
perUserInstall = true
|
||||||
|
dirChooser = true
|
||||||
|
shortcut = true
|
||||||
|
menu = true
|
||||||
}
|
}
|
||||||
linux {
|
linux {
|
||||||
|
packageVersion = debianVersion
|
||||||
iconFile.set(project.file("icons/icon-linux.png"))
|
iconFile.set(project.file("icons/icon-linux.png"))
|
||||||
|
shortcut = true
|
||||||
|
appCategory = "AudioVideo"
|
||||||
|
debMaintainer = "feufar.ooo"
|
||||||
}
|
}
|
||||||
buildTypes.release.proguard {
|
buildTypes.release.proguard {
|
||||||
isEnabled.set(false)
|
isEnabled.set(false)
|
||||||
|
|
@ -262,4 +279,24 @@ fun getGVN(): String {
|
||||||
fun getCleanDesktopVersion(versionName: String): String {
|
fun getCleanDesktopVersion(versionName: String): String {
|
||||||
val regex = Regex("""^\d+(\.\d+)*""")
|
val regex = Regex("""^\d+(\.\d+)*""")
|
||||||
return regex.find(versionName)?.value ?: "1.0.0"
|
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 packageName = context.packageName
|
||||||
|
|
||||||
val packageInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
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 {
|
} else {
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
pm.getPackageInfo(packageName, 0)
|
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) {
|
} catch (e: Exception) {
|
||||||
println("AppVersion Error: ${e.message}")
|
"v0.0.0 (build 0)"
|
||||||
e.printStackTrace()
|
|
||||||
"0.0.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,9 +124,9 @@ fun AboutDialog(onDismiss: () -> Unit) {
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
horizontalArrangement = Arrangement.SpaceEvenly
|
horizontalArrangement = Arrangement.SpaceEvenly
|
||||||
) {
|
) {
|
||||||
InfoIconItem(icon = Icons.Default.Language, label = "Site Web")
|
InfoIconItem(icon = Icons.Default.Language, label = "Site Web", onClick = { })
|
||||||
InfoIconItem(icon = Icons.Default.Email, label = "Contact")
|
InfoIconItem(icon = Icons.Default.Email, label = "Contact", onClick = { })
|
||||||
InfoIconItem(icon = Icons.Default.Code, label = "Licence")
|
InfoIconItem(icon = Icons.Default.Code, label = "Licence", onClick = { })
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(24.dp))
|
Spacer(modifier = Modifier.height(24.dp))
|
||||||
|
|
@ -142,12 +142,10 @@ fun AboutDialog(onDismiss: () -> Unit) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun InfoIconItem(icon: ImageVector, label: String) {
|
fun InfoIconItem(icon: ImageVector, label: String, onClick: () -> Unit) {
|
||||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = {
|
onClick = onClick,
|
||||||
|
|
||||||
},
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(48.dp)
|
.size(48.dp)
|
||||||
.background(MaterialTheme.colorScheme.surfaceVariant, CircleShape)
|
.background(MaterialTheme.colorScheme.surfaceVariant, CircleShape)
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,11 @@ fun Settings(
|
||||||
expandedAudio = (target == "Audio")
|
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 {
|
var globalInstrumentProgram by remember {
|
||||||
mutableStateOf(player?.getVoiceInstrument() ?: 1)
|
mutableStateOf(player?.getVoiceInstrument() ?: 1)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ import androidx.compose.runtime.Composable
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
actual fun rememberAppVersion(): String {
|
actual fun rememberAppVersion(): String {
|
||||||
return System.getProperty("jpackage.app-version")
|
val version = System.getProperty("app.version") ?: "0.0.0"
|
||||||
?: System.getProperty("app.version")
|
val build = System.getProperty("app.build") ?: "0"
|
||||||
?: "0.0.0"
|
|
||||||
|
return "$version (build $build)"
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue