jagant lets you run jagtool commands from Ant build files. This powerful feature allows you to write build files that automate many development and deployment tasks.
Jakarta Ant is a Java-based build tool developed by the Apache Jakarta project. To obtain Ant software and documentation, see the Ant Web site . Ant functions similarly to other build tools (such as make, gnumake, or jam) but is platform-independent, extending Java classes rather than OS-specific shell commands. Ant includes a number of tasks that are frequently used to perform builds, including compiling Java files and creating JAR files. It also includes common functions such as copy, delete, chmod, and so on.
Ant build files (similar to a make file) are written in XML. Like make, Ant build files can include targets that perform a series of tasks. Instead of extending shell commands, Ant’s build file calls out a target tree where various tasks are executed. Each task is run by an object that implements a particular task interface.
Install Ant and read the accompanying documentation.
The jagant script requires a full JDK installation. If you are running jagant from an EAServer client install, make sure you have installed the full JDK. By default, only the JRE files are installed.
Before running jagant, verify that:
The JAGUAR environment variable is set.
A full JDK installation is present.
Jakarta Ant is installed on your system.
By default, jagant searches for Jakarta Ant in %JAGUAR%\jakarta-ant (Windows) or $JAGUAR/jakarta-ant (Solaris). If you install Jakarta Ant in a different location, set the ANT_HOME environment variable before running the jagant script to reflect the change.
You can also set ANT_HOME in the user environment file, %JAGUAR%\bin\user_setenv.bat (Windows) or $JAGUAR/bin/user_setenv.sh (UNIX). The jagant script checks the user environment file each time it runs.
If
you are using jagant to compile JSP files with the compilejsp command,
modify the CLASSPATH setting for the Ant scripts, adding the location
of the xalan.jar and crimson.jar files
that are included with EAServer. For example, if using Windows,
edit the ant.bat file, and change the code
under the :runAnt
label to
read:
:runAnt set JAGUAR=EAServer install directory set LOCALCLASSPATH=%JAGUAR%\java\classes\crimson.jar;%LOCALCLASSPATH% set LOCALCLASSPATH=%JAGUAR%\java\classes\xalan.jar;%LOCALCLASSPATH% %_JAVACMD% -classpath %LOCALCLASSPATH% -Dant.home="%ANT_HOME%" %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% goto end
Or on UNIX, change the last line to read like these lines:
JAGUAR=EAServer install directory LOCALCLASSPATH=$JAGUAR/java/classes/crimson.jar:$LOCALCLASSPATH LOCALCLASSPATH=$JAGUAR/java/classes/xalan.jar:$LOCALCLASSPATH $JAVACMD -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main "$@"
The following scripts are provided for running Ant with jagtool commands:
The jagant script uses this syntax:
jagant [ant_options]
where ant_options are any options and commands supported by Ant; see the Ant documentation for details on these options.
You may frequently use the -buildfile flag. Using -buildfile lets you specify a location other than the default for the Ant XML build file.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |