## AppBundler

### Description

Generates a native launcher for a Java application.

### Parameters

Attribute | Description | Required
outputdirectory | The output folder for the generated bundle. | Yes
name | The name of the application. Corresponds to the `CFBundleName` key in the `Info.plist` file. | Yes
displayname | The display name of the application. Corresponds to the `CFBundleDisplayName` key in the `Info.plist` file. | Yes
identifier | An identifier string that specifies the application type. Corresponds to the `CFBundleIdentifier` key in the `Info.plist` file. | Yes
icon | The icon file for the application. Corresponds to the `CFBundleIconFile` key in the `Info.plist` file. | No
shortversion | The release version number string for the application. Corresponds to the `CFBundleShortVersionString` key in the `Info.plist` file. | No
signature | The four-letter code identifying the application creator. Corresponds to the `CFBundleSignature` key in the `Info.plist` file. | No
copyright | The copyright notice for the application. Corresponds to the `NSHumanReadableCopyright` key in the `Info.plist` file. | No
applicationCategory | The application category. Corresponds to the `LSApplicationCategoryType` key in the `Info.plist` file. | No
mainclassname | The name of the bundled application's main class. | Yes

### Parameters specified as nested elements

#### runtime

A fileset representing the Java runtime environment to embed in the application.

This element is optional. If specified, the base directory of the fileset must point to the root directory of a valid Java runtime environment. The contents of the runtime will be copied to the `Contents/PlugIns/` folder of the generated application bundle.

By default, only the contents of the `jre/` directory will be included with the bundled application. All executable content (i.e. `bin/`, `jre/bin/`) is excluded. Additional content can be included or excluded using nested `<include>` and `<exclude>` elements, respectively.

If this element is omitted, a Java runtime environment will not be copied into the generated bundle, and target systems must have a shared JRE installed in `/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/` in order to run the application.

#### classpath

A fileset representing the class path of the bundled application. Corresponds to the `java.class.path` system property. Entries will be copied to the `Contents/Java/` folder of the generated bundle.

#### librarypath

A fileset representing the library path of the bundled application. Corresponds to the `java.library.path` system property. Entries will be copied to the `Contents/MacOS/` folder of the generated bundle.

#### option

Specifies a command-line option to be passed to the JVM at startup.

Attribute | Description | Required
value | The option value. | Yes

#### argument

Specifies a command-line argument to be passed to the bundled application at startup.

Attribute | Description | Required
value | The argument value. | Yes

### Examples

Generate a launcher for the "Swing Set" demo, bundling the JRE defined by the `JAVA_HOME` environment variable with the resulting executable.

    <-- Import environment variables -->
    <property environment="env"/>

    <-- Define the appbundler task -->
    <taskdef name="bundleapp" classname="com.oracle.appbundler.AppBundlerTask"/>

    <-- Create the app bundle -->
    <target name="bundle-swingset" depends="package">
        <bundleapp outputdirectory="."
            name="SwingSet2"
            displayname="SwingSet 2"
            identifier="com.oracle.javax.swing.SwingSet2"
            shortversion="1.0"
            applicationCategory="public.app-category.developer-tools"
            mainclassname="SwingSet2">
            <runtime dir="${env.JAVA_HOME}"/>
            <classpath file="/Library/Java/Demos/JFC/SwingSet2/SwingSet2.jar"/>
            <option value="-Dapple.laf.useScreenMenuBar=true"/>
        </bundleapp>
    </target>