Skip to content

Creating OS X Application Bundles And Installers

Dmitry Leskov edited this page Mar 22, 2017 · 1 revision

The plugin supports the creation of OS X application bundles and installers.

To create an OS X application bundle, add the following configuration into the excelsiorJet{} plugin extension:

packaging = 'osx-app-bundle'

Note: if you use the same build.gradle for all three supported platforms (Windows, OS X, and Linux), it is recommended to use another configuration:

packaging = 'native-bundle'

to create Excelsior Installer setups on Windows and Linux and an application bundle and installer on OS X.

To configure the OS X application bundle, you need to add the following configuration section:

osxBundle {
}

The values of most bundle parameters are derived automatically from the other parameters of your build.gradle. The complete list of the parameters can be obtained here.

You still need to tell the plugin where the OS X icon (.icns file) for your bundle is located. Do that using the icon parameter of the osxBundle{} section, or simply place the icon file at <project.projectDir>/src/main/jetresources/icon.icns to let the plugin pick it up automatically.

By default, the plugin will create an OS X application bundle only, but to distribute your application to your customers you probably need to sign it and package as an OS X installer (.pkg file). The plugin enables you to do that using the following parameters within the osxBundle{} section:

  • developerId = developer-identity-certificate - "Developer ID Application" or "Mac App Distribution" certificate name for signing resulting OSX app bundle with codesign tool.
  • publisherId = publisher-identity-certificate - "Developer ID Installer" or "Mac Installer Distribution" certificate name for signing the resulting OS X Installer Package (.pkg file) with the productbuild tool.

If you do not want to expose above parameters via build.gradle, you may pass them as system properties to the gradlew command instead, using the arguments -Dosx.developer.id and -Dosx.publisher.id respectively.

Troubleshooting: If you would like to test the created installer file on the same OS X system on which it was built, you need to first remove the OS X application bundle created by the plugin and located next to the installer. Otherwise, the installer will overwrite that existing OS X application bundle instead of installing the application into the Applications folder.