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/
Constructor and Description |
---|
JarBundler() |
Modifier and Type | Method and Description |
---|---|
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(java.lang.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(java.lang.String s)
Arguments to the
|
void |
setBuild(java.lang.String s)
Setter for the "buildnumber" attribute (optional) This key specifies the
exact build version of the bundle.
|
void |
setBundleid(java.lang.String s)
Setter for the "bundleid" attribute (optional) This key specifies a
unique identifier string for the bundle.
|
void |
setChmod(java.lang.String s)
Set the 'chmod' executable.
|
void |
setDevelopmentregion(java.lang.String s)
Setter for the "developmentregion" attribute(optional) Default "English".
|
void |
setDir(java.io.File f)
Setter for the "dir" attribute (required)
|
void |
setExecs(java.lang.String s)
Setter for the "execs" attribute (optional)
|
void |
setExtraclasspath(java.lang.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(java.lang.String s) |
void |
setHelpBookName(java.lang.String s) |
void |
setIcon(java.io.File f)
Setter for the "icon" attribute (optional)
|
void |
setInfoString(java.lang.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(java.io.File s)
Setter for the "jar" attribute (required if no "jarfileset" is present)
|
void |
setJars(java.lang.String s)
Setter for the "jars" attribute (required if no "jarfileset" is present)
|
void |
setJvmArchs(java.lang.String s)
Setter for the "JVMArchs" attribute (optional)
|
void |
setJvmversion(java.lang.String s)
Setter for the "jvmversion" attribute (optional)
|
void |
setLiveresize(boolean b)
Setter for the "liveresize" attribute (optional)
|
void |
setLSArchitecturePriority(java.lang.String s)
Setter for the "LSArchitecturePriority" attribute (optional)
|
void |
setMainClass(java.lang.String s)
Setter for the "mainclass" attribute (required)
|
void |
setName(java.lang.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(java.lang.String s)
Setter for the "shortinfostring" attribute (optional) This key identifies
the marketing version of the bundle.
|
void |
setShortName(java.lang.String s)
Setter for the "shortname" attribute (optional) This key identifies the
short name of the bundle.
|
void |
setShowPlist(boolean showPlist) |
void |
setSignature(java.lang.String s)
Setter for the "signature" attribute (optional)
|
void |
setSmallTabs(boolean b)
Setter for the "smalltabs" attribute (optional)
|
void |
setSplashFile(java.lang.String s)
Setter for the "splashfile" attribute (optional).
|
void |
setStartonmainthread(boolean b)
Setter for the "startonmainthread" attribute (optional)
|
void |
setStubFile(java.io.File file)
Override the stub file path to build on non-MacOS platforms
|
void |
setType(java.lang.String s)
Setter for the "type" attribute (optional)
|
void |
setVerbose(boolean verbose)
Setter for the "verbose" attribute (optional)
|
void |
setVersion(java.lang.String s)
Setter for the version attribute (optional).
|
void |
setVmoptions(java.lang.String s)
Setter for the "vmoptions" attribute (optional)
|
void |
setWorkingDirectory(java.lang.String s)
Setter for the "WorkingDirectory" attribute (optional)
|
public void setArguments(java.lang.String s)
s
- The arguments to pass to the application being launched.public void setStubFile(java.io.File file)
file
- the path to the stub filepublic void setDir(java.io.File f)
public void setName(java.lang.String s)
public void setShortName(java.lang.String s)
public void setMainClass(java.lang.String s)
public void setWorkingDirectory(java.lang.String s)
public void setIcon(java.io.File f)
public void setSplashFile(java.lang.String s)
public void setBundleid(java.lang.String s)
public void setDevelopmentregion(java.lang.String s)
public void setAboutmenuname(java.lang.String s)
public void setSmallTabs(boolean b)
public void setVmoptions(java.lang.String s)
public void setAntialiasedgraphics(boolean b)
public void setAntialiasedtext(boolean b)
public void setScreenmenu(boolean b)
public void setGrowbox(boolean b)
public void setGrowboxintrudes(boolean b)
public void setLiveresize(boolean b)
public void setType(java.lang.String s)
public void setSignature(java.lang.String s)
public void setJvmversion(java.lang.String s)
public void setJvmArchs(java.lang.String s)
public void setLSArchitecturePriority(java.lang.String s)
public void setStartonmainthread(boolean b)
public void setInfoString(java.lang.String s)
public void setShortInfoString(java.lang.String s)
public void setVerbose(boolean verbose)
public void setShowPlist(boolean showPlist)
public void setBuild(java.lang.String s)
public void setVersion(java.lang.String s)
public void setHelpBookFolder(java.lang.String s)
public void setHelpBookName(java.lang.String s)
public void setJars(java.lang.String s)
public void setJar(java.io.File s)
public void setExecs(java.lang.String s)
public void setExtraclasspath(java.lang.String s)
public void setChmod(java.lang.String s)
public void addJarfileset(FileSet fs)
public void addJarfilelist(FileList fl)
public void addExecfileset(FileSet fs)
public void addExecfilelist(FileList fl)
public void addResourcefileset(FileSet fs)
public void addResourcefilelist(FileList fl)
public void addJavafileset(FileSet fs)
public void addJavafilelist(FileList fl)
public void addExtraclasspathfileset(FileSet fs)
public void addExtraclasspathfilelist(FileList fl)
public void addConfiguredJavaProperty(JavaProperty javaProperty) throws BuildException
BuildException
public void addConfiguredDocumentType(DocumentType documentType) throws BuildException
BuildException
public void addConfiguredService(Service service)
public void addConfiguredHelpBook(HelpBook helpBook)
public void execute() throws BuildException
BuildException