Wiki source code of JApplication

Version 73.1 by Andrus Adamchik on 2006/09/16 16:42

Show last authors
1 //(unreleased as of 09/16/2006)//
2
3 == Description ==
4
5 //JApplication// is a task for assembling native launchers of Java applications for a number of target platforms. Currently supports native launchers for Mac and Windows operating systems and also a "java launcher" - a single jar file that can be run via ##"java --jar file.jar"--##--.--
6
7 == OS Strategies ==
8
9 * Java: builds a single runnable jar file out of a collection of jar files.
10 * Mac: builds a XYZ.app bundle that includes all jar dependencies.
11 * Windows: Does a Java build and creates an [[NSIS>>http://nsis.sourceforge.net/Main_Page]] launcher for the runnable jar. Both ##".exe"## and ##".jar"## files are required to be in the same directory for the launcher to work.
12
13 == Build Prerequisites and OS Specifics ==
14
15 * Java launcher can be assembled on any platform and has no prerequisites.
16 * Mac launcher can be built on Mac, as it requires a JavaApplicationStab file.
17 * Windows launcher can currently be build on Windows only.
18 * Windows launcher requires [[NSIS>>http://nsis.sourceforge.net/Main_Page]] to be installed on the build machine.
19
20 == Parameters ==
21
22 |=Attribute|=Description|=Required|=Platforms
23 |name|The name of the application without OS-specific extension|yes|
24 |mainClass|Main Java class|yes|
25 |os|A family of operating systems. Currently supported values are "mac", "windows" and "java"|no (will use build machine os if ommitted; if the os is not supported, will use "java")|
26 |destDir|A destination directory where the application launcher should be installed|no (will use ##"$basedir"## if omitted)|
27 |longName|An optional string identifying the application human-readable name. If not specified, "name" is used.|no|
28 |icon|Platform-specific icon file (usually ".ico" on Windows and ".icns" on Mac)|no|mac,windows
29 |jvm|Minimal version of the Java Virtual machine required.|no (default is "1.4+")|mac
30 |jvmOptions|Optional parameters to pass to the JVM, such as memory settings, etc.|no|mac
31 |nsisHome|Location of NSIS installation. Ignored except on Windows.|no (default is "C:rogram FilesSIS")|windows
32 |version|Product version string|no (default 0.0)|mac
33
34 == Nested Elements ==
35
36 === lib ===
37
38 The [[FileSet>>http://ant.apache.org/manual/CoreTypes/fileset.html]] specifying jar files to be included in the application.
39
40 == Examples ==
41
42 Loading task:
43
44 {{noformat}}
45 <taskdef name="japplication" classname="org.objectstyle.woproject.ant.JApplication"/>
46 {{/noformat}}
47
48 Building a Windows application, resulting in "MyApp.exe" launcher that starts "MyApp.jar" file.
49
50 {{noformat}}
51 <japplication name="MyApp" destDir="dist" mainClass="org.example.Main" os="windows">
52 <lib dir="lib" includes="**/*.jar"/>
53 </japplication>
54 {{/noformat}}