chore: auto-increment windows installer versions for debug builds
This commit is contained in:
parent
6d063c0d7e
commit
d75e47a864
@ -66,6 +66,16 @@ tasks.suggestMergedModuleInfo { dependsOn(verifyFlavorConfiguration) }
|
|||||||
tasks.jpackageImage { dependsOn(verifyFlavorConfiguration) }
|
tasks.jpackageImage { dependsOn(verifyFlavorConfiguration) }
|
||||||
tasks.jpackage { 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")
|
if (crosscompile) System.setProperty("badass.jlink.jpackage.home", "/root/jpackage-win")
|
||||||
jlink {
|
jlink {
|
||||||
if (crosscompile) javaHome.set("/root/jpackage-win")
|
if (crosscompile) javaHome.set("/root/jpackage-win")
|
||||||
@ -97,13 +107,15 @@ jlink {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
"windows" -> {
|
"windows" -> {
|
||||||
|
val release = project.hasProperty("release")
|
||||||
installerType = "msi"
|
installerType = "msi"
|
||||||
installerOptions.addAll(listOf(
|
installerOptions.addAll(listOf(
|
||||||
"--win-per-user-install",
|
"--win-per-user-install",
|
||||||
"--win-dir-chooser",
|
"--win-dir-chooser",
|
||||||
"--win-menu",
|
"--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
|
//imageOptions.add("--win-console") // Enable this for debugging
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
|
Loading…
Reference in New Issue
Block a user