Browse Source

Escape resources dir separator on Windows (#1005)

Resolves #999
pull/1037/head
Alexey Tsvetkov 3 years ago committed by GitHub
parent
commit
7870d665c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt

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

@ -232,8 +232,14 @@ abstract class AbstractJPackageTask @Inject constructor(
private val libsMapping = FilesMapping() private val libsMapping = FilesMapping()
override fun makeArgs(tmpDir: File): MutableList<String> = super.makeArgs(tmpDir).apply { override fun makeArgs(tmpDir: File): MutableList<String> = super.makeArgs(tmpDir).apply {
fun appDir(vararg pathParts: String): String = fun appDir(vararg pathParts: String): String {
listOf("${'$'}APPDIR", *pathParts).joinToString(File.separator) { it } /** For windows we need to pass '\\' to jpackage file, each '\' need to be escaped.
Otherwise '$APPDIR\resources' is passed to jpackage,
and '\r' is treated as a special character at run time.
*/
val separator = if (currentTarget.os == OS.Windows) "\\\\" else "/"
return listOf("${'$'}APPDIR", *pathParts).joinToString(separator) { it }
}
if (targetFormat == TargetFormat.AppImage || appImage.orNull == null) { if (targetFormat == TargetFormat.AppImage || appImage.orNull == null) {
// Args, that can only be used, when creating an app image or an installer w/o --app-image parameter // Args, that can only be used, when creating an app image or an installer w/o --app-image parameter

Loading…
Cancel
Save