|
|
@ -345,30 +345,6 @@ abstract class AbstractJPackageTask @Inject constructor( |
|
|
|
cliArg("--main-jar", mainJarPath) |
|
|
|
cliArg("--main-jar", mainJarPath) |
|
|
|
cliArg("--main-class", launcherMainClass) |
|
|
|
cliArg("--main-class", launcherMainClass) |
|
|
|
|
|
|
|
|
|
|
|
val propertyFilesDirJava = propertyFilesDir.ioFile |
|
|
|
|
|
|
|
fileOperations.clearDirs(propertyFilesDir) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val fileAssociationFiles = fileAssociations.orNull.orEmpty() |
|
|
|
|
|
|
|
.groupBy { it.extension } |
|
|
|
|
|
|
|
.mapValues { (extension, associations) -> |
|
|
|
|
|
|
|
associations.mapIndexed { index, association -> |
|
|
|
|
|
|
|
propertyFilesDirJava.resolve("FA${extension}${if (index > 0) index.toString() else ""}.properties") |
|
|
|
|
|
|
|
.apply { |
|
|
|
|
|
|
|
writeText( |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
mime-type=${association.mimeType} |
|
|
|
|
|
|
|
extension=${association.extension} |
|
|
|
|
|
|
|
description=${association.description} |
|
|
|
|
|
|
|
""".trimIndent() |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}.values.flatten() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (fileAssociationFile in fileAssociationFiles) { |
|
|
|
|
|
|
|
cliArg("--file-associations", fileAssociationFile) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (currentOS == OS.Windows) { |
|
|
|
if (currentOS == OS.Windows) { |
|
|
|
cliArg("--win-console", winConsole) |
|
|
|
cliArg("--win-console", winConsole) |
|
|
|
} |
|
|
|
} |
|
|
@ -402,6 +378,31 @@ abstract class AbstractJPackageTask @Inject constructor( |
|
|
|
cliArg("--license-file", licenseFile) |
|
|
|
cliArg("--license-file", licenseFile) |
|
|
|
cliArg("--resource-dir", jpackageResources) |
|
|
|
cliArg("--resource-dir", jpackageResources) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val propertyFilesDirJava = propertyFilesDir.ioFile |
|
|
|
|
|
|
|
fileOperations.clearDirs(propertyFilesDir) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val fileAssociationFiles = fileAssociations.orNull.orEmpty() |
|
|
|
|
|
|
|
.groupBy { it.extension } |
|
|
|
|
|
|
|
.mapValues { (extension, associations) -> |
|
|
|
|
|
|
|
associations.mapIndexed { index, association -> |
|
|
|
|
|
|
|
propertyFilesDirJava.resolve("FA${extension}${if (index > 0) index.toString() else ""}.properties") |
|
|
|
|
|
|
|
.apply { |
|
|
|
|
|
|
|
writeText( |
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
mime-type=${association.mimeType} |
|
|
|
|
|
|
|
extension=${association.extension} |
|
|
|
|
|
|
|
description=${association.description} |
|
|
|
|
|
|
|
""".trimIndent() |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}.values.flatten() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (fileAssociationFile in fileAssociationFiles) { |
|
|
|
|
|
|
|
cliArg("--file-associations", fileAssociationFile) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
when (currentOS) { |
|
|
|
when (currentOS) { |
|
|
|
OS.Linux -> { |
|
|
|
OS.Linux -> { |
|
|
|
cliArg("--linux-shortcut", linuxShortcut) |
|
|
|
cliArg("--linux-shortcut", linuxShortcut) |
|
|
|