ant/debian/build.xml.5

174 lines
5.1 KiB
Groff
Raw Normal View History

.TH build.xml 5 "February 2010" "Debian Linux"
.SH NAME
build.xml \- configuration file used by Apache Ant to build projects
.SH DESCRIPTION
The file
.B build.xml
is the default configuration file used by
.B ant
to determine target to build for a specific project. It can be
considered the ant equivalent of Makefile.
The format of
.B ant
is XML and for each project a separate file is constructed.
The buildfile consists of one or more tasks. An example is
given below.
<project default="compile">
<target name="compile">
<javac srcdir="src"/>
</target>
</project>
This example has one target and it is defaulted. The target itself
consists of one task
.B javac
which compiles the files in the \fIsrc\fR directory.
.SH TARGETS
Targets can depend on other targets. These dependencies are given by
the \fIdepends\fR attribute of the <\fItarget\fR> element.
.SH TASKS
A task is a piece of code that is executed.
.B Ant
recognizes built-in task, optional tasks, but one can also write new
tasks.
.B Built-in tasks
The built-in tasks are: \fIAnt\fR, \fIAntCall\fR, \fIAntStructure\fR,
\fIAntVersion\fR, \fIApply\fR, \fIApt\fR, \fIAvailable\fR, \fIBasename\fR,
\fIBuildNumber\fR, \fIBUnzip2\fR, \fIBZip2\fR, \fIChecksum\fR, \fIChmod\fR,
\fIConcat\fR, \fICondition\fR, \fICopy\fR, \fIComponentdef\fR, \fICvs\fR,
\fICvsChangeLog\fR, \fICvsVersion\fR, \fICVSPass\fR, \fICvsTagDiff\fR,
\fIDefaultexcludes\fR, \fIDelete\fR, \fIDeltree\fR, \fIDependset\fR,
\fIDiagnostics\fR, \fIDirname\fR, \fIEar\fR, \fIEcho\fR, \fIEchoXML\fR,
\fIExec\fR, \fIFail\fR, \fIFilter\fR, \fIFixCRLF\fR, \fIGenKey\fR, \fIGet\fR,
\fIHostInfo\fR, \fIGUnzip\fR, \fIGZip\fR, \fIImport\fR, \fIInclude\fR,
\fIInput\fR, \fIJar\fR, \fIJava\fR, \fIJavac\fR, \fIJavadoc\fR, \fILength\fR,
\fILoadFile\fR, \fILoadProperties\fR, \fILoadResource\fR, \fILocal\fR,
\fIMakeURL\fR, \fIMail\fR, \fIMacroDef\fR, \fIManifest\fR, \fIManifestClassPath\fR,
\fIMkdir\fR, \fIMove\fR, \fINice\fR, \fIParallel\fR, \fIPatch\fR,
\fIPathConvert\fR, \fIPreSetDef\fR, \fIProperty\fR, \fIPropertyHelper\fR,
\fIRecord\fR, \fIReplace\fR, \fIResourceCount\fR, \fIRetry\fR, \fIRmic\fR,
\fISequential\fR, \fISignJar\fR, \fISleep\fR, \fISql\fR, \fISubAnt\fR,
\fISync\fR, \fITar\fR, \fITaskdef\fR, \fITempfile\fR, \fITouch\fR,
\fITruncate\fR, \fITStamp\fR, \fITypedef\fR, \fIUnjar\fR, \fIUntar\fR,
\fIUnwar\fR, \fIUnzip\fR, \fIUptodate\fR, \fIWaitfor\fR, \fIWhichResource\fR,
\fIWar\fR, \fIXmlProperty\fR, \fIXSLT\fR, \fIZip\fR
.TP
\fBJava\fR
Executes a Java class within the running (Ant) VM or forks another VM if
specified. Below are some of the attributes to the <\fIjava\fR> element:
.B classname
(required) the Java class to execute
.B fork
if enabled triggers the class execution in another VM (disabled by default)
.B jvm
the command used to invoke the Java Virtual Machine, default is
\fIjava\fR. The command is resolved by java.lang.Runtime.exec().
Ignored if fork is disabled.
Other arguments are \fIclasspath\fR, \fIclasspathref\fR, \fImaxmemory\fR,
\fIfailonerror\fR, \fIdir\fR and \fIoutput\fR.
.TP
\fBJavac\fR
Compiles a source tree within the running (Ant) VM.
.B srcdir
(required) location of the java files
.B destdir
location to store the class files
.B debug
indicates whether source should be compiled
with debug information; defaults to off
.B target
generate class files for specific VM version
(e.g., 1.4, 1.5, etc).
.B includes
comma-separated list of patterns of files that
must be included; all files are included when omitted
.B excludes
comma-separated list of patterns of files that
must be excluded; no files (except default
excludes) are excluded when omitted.
.B defaultexcludes
indicates whether default excludes should be
used (yes | no); default excludes are used
when omitted.
Other arguments are \fIincludesfile\fR, \fIexcludesfile\fR,
\fIclasspath\fR, \fIbootclasspath\fR, \fIclasspathref\fR,
\fIbootclasspathref\fR, \fIextdirs\fR, \fIencoding\fR,
\fIdeprecation\fR, \fIverbose\fR, \fIincludeAntRuntime\fR,
\fIincludeJavaRuntime\fR and \fIfailonerror\fR.
.SH Properties
A project can have a set of properties, which consist of a name value
combination. Within tasks they can be used by placing them between
"${" and "}", as in "${builddir}/classes".
.B Built-in Properties
Ant provides access to all system properties as if they had been defined
using a <\fIproperty\fR> task. For example, ${os.name} expands to the name of
the operating system.
.TP
\fBbasedir\fR
the absolute path of the project's basedir (as set
with the basedir attribute of <project>).
.TP
\fBant.file\fR
the absolute path of the buildfile.
.TP
\fBant.version\fR
the version of Ant.
.TP
\fBant.project.name\fR
the name of the project that is currently executing;
it is set in the name attribute of <project>.
.TP
\fBant.java.version\fR
the JVM version Ant detected.
.SH Classpath
The classpath can be set by using the <\fIclasspath\fR>
element:
<classpath>
<pathelement path="${classpath}"/>
<pathelement location="lib/helper.jar"/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
.SH SEE ALSO
.BR ant (1)
.SH AUTHOR
This manpage is made by Egon Willighagen <egonw@sci.kun.nl>
and based on the Ant Manual <\fIhttp://ant.apache.org/manual/\fR>.