|
|
5b58bc |
ant(1)
|
|
|
5b58bc |
======
|
|
|
5b58bc |
:doctype: manpage
|
|
|
5b58bc |
:man source: ANT
|
|
|
5b58bc |
:man manual: Apache Ant
|
|
|
5b58bc |
|
|
|
5b58bc |
NAME
|
|
|
5b58bc |
----
|
|
|
5b58bc |
ant - Java build tool
|
|
|
5b58bc |
|
|
|
5b58bc |
SYNOPSIS
|
|
|
5b58bc |
--------
|
|
|
5b58bc |
*ant* [OPTIONS] [TARGET [TARGET2 [TARGET3] ...]]
|
|
|
5b58bc |
|
|
|
5b58bc |
DESCRIPTION
|
|
|
5b58bc |
-----------
|
|
|
5b58bc |
Apache Ant is a Java library and command-line tool whose mission is to drive
|
|
|
5b58bc |
processes described in build files as targets and extension points dependent
|
|
|
5b58bc |
upon each other. The main known usage of Ant is the build of Java applications.
|
|
|
5b58bc |
Ant supplies a number of built-in tasks allowing to compile, assemble, test and
|
|
|
5b58bc |
run Java applications. Ant can also be used effectively to build non Java
|
|
|
5b58bc |
applications, for instance C or C++ applications. More generally, Ant can be
|
|
|
5b58bc |
used to pilot any type of process which can be described in terms of targets
|
|
|
5b58bc |
and tasks.
|
|
|
5b58bc |
|
|
|
5b58bc |
USAGE
|
|
|
5b58bc |
-----
|
|
|
5b58bc |
When no arguments are specified, Ant looks for a build.xml file in the current
|
|
|
5b58bc |
directory and, if found, uses that file as the build file and runs the target
|
|
|
5b58bc |
specified in the default attribute of the <project> tag. To make Ant use
|
|
|
5b58bc |
a build file other than build.xml, use the command-line option *-buildfile*
|
|
|
5b58bc |
file, where file is the name of the build file you want to use (or a directory
|
|
|
5b58bc |
containing a build.xml file).
|
|
|
5b58bc |
|
|
|
5b58bc |
If you use the *-find* [file] option, Ant will search for a build file first in
|
|
|
5b58bc |
the current directory, then in the parent directory, and so on, until either
|
|
|
5b58bc |
a build file is found or the root of the filesystem has been reached. By
|
|
|
5b58bc |
default, it will look for a build file called build.xml. To have it search for
|
|
|
5b58bc |
a build file other than build.xml, specify a file argument. Note: If you
|
|
|
5b58bc |
include any other flags or arguments on the command line after the *-find*
|
|
|
5b58bc |
flag, you must include the file argument for the *-find* flag, even if the name
|
|
|
5b58bc |
of the build file you want to find is build.xml.
|
|
|
5b58bc |
|
|
|
5b58bc |
You can also set properties on the command line. This can be done with the
|
|
|
5b58bc |
*-Dproperty*=value option, where property is the name of the property, and
|
|
|
5b58bc |
value is the value for that property. If you specify a property that is also
|
|
|
5b58bc |
set in the build file (see the property task), the value specified on the
|
|
|
5b58bc |
command line will override the value specified in the build file. Defining
|
|
|
5b58bc |
properties on the command line can also be used to pass in the value of
|
|
|
5b58bc |
environment variables; just pass *-DMYVAR*=$MYVAR to Ant. You can then access
|
|
|
5b58bc |
these variables inside your build file as ${MYVAR}. You can also access
|
|
|
5b58bc |
environment variables using the property task's environment attribute.
|
|
|
5b58bc |
|
|
|
5b58bc |
Options that affect the amount of logging output by Ant are: *-quiet*, which
|
|
|
5b58bc |
instructs Ant to print less information to the console; *-verbose*, which
|
|
|
5b58bc |
causes Ant to print additional information to the console; *-debug*, which
|
|
|
5b58bc |
causes Ant to print considerably more additional information; and *-silent*
|
|
|
5b58bc |
which makes Ant print nothing but task output and build failures (useful to
|
|
|
5b58bc |
capture Ant output by scripts).
|
|
|
5b58bc |
|
|
|
5b58bc |
It is also possible to specify one or more targets that should be executed.
|
|
|
5b58bc |
When omitted, the target that is specified in the default attribute of the
|
|
|
5b58bc |
project tag is used.
|
|
|
5b58bc |
|
|
|
5b58bc |
The *-projecthelp* option prints out a list of the build file's targets.
|
|
|
5b58bc |
Targets that include a description attribute are listed as "Main targets",
|
|
|
5b58bc |
those without a description are listed as "Other targets", then the "Default"
|
|
|
5b58bc |
target is listed ("Other targets" are only displayed if there are no main
|
|
|
5b58bc |
targets, or if Ant is invoked in *-verbose* or *-debug* mode).
|
|
|
5b58bc |
|
|
|
5b58bc |
OPTIONS
|
|
|
5b58bc |
-------
|
|
|
5b58bc |
|
|
|
5b58bc |
*-help, -h*::
|
|
|
5b58bc |
print this message and exit
|
|
|
5b58bc |
*-projecthelp, -p*::
|
|
|
5b58bc |
print project help information and exit
|
|
|
5b58bc |
*-version*::
|
|
|
5b58bc |
print the version information and exit
|
|
|
5b58bc |
*-diagnostics*::
|
|
|
5b58bc |
print information that might be helpful to diagnose or report problems and exit
|
|
|
5b58bc |
*-quiet, -q*::
|
|
|
5b58bc |
be extra quiet
|
|
|
5b58bc |
*-silent, -S*::
|
|
|
5b58bc |
print nothing but task outputs and build failures
|
|
|
5b58bc |
*-verbose, -v*::
|
|
|
5b58bc |
be extra verbose
|
|
|
5b58bc |
*-debug, -d*::
|
|
|
5b58bc |
print debugging information
|
|
|
5b58bc |
*-emacs, -e*::
|
|
|
5b58bc |
produce logging information without adornments
|
|
|
5b58bc |
*-lib <path>*::
|
|
|
5b58bc |
specifies a path to search for jars and classes
|
|
|
5b58bc |
*-logfile <file>, -l <file>*::
|
|
|
5b58bc |
use given file for log
|
|
|
5b58bc |
*-logger <classname>*::
|
|
|
5b58bc |
the class which is to perform logging
|
|
|
5b58bc |
*-listener <classname>*::
|
|
|
5b58bc |
add an instance of class as a project listener
|
|
|
5b58bc |
*-noinput*::
|
|
|
5b58bc |
do not allow interactive input
|
|
|
5b58bc |
*-buildfile <file>, -file <file>, -f <file>*::
|
|
|
5b58bc |
use given buildfile
|
|
|
5b58bc |
*-D<property>=<value>*::
|
|
|
5b58bc |
use value for given property
|
|
|
5b58bc |
*-keep-going, -k*::
|
|
|
5b58bc |
execute all targets that do not depend on failed target(s)
|
|
|
5b58bc |
*-propertyfile <name>*::
|
|
|
5b58bc |
load all properties from file with *-D* properties taking precedence
|
|
|
5b58bc |
*-inputhandler <class>*::
|
|
|
5b58bc |
the class which will handle input requests
|
|
|
5b58bc |
*-find <file>, -f <file>*::
|
|
|
5b58bc |
search for buildfile towards the root of the filesystem and use it
|
|
|
5b58bc |
*-nice number*::
|
|
|
5b58bc |
A niceness value for the main thread:
|
|
|
5b58bc |
1 (lowest) to 10 (highest); 5 is the default
|
|
|
5b58bc |
*-nouserlib*::
|
|
|
5b58bc |
Run ant without using the jar files from `${user.home}/.ant/lib`
|
|
|
5b58bc |
*-noclasspath*::
|
|
|
5b58bc |
Run ant without using `CLASSPATH`
|
|
|
5b58bc |
*-autoproxy*::
|
|
|
5b58bc |
Java1.5+: use the OS proxy settings
|
|
|
5b58bc |
*-main <class>*::
|
|
|
5b58bc |
override Ant's normal entry point
|
|
|
5b58bc |
|
|
|
5b58bc |
EXAMPLES
|
|
|
5b58bc |
--------
|
|
|
5b58bc |
*ant*::
|
|
|
5b58bc |
|
|
|
5b58bc |
runs Ant using the build.xml file in the current directory, on the default target.
|
|
|
5b58bc |
|
|
|
5b58bc |
*ant -buildfile test.xml*::
|
|
|
5b58bc |
|
|
|
5b58bc |
runs Ant using the test.xml file in the current directory, on the default target.
|
|
|
5b58bc |
|
|
|
5b58bc |
*ant -buildfile test.xml dist*::
|
|
|
5b58bc |
|
|
|
5b58bc |
runs Ant using the test.xml file in the current directory, on the target called dist.
|
|
|
5b58bc |
|
|
|
5b58bc |
*ant -buildfile test.xml -Dbuild=build/classes dist*::
|
|
|
5b58bc |
|
|
|
5b58bc |
runs Ant using the test.xml file in the current directory, on the target called dist, setting the build property to the value "build/classes".
|
|
|
5b58bc |
|
|
|
5b58bc |
*ant -lib /home/ant/extras*::
|
|
|
5b58bc |
|
|
|
5b58bc |
runs Ant picking up additional task and support jars from the /home/ant/extras location
|
|
|
5b58bc |
|
|
|
5b58bc |
*ant -lib one.jar;another.jar*::
|
|
|
5b58bc |
|
|
|
5b58bc |
adds two jars to Ants classpath.
|
|
|
5b58bc |
|
|
|
5b58bc |
FILES
|
|
|
5b58bc |
-----
|
|
|
5b58bc |
The Ant wrapper script for Unix will source (read and evaluate) the file *~/.antrc* before it does anything. You can use the file, for example, to set/unset environment variables that should only be visible during the execution of Ant.
|
|
|
5b58bc |
|
|
|
5b58bc |
ENVIRONMENT VARIABLES
|
|
|
5b58bc |
---------------------
|
|
|
5b58bc |
The wrapper scripts use the following environment variables (if set):
|
|
|
5b58bc |
|
|
|
5b58bc |
JAVACMD::
|
|
|
5b58bc |
full path of the Java executable. Use this to invoke a different JVM than JAVA_HOME/bin/java.
|
|
|
5b58bc |
ANT_OPTS::
|
|
|
5b58bc |
command-line arguments that should be passed to the JVM. For example, you can define system properties or set the maximum Java heap size here.
|
|
|
5b58bc |
ANT_ARGS::
|
|
|
5b58bc |
Ant command-line arguments. For example, set ANT_ARGS to point to a different logger, include a listener, and to include the *-find* flag.
|
|
|
5b58bc |
Note: If you include *-find* in ANT_ARGS, you should include the name of the build file to find, even if the file is called build.xml.
|
|
|
5b58bc |
|
|
|
5b58bc |
SEE ALSO
|
|
|
5b58bc |
--------
|
|
|
5b58bc |
java(1), make(1), mvn(1)
|