MacOS .dmg artifact
已回答
Running 2021.3 I have created a .dmg artifact for my JDK 17 modular project that builds and runs very nicely except that I cannot find a way to get my icon file included in the .dmg . Is this possible?
请先登录再写评论。
What IDE functionality do you use to build the .dmg?
I think for this you can check the related Apple documentation.
I used the Artifacts page of Project Settings, specifying an artifact of type 'Platform specific package'. In the .idea/artifacts directory this creates a project .xml file with this element:
<properties id="jpackage-properties">
<options>
<option name="version" value="1.0" />
<option name="copyright" value="" />
<option name="description" value="" />
<option name="vendor" value="" />
<option name="mainClass" value="stuff.Main" />
</options>
</properties>
So I assume jpackage is being used under the hood. I even tried adding an "icon" option manually without success.
I could not find any relevant Apple documentation.
Yes for this option, IDE uses the jpackage tool from the project JDK (for JDKs>= 14 versions). So you can check the jpackage's documentation fro supported options.
Btw have you tried to place the icon into the resources directory?
As I've checked in these threads:
https://stackoverflow.com/a/62229069/2000323
https://github.com/beryx/badass-jlink-plugin/issues/118
it should be possible to set the application and DMG icon using the --icon command line option. Ad using the --resource-dir option to set the .app icon.
Thanks for your effort on this question, but I already have jpackage scripts that work. I was hoping for an IDE based solution, but I think the 'Platform specific package' artifact is not ready for prime time yet. There is no way to set jpackage options in the IDE, so it will need a lot more configurability to be really useful.
Thank you for your feedback. I've filled a request for an enhancement: https://youtrack.jetbrains.com/issue/IDEA-287861 Please vote and feel free to provide your feedback there. Thanks.