net.sourceforge.jarbundler
public class JarBundler extends MatchingTask
An ant task which creates a Mac OS X Application Bundle for a Java application.
One of the following three MUST be used:
Optional attributes:
The following attributes are not required, but you can use them to override default behavior.
Rarely used optional attributes.
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/
Method Summary | |
---|---|
void | addConfiguredDocumentType(DocumentType documentType) |
void | addConfiguredHelpBook(HelpBook helpBook) |
void | addConfiguredJavaProperty(JavaProperty javaProperty)
Nested tasks - new tasks with custom attributes
|
void | addConfiguredService(Service service) |
void | addExecfilelist(FileList fl) |
void | addExecfileset(FileSet fs) |
void | addExtraclasspathfilelist(FileList fl) |
void | addExtraclasspathfileset(FileSet fs) |
void | addJarfilelist(FileList fl) |
void | addJarfileset(FileSet fs)
Nested tasks - derived from FileList and FileSet
|
void | addJavafilelist(FileList fl) |
void | addJavafileset(FileSet fs) |
void | addResourcefilelist(FileList fl) |
void | addResourcefileset(FileSet fs) |
void | execute()
The method executing the task |
void | setAboutmenuname(String s)
Setter for the "aboutmenuname" attribute (optional) |
void | setAntialiasedgraphics(boolean b)
Setter for the "antialiasedgraphics" attribute (optional) |
void | setAntialiasedtext(boolean b)
Setter for the "antialiasedtext" attribute (optional) |
void | setArguments(String s)
Arguments to the
|
void | setBuild(String s)
Setter for the "buildnumber" attribute (optional) This key specifies the
exact build version of the bundle. |
void | setBundleid(String s)
Setter for the "bundleid" attribute (optional) This key specifies a
unique identifier string for the bundle. |
void | setChmod(String s)
Set the 'chmod' executable. |
void | setDevelopmentregion(String s)
Setter for the "developmentregion" attribute(optional) Default "English". |
void | setDir(File f)
Setter for the "dir" attribute (required) |
void | setExecs(String s)
Setter for the "execs" attribute (optional) |
void | setExtraclasspath(String s)
Setter for the "extraclasspath" attribute (optional) |
void | setGrowbox(boolean b)
Setter for the "growbox" attribute (optional) |
void | setGrowboxintrudes(boolean b)
Setter for the "growboxintrudes" attribute (optional) |
void | setHelpBookFolder(String s) |
void | setHelpBookName(String s) |
void | setIcon(File f)
Setter for the "icon" attribute (optional) |
void | setInfoString(String s)
Setter for the "infostring" attribute (optional) This key identifies a
human-readable plain text string displaying the copyright information for
the bundle. |
void | setJar(File s)
Setter for the "jar" attribute (required if no "jarfileset" is present) |
void | setJars(String s)
Setter for the "jars" attribute (required if no "jarfileset" is present) |
void | setJvmversion(String s)
Setter for the "jvmversion" attribute (optional) |
void | setLiveresize(boolean b)
Setter for the "liveresize" attribute (optional) |
void | setMainClass(String s)
Setter for the "mainclass" attribute (required) |
void | setName(String s)
Setter for the "name" attribute (required) This attribute names the
output application bundle and asks as the CFBundleName if 'bundlename' is
not specified |
void | setScreenmenu(boolean b)
Setter for the "screenmenu" attribute (optional) |
void | setShortInfoString(String s)
Setter for the "shortinfostring" attribute (optional) This key identifies
the marketing version of the bundle. |
void | setShortName(String s)
Setter for the "shortname" attribute (optional) This key identifies the
short name of the bundle. |
void | setShowPlist(boolean showPlist) |
void | setSignature(String s)
Setter for the "signature" attribute (optional) |
void | setSmallTabs(boolean b)
Setter for the "smalltabs" attribute (optional) |
void | setSplashFile(String s)
Setter for the "splashfile" attribute (optional). |
void | setStartonmainthread(boolean b)
Setter for the "startonmainthread" attribute (optional) |
void | setStubFile(File file)
Override the stub file path to build on non-MacOS platforms
|
void | setType(String s)
Setter for the "type" attribute (optional) |
void | setVerbose(boolean verbose)
Setter for the "verbose" attribute (optional) |
void | setVersion(String s)
Setter for the version attribute (optional). |
void | setVmoptions(String s)
Setter for the "vmoptions" attribute (optional) |
void | setWorkingDirectory(String s)
Setter for the "WorkingDirectory" attribute (optional) |
Parameters: s The arguments to pass to the application being launched.
Parameters: file the path to the stub file