beryx / badass-jlink-plugin

Create a custom runtime image of your modular application
https://badass-jlink-plugin.beryx.org
Apache License 2.0
378 stars 25 forks source link

Icon for the shortcut in system menu is the default (duke) icon #235

Closed showbags closed 11 months ago

showbags commented 1 year ago

It looks as though the icon specified in the jpackage section is ignored. Consequently duke shows up as the icon regardless of what is specified.

showbags commented 1 year ago

I don't seem to be able to create a branch to address this issue. Nor does github allow me to upload a patch file here. Here is a patch which resolves this issue:

Index: src/main/groovy/org/beryx/jlink/impl/JPackageTaskImpl.groovy
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/main/groovy/org/beryx/jlink/impl/JPackageTaskImpl.groovy b/src/main/groovy/org/beryx/jlink/impl/JPackageTaskImpl.groovy
--- a/src/main/groovy/org/beryx/jlink/impl/JPackageTaskImpl.groovy  (revision f293e39fcf481e755a03ab7267f6fe55657bcaaf)
+++ b/src/main/groovy/org/beryx/jlink/impl/JPackageTaskImpl.groovy  (revision 7b7e07795a5705ac8421189ce6cb5815df3bcb7d)
@@ -88,6 +88,7 @@

                 final def resourceDir = jpd.resourceDir
                 final def resourceOpts = (resourceDir == null) ? [] : [ '--resource-dir', resourceDir ]
+                final def iconOpts = jpd.icon ? [ '--icon', jpd.icon ] : []

                 commandLine = [jpackageExec,
                                '--type', packageType,
@@ -97,7 +98,8 @@
                                *vendorOpts,
                                '--app-image', "$appImagePath",
                                *resourceOpts,
-                               *jpd.installerOptions]
+                               *jpd.installerOptions,
+                               *iconOpts]
             }
             if(result.exitValue != 0) {
                 LOGGER.error(project.ext.jpackageInstallerOutput())
airsquared commented 11 months ago

Fixed in v3.0.0.