Browse Source

Fix Linux error

pull/4957
zhelenskiy 5 months ago
parent
commit
e4a35b4b4f
  1. 49
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt

49
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt

@ -345,30 +345,6 @@ abstract class AbstractJPackageTask @Inject constructor(
cliArg("--main-jar", mainJarPath)
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) {
cliArg("--win-console", winConsole)
}
@ -402,6 +378,31 @@ abstract class AbstractJPackageTask @Inject constructor(
cliArg("--license-file", licenseFile)
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) {
OS.Linux -> {
cliArg("--linux-shortcut", linuxShortcut)

Loading…
Cancel
Save