chore: auto-increment windows installer versions for debug builds
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/push/docs Pipeline was successful

This commit is contained in:
Johannes Frohnmeyer 2024-07-10 10:59:26 +02:00
parent 6d063c0d7e
commit d75e47a864
Signed by: Johannes
GPG Key ID: E76429612C2929F4

View File

@ -66,6 +66,16 @@ tasks.suggestMergedModuleInfo { dependsOn(verifyFlavorConfiguration) }
tasks.jpackageImage { dependsOn(verifyFlavorConfiguration) }
tasks.jpackage { dependsOn(verifyFlavorConfiguration) }
fun computeDebugVersion(): String {
val time = System.currentTimeMillis() / 1000 / 60 / 5 // 5 minute intervals
// installer versions MUST be [0-255].[0-255].[0-65535]
// in other words, 8,8,16 bits
val major = (time / (256 * 65536))
val minor = (time / 65536) % 256
val patch = time % 65536
return "$major.$minor.$patch"
}
if (crosscompile) System.setProperty("badass.jlink.jpackage.home", "/root/jpackage-win")
jlink {
if (crosscompile) javaHome.set("/root/jpackage-win")
@ -97,13 +107,15 @@ jlink {
))
}
"windows" -> {
val release = project.hasProperty("release")
installerType = "msi"
installerOptions.addAll(listOf(
"--win-per-user-install",
"--win-dir-chooser",
"--win-menu",
"--win-upgrade-uuid", "180becd8-a867-40d4-86ef-20949cae68b5" // Update this UUID if you fork the project!!!
"--win-upgrade-uuid", if (release) "3cda7403-4c00-4f9f-bcc3-6ff304566633" else "180becd8-a867-40d4-86ef-20949cae68b5" // Update these UUIDs if you fork the project!!!
))
if (!release) appVersion = computeDebugVersion()
//imageOptions.add("--win-console") // Enable this for debugging
}
else -> {