Browse Source

Avoid adding incompatible arguments when creating application image

Fixes https://github.com/JetBrains/compose-jb/issues/296
pull/315/head
Alexey Tsvetkov 4 years ago committed by Alexey Tsvetkov
parent
commit
abb4a5a411
  1. 36
      gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt
  2. 23
      gradle-plugins/compose/src/test/test-projects/application/jvm/build.gradle

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

@ -166,8 +166,10 @@ abstract class AbstractJPackageTask @Inject constructor(
cliArg("--dest", destinationDir)
cliArg("--verbose", verbose)
cliArg("--install-dir", installationPath)
cliArg("--license-file", licenseFile)
if (targetFormat != TargetFormat.AppImage) {
cliArg("--install-dir", installationPath)
cliArg("--license-file", licenseFile)
}
cliArg("--icon", iconFile)
cliArg("--name", packageName)
@ -187,13 +189,15 @@ abstract class AbstractJPackageTask @Inject constructor(
when (currentOS) {
OS.Linux -> {
cliArg("--linux-shortcut", linuxShortcut)
cliArg("--linux-package-name", linuxPackageName)
cliArg("--linux-app-release", linuxAppRelease)
cliArg("--linux-app-category", linuxAppCategory)
cliArg("--linux-deb-maintainer", linuxDebMaintainer)
cliArg("--linux-menu-group", linuxMenuGroup)
cliArg("--linux-rpm-license-type", linuxRpmLicenseType)
if (targetFormat != TargetFormat.AppImage) {
cliArg("--linux-shortcut", linuxShortcut)
cliArg("--linux-package-name", linuxPackageName)
cliArg("--linux-app-release", linuxAppRelease)
cliArg("--linux-app-category", linuxAppCategory)
cliArg("--linux-deb-maintainer", linuxDebMaintainer)
cliArg("--linux-menu-group", linuxMenuGroup)
cliArg("--linux-rpm-license-type", linuxRpmLicenseType)
}
}
OS.MacOS -> {
cliArg("--mac-package-identifier", macPackageIdentifier)
@ -205,12 +209,14 @@ abstract class AbstractJPackageTask @Inject constructor(
}
OS.Windows -> {
cliArg("--win-console", winConsole)
cliArg("--win-dir-chooser", winDirChooser)
cliArg("--win-per-user-install", winPerUserInstall)
cliArg("--win-shortcut", winShortcut)
cliArg("--win-menu", winMenu)
cliArg("--win-menu-group", winMenuGroup)
cliArg("--win-upgrade-uuid", winUpgradeUuid)
if (targetFormat != TargetFormat.AppImage) {
cliArg("--win-dir-chooser", winDirChooser)
cliArg("--win-per-user-install", winPerUserInstall)
cliArg("--win-shortcut", winShortcut)
cliArg("--win-menu", winMenu)
cliArg("--win-menu-group", winMenuGroup)
cliArg("--win-upgrade-uuid", winUpgradeUuid)
}
}
}

23
gradle-plugins/compose/src/test/test-projects/application/jvm/build.gradle

@ -23,8 +23,29 @@ compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
version = "1.0"
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
version = "1.0"
packageName = "TestPackage"
description = "Test description"
copyright = "Test Copyright Holder"
vendor = "Test Vendor"
linux {
shortcut = true
packageName = "compose"
debMaintainer = "example@example.com"
menuGroup = "menu-group"
}
windows {
console = true
dirChooser = true
perUserInstall = true
shortcut = true
menu = true
menuGroup = "compose"
upgradeUuid = "2d6ff464-75be-40ad-a256-56420b9cc374"
}
}
}
}

Loading…
Cancel
Save