RFR: 8351095: [macos] Add more jpackage tests for --mac-app-store option

Alexander Matveev almatvee at openjdk.org
Tue Nov 25 19:03:09 UTC 2025


On Tue, 25 Nov 2025 17:24:26 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:

>> Added following tests:
>> - Verify mac app store PKG doesn't have scripts (added to `PkgScriptsTest.java`).
>> - `--launcher-as-service` ignored for mac app store PKG  (added to `ServiceTest.java`).
>> - `--launcher-as-service` for additional launcher ignored for mac app store PKG (added to `ServiceTest.java`).
>
> test/jdk/tools/jpackage/share/ServiceTest.java line 229:
> 
>> 227:             appImageCmd.cmd().orElseThrow().addArgument("--mac-app-store");
>> 228:         }
>> 229: 
> 
> Why do we need this option for an app image?

Without it jpackage will add launchers as a service even if `--mac-app-store` is specified for PKG. I do not think it is a bug. jpackage takes `--mac-app-store` value from predefined app image. Specifying it when generating PKG at line 265 is not needed and was added to make `cmd.hasArgument("--mac-app-store")` work. Maybe we need another approach and add isMacAppStore() function somewhere which will check predefined app image or `cmd.hasArgument("--mac-app-store")` to figure out if we generating for Mac App Store.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28487#discussion_r2561089855


More information about the core-libs-dev mailing list