This page holds my notes on ant scripts
Known Task | Example |
---|---|
antcall | |
ant | |
echo | |
mkdir | |
get | verbose="true"/> |
copy | |
delete | |
jar | |
input | |
mailhost="${mail.mailhost}" user="${mail.user}" password="${mail.password}" subject="${mail.subject}"> ${mail.message.docs} |
|
sql |
|
sleep | |
xslt | style="${checkstyle.home}/contrib/checkstyle-noframes-sorted.xsl"/> |
replaceregexp | byline="true" flags="gi"> excludes="**/.ade_path/**"/> |
fail | |
antfetch* | |
tstamp |
*From contrib module
Condition Tasks
See http://ant.apache.org/manual/Tasks/conditions.html for core condition tasks
Task Name | Example | Description |
---|---|---|
available | Sets property if directory is present. You can also use type="file" | |
tmpfile | ||
concat | see: http://ant.apache.org/manual/Tasks/concat.html |
Classpath Example
<property file="build.properties"/>
<!-- This code builds the class path -->
<path id="build.classpath">
<pathelement location="${servlet24.jar}"/>
<pathelement location="${jsp20.jar}"/>
<pathelement location="${mysql.jar}"/>
<pathelement path="${appName.jar}"/>
</path>
<target name="rjm" description="RJM Dummy task for stuff">
<echo message="RJM Dummy Start"/>
<echo message="Classpath: ${toString:build.classpath}"/>
<echo message="RJM Dummy End"/>
</target>
Properties
Run this example with the command - ant -Drjm.test.prop="OVE R"
<macrodef name="propertycopy">
<attribute name="name"/>
<attribute name="from"/>
<sequential>
<property name="@{name}" value="${@{from}}"/>
</sequential>
</macrodef>
<propertycopy name="prop.res" from="${p.pointer}"/>
<echo message="pointer*: ${prop.res}"/>
<echo message="ANT_HOME: ${env.ANT_HOME}"/>
<echo message="OS: ${env.OS}"/>
<echo message="Processor: ${env.PROCESSOR_ARCHITECTURE}"/>
RJM Article Type
Quick Reference