Browse Source

Normalize all file properties on Windows

Previously the `--output` argument of the jlink task was not normalized.

https://github.com/JetBrains/compose-jb/issues/248
pull/312/head
Alexey Tsvetkov 4 years ago committed by Alexey Tsvetkov
parent
commit
e6fb7463d0
  1. 7
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/cliArgUtils.kt
  2. 2
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJLinkTask.kt
  3. 8
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt

7
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/cliArgUtils.kt

@ -1,5 +1,6 @@
package org.jetbrains.compose.desktop.application.internal package org.jetbrains.compose.desktop.application.internal
import org.gradle.api.file.FileSystemLocation
import org.gradle.api.provider.Provider import org.gradle.api.provider.Provider
import java.io.File import java.io.File
@ -26,7 +27,11 @@ internal fun <T : Any?> MutableCollection<String>.cliArg(
private fun <T : Any?> defaultToString(): (T) -> String = private fun <T : Any?> defaultToString(): (T) -> String =
{ {
val asString = if (it is File) it.normalizedPath() else it.toString() val asString = when (it) {
is FileSystemLocation -> it.asFile.normalizedPath()
is File -> it.normalizedPath()
else -> it.toString()
}
"\"$asString\"" "\"$asString\""
} }

2
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJLinkTask.kt

@ -41,7 +41,7 @@ abstract class AbstractJLinkTask : AbstractJvmToolOperationTask("jlink") {
cliArg("--no-header-files", noHeaderFiles) cliArg("--no-header-files", noHeaderFiles)
cliArg("--no-man-pages", noManPages) cliArg("--no-man-pages", noManPages)
cliArg("--strip-native-commands", stripNativeCommands) cliArg("--strip-native-commands", stripNativeCommands)
cliArg("--compress", compressionLevel.orNull?.id ) cliArg("--compress", compressionLevel.orNull?.id)
cliArg("--output", destinationDir) cliArg("--output", destinationDir)
} }

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

@ -163,12 +163,12 @@ abstract class AbstractJPackageTask @Inject constructor(
cliArg("--input", tmpDir) cliArg("--input", tmpDir)
cliArg("--type", targetFormat.id) cliArg("--type", targetFormat.id)
cliArg("--dest", destinationDir.ioFile) cliArg("--dest", destinationDir)
cliArg("--verbose", verbose) cliArg("--verbose", verbose)
cliArg("--install-dir", installationPath) cliArg("--install-dir", installationPath)
cliArg("--license-file", licenseFile.ioFileOrNull) cliArg("--license-file", licenseFile)
cliArg("--icon", iconFile.ioFileOrNull) cliArg("--icon", iconFile)
cliArg("--name", packageName) cliArg("--name", packageName)
cliArg("--description", packageDescription) cliArg("--description", packageDescription)
@ -200,7 +200,7 @@ abstract class AbstractJPackageTask @Inject constructor(
cliArg("--mac-package-name", macPackageName) cliArg("--mac-package-name", macPackageName)
cliArg("--mac-bundle-signing-prefix", macBundleSigningPrefix) cliArg("--mac-bundle-signing-prefix", macBundleSigningPrefix)
cliArg("--mac-sign", macSign) cliArg("--mac-sign", macSign)
cliArg("--mac-signing-keychain", macSigningKeychain.ioFileOrNull) cliArg("--mac-signing-keychain", macSigningKeychain)
cliArg("--mac-signing-key-user-name", macSigningKeyUserName) cliArg("--mac-signing-key-user-name", macSigningKeyUserName)
} }
OS.Windows -> { OS.Windows -> {

Loading…
Cancel
Save