An ant task which creates a Mac OS X Application Bundle for a Java
application.
- dir
- The directory into which to put the new application bundle.
- name
- The name of the application bundle. Note that the maximum length of this
name is 16 characters, and it will be silently cropped if it is longer than
this.
- mainclass
- The main Java class to call when running the application.
One of the following three MUST be used:
- jars Space or comma-separated list of JAR files to include.; OR
- One or more nested <jarfileset>s. These are normal ANT FileSets;
OR
- One or more nested <jarfilelist>s. These are standard ANT
FileLists.
Optional attributes:
The following attributes are not required, but you can use them to override
default behavior.
- verbose
- If true, show more verbose output while running the task
- version
- Version information about your application (e.g., "1.0")
- infostring
- String to show in the "Get Info" dialog
These attributes control the fine-tuning of the "Mac OS X" look and feel.
- arguments
- Command line arguments. (no default)
- smalltabs
- Use small tabs. (default "false") Deprecated under JVM 1.4.1
- antialiasedgraphics
- Use anti-aliased graphics (default "false")
- antialiasedtext
- Use anti-aliased text (default "false")
- bundleid
- Unique identifier for this bundle, in the form of a Java package. No
default.
- buildnumber
- Unique identifier for this build
- developmentregion
- Development Region. Default "English".
- execs
- Files to be copied into "Resources/MacOS" and made executable
- liveresize
- Use "Live resizing" (default "false") Deprecated under JVM 1.4.1
- growbox
- Show growbox (default "true")
- growboxintrudes
- Intruding growbox (default "false") Deprecated under JVM 1.4.1
- screenmenu
- Put swing menu into Mac OS X menu bar.
- type
- Bundle type (default "APPL")
- signature
- Bundle Signature (default "????")
- stubfile
- The Java Application Stub file to copy for your application (default
MacOS system stub file)
Rarely used optional attributes.
- chmod
- Full path to the chmod command. This almost certainly does NOT need to
be set.
The task also supports nested <execfileset> and/or <execfilelist>
elements, and <resourcefileset> and/or <resourcefilelist>
elements, which are standard Ant FileSet and FileList elements. In the first
case, the referenced files are copied to the Contents/MacOS
directory and made executable, and in the second they are copied to the
Contents/Resources directory and not made executable. If you
winrces, note that in fact the files are installed in locations which have
the same relation to the Contents/Resources directory as the
files in the FileSet or FileList have to the 'dir' attribute. Thus in the
case:
<resourcefileset dir="builddir/architectures"
includes="ppc/*.jnilib"/>
the *.jnilib files will be installed in
Contents/Resources/ppc .
The task supports a nested <javaproperty> element, which allows you to
specify further properties which are set for the JVM when the application is
launched. This takes a required key attribute, giving the
property key, plus an attribute giving the property value, which may be one
of value , giving the string value of the property,
file , setting the value of the property to be the absolute
path of the given file, or path , which sets the value to the
given path. If you are setting paths here, recall that, within the bundle,
$APP_PACKAGE is set to the root directory of the bundle (ie,
the path to the foo.app directory), and $JAVAROOT
to the directory Contents/Resources/Java .
Minimum example:
<jarbundler dir="release" name="Bar Project" mainclass="org.bar.Main"
jars="bin/Bar.jar" />
Using Filesets
<jarbundler dir="release" name="Bar Project" mainclass="org.bar.Main">
<jarfileset dir="bin">
<include name="*.jar" />
<exclude name="test.jar" />
</jarfileset>
<execfileset dir="execs">
<include name="**" />
</execfileset>
</jarbundler>
Much Longer example:
<jarbundler dir="release"
name="Foo Project"
mainclass="org.bar.Main"
version="1.0 b 1"
infostring="Foo Project (c) 2002"
type="APPL"
jars="bin/foo.jar bin/bar.jar"
execs="exec/foobar"
signature="????"
workingdirectory="temp"
icon="resources/foo.icns"
jvmversion="1.4.1+"
vmoptions="-Xmx256m"/>
http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/
|