Wiki source code of JApplication
Version 80.1 by Andrus Adamchik on 2006/12/10 12:40
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
26.1 | 1 | == Description == |
| 2 | |||
| |
46.1 | 3 | //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"--##--.-- |
| |
26.1 | 4 | |
| |
70.1 | 5 | == OS Strategies == |
| 6 | |||
| 7 | * Java: builds a single runnable jar file out of a collection of jar files. | ||
| 8 | * Mac: builds a XYZ.app bundle that includes all jar dependencies. | ||
| |
80.1 | 9 | * Windows: Performs 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. |
| |
70.1 | 10 | |
| |
80.1 | 11 | == OS Requirements == |
| |
26.1 | 12 | |
| |
80.1 | 13 | * Mac launcher can be built on Mac only, as it requires a JavaApplicationStab file. |
| 14 | * Windows launcher can be built on Windows only. | ||
| |
46.1 | 15 | * Java launcher can be assembled on any platform and has no prerequisites. |
| |
26.1 | 16 | |
| 17 | == Parameters == | ||
| |
46.1 | 18 | |
| 19 | |=Attribute|=Description|=Required|=Platforms | ||
| 20 | |name|The name of the application without OS-specific extension|yes| | ||
| 21 | |mainClass|Main Java class|yes| | ||
| |
62.1 | 22 | |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")| |
| 23 | |destDir|A destination directory where the application launcher should be installed|no (will use ##"$basedir"## if omitted)| | ||
| |
54.1 | 24 | |longName|An optional string identifying the application human-readable name. If not specified, "name" is used.|no| |
| |
46.1 | 25 | |icon|Platform-specific icon file (usually ".ico" on Windows and ".icns" on Mac)|no|mac,windows |
| |
78.1 | 26 | |jvm|Minimal version of the Java Virtual machine required.|no (default is "1.4+")|mac |
| |
80.1 | 27 | |jvmOptions|Optional parameters to pass to the JVM, such as memory settings, etc.|no|mac,windows |
| |
78.1 | 28 | |version|Product version string|no (default 0.0)|mac |
| |
46.1 | 29 | |
| 30 | == Nested Elements == | ||
| 31 | |||
| 32 | === lib === | ||
| 33 | |||
| 34 | The [[FileSet>>http://ant.apache.org/manual/CoreTypes/fileset.html]] specifying jar files to be included in the application. | ||
| |
54.1 | 35 | |
| 36 | == Examples == | ||
| 37 | |||
| 38 | Loading task: | ||
| 39 | |||
| 40 | {{noformat}} | ||
| 41 | <taskdef name="japplication" classname="org.objectstyle.woproject.ant.JApplication"/> | ||
| 42 | {{/noformat}} | ||
| 43 | |||
| 44 | Building a Windows application, resulting in "MyApp.exe" launcher that starts "MyApp.jar" file. | ||
| 45 | |||
| 46 | {{noformat}} | ||
| 47 | <japplication name="MyApp" destDir="dist" mainClass="org.example.Main" os="windows"> | ||
| |
68.1 | 48 | <lib dir="lib" includes="**/*.jar"/> |
| |
54.1 | 49 | </japplication> |
| 50 | {{/noformat}} |