formatting changes
This commit is contained in:
1 parent
c71636ad55
commit
3a33f6be15
1 file changed
+35
-16
@@ -12,7 +12,8 @@ val arch = System.getProperty("os.arch") ?: "amd64"
|
|||||||
// CI passes -PappVersion=<version> (release workflow); local builds keep the
|
// CI passes -PappVersion=<version> (release workflow); local builds keep the
|
||||||
// default. jpackage requires a plain semver (no leading "v").
|
// default. jpackage requires a plain semver (no leading "v").
|
||||||
val appVersion = (project.findProperty("appVersion") as? String) ?: "0.1.0"
|
val appVersion = (project.findProperty("appVersion") as? String) ?: "0.1.0"
|
||||||
val desktopTarget = when {
|
val desktopTarget =
|
||||||
|
when {
|
||||||
os.isMacOsX -> if (arch == "aarch64") "macos-arm64" else "macos-x64"
|
os.isMacOsX -> if (arch == "aarch64") "macos-arm64" else "macos-x64"
|
||||||
os.isWindows -> "windows-x64"
|
os.isWindows -> "windows-x64"
|
||||||
else -> if (arch == "aarch64") "linux-arm64" else "linux-x64"
|
else -> if (arch == "aarch64") "linux-arm64" else "linux-x64"
|
||||||
@@ -48,13 +49,15 @@ afterEvaluate {
|
|||||||
|
|
||||||
val jpackageInputDir = layout.buildDirectory.dir("jpackage-input")
|
val jpackageInputDir = layout.buildDirectory.dir("jpackage-input")
|
||||||
|
|
||||||
val fatJar = tasks.register<Jar>("fatJar") {
|
val fatJar =
|
||||||
|
tasks.register<Jar>("fatJar") {
|
||||||
archiveClassifier.set("all")
|
archiveClassifier.set("all")
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
manifest { attributes("Main-Class" to "iris.desktop.MainKt") }
|
manifest { attributes("Main-Class" to "iris.desktop.MainKt") }
|
||||||
from(sourceSets.main.get().output)
|
from(sourceSets.main.get().output)
|
||||||
from({
|
from({
|
||||||
configurations.runtimeClasspath.get()
|
configurations.runtimeClasspath
|
||||||
|
.get()
|
||||||
.filter { it.name.endsWith(".jar") }
|
.filter { it.name.endsWith(".jar") }
|
||||||
.map { zipTree(it) }
|
.map { zipTree(it) }
|
||||||
}) {
|
}) {
|
||||||
@@ -76,23 +79,39 @@ tasks.register<Exec>("jpackage") {
|
|||||||
val jpackageBin = file("${System.getProperty("java.home")}/bin/jpackage")
|
val jpackageBin = file("${System.getProperty("java.home")}/bin/jpackage")
|
||||||
val type = (project.findProperty("jpackageType") as? String) ?: "app-image"
|
val type = (project.findProperty("jpackageType") as? String) ?: "app-image"
|
||||||
val inputDir = jpackageInputDir.get().asFile
|
val inputDir = jpackageInputDir.get().asFile
|
||||||
val destDir = layout.buildDirectory.dir("jpackage").get().asFile
|
val destDir =
|
||||||
|
layout.buildDirectory
|
||||||
|
.dir("jpackage")
|
||||||
|
.get()
|
||||||
|
.asFile
|
||||||
inputs.dir(inputDir)
|
inputs.dir(inputDir)
|
||||||
outputs.dir(destDir)
|
outputs.dir(destDir)
|
||||||
commandLine(
|
commandLine(
|
||||||
if (jpackageBin.exists()) jpackageBin.absolutePath else "jpackage",
|
if (jpackageBin.exists()) jpackageBin.absolutePath else "jpackage",
|
||||||
"--name", "iris",
|
"--name",
|
||||||
"--app-version", appVersion,
|
"iris",
|
||||||
"--vendor", "Iris",
|
"--app-version",
|
||||||
"--type", type,
|
appVersion,
|
||||||
"--input", inputDir.absolutePath,
|
"--vendor",
|
||||||
"--main-jar", "desktopApp-all.jar",
|
"Iris",
|
||||||
"--main-class", "iris.desktop.MainKt",
|
"--type",
|
||||||
"--icon", file("src/main/resources/icon.png").absolutePath,
|
type,
|
||||||
"--dest", destDir.absolutePath,
|
"--input",
|
||||||
"--java-options", "-Xmx1g",
|
inputDir.absolutePath,
|
||||||
|
"--main-jar",
|
||||||
|
"desktopApp-all.jar",
|
||||||
|
"--main-class",
|
||||||
|
"iris.desktop.MainKt",
|
||||||
|
"--icon",
|
||||||
|
file("src/main/resources/icon.png").absolutePath,
|
||||||
|
"--dest",
|
||||||
|
destDir.absolutePath,
|
||||||
|
"--java-options",
|
||||||
|
"-Xmx1g",
|
||||||
// M9: KCEF (JCEF) AWT reflection access (see the JavaExec block above).
|
// M9: KCEF (JCEF) AWT reflection access (see the JavaExec block above).
|
||||||
"--java-options", "--add-opens=java.desktop/sun.awt=ALL-UNNAMED",
|
"--java-options",
|
||||||
"--java-options", "--add-opens=java.desktop/java.awt.peer=ALL-UNNAMED",
|
"--add-opens=java.desktop/sun.awt=ALL-UNNAMED",
|
||||||
|
"--java-options",
|
||||||
|
"--add-opens=java.desktop/java.awt.peer=ALL-UNNAMED",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user