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