|
|
@@ -8,6 +8,8 @@ |
|
|
|
|
|
|
|
<body> |
|
|
|
<h2><a name="antlib">Antlib</a></h2> |
|
|
|
|
|
|
|
|
|
|
|
<h3>Description</h3> |
|
|
|
<p> |
|
|
|
An antlib file is an xml file with a root element of "antlib". |
|
|
@@ -44,6 +46,14 @@ |
|
|
|
<typedef name="scriptpathmapper" |
|
|
|
classname="org.acme.ant.ScriptPathMapper" |
|
|
|
onerror="ignore"/> |
|
|
|
<macrodef name="print"> |
|
|
|
<attribute name="file"/> |
|
|
|
<sequential> |
|
|
|
<concat taskname="print"> |
|
|
|
<fileset dir="." includes="@{file}"/> |
|
|
|
</concat> |
|
|
|
</sequential> |
|
|
|
</macrodef> |
|
|
|
</antlib> |
|
|
|
</pre> |
|
|
|
</blockquote> |
|
|
@@ -81,6 +91,8 @@ |
|
|
|
</sample:if> |
|
|
|
</pre> |
|
|
|
</blockquote> |
|
|
|
|
|
|
|
|
|
|
|
<h3><a name="antlibnamespace">Antlib namespace</a></h3> |
|
|
|
<p> |
|
|
|
The name space URIs with the pattern <b>antlib:<i>java package</i></b> |
|
|
@@ -127,6 +139,36 @@ |
|
|
|
The requirement that the resource is in the default classpath |
|
|
|
may be removed in future versions of Ant.</p> |
|
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
<h3><a name="loadFromInside">Load antlib from inside of the buildfile</a></h3> |
|
|
|
<p> |
|
|
|
If you want to seperate the antlib from your local Ant installation, e.g. because you |
|
|
|
want to hold that jar in your projects SCM system, you have to specify a classpath, so |
|
|
|
that Ant could find that jar. The best solution is loading the antlib with <tt><taskdef></tt>. |
|
|
|
</p> |
|
|
|
<blockquote> |
|
|
|
<pre> |
|
|
|
<project xmlns:<font color="green">antcontrib</font>="<font color="red">antlib:net.sf.antcontrib</font>"> |
|
|
|
<taskdef uri="<font color="red">antlib:net.sf.antcontrib</font>" |
|
|
|
resource="net/sf/antcontrib/antlib.xml" |
|
|
|
classpath="path/to/ant-contrib.jar"/> |
|
|
|
|
|
|
|
<target name="iterate"> |
|
|
|
<<font color="green">antcontrib</font>:for param="file"> |
|
|
|
<fileset dir="."/> |
|
|
|
<sequential> |
|
|
|
<echo message="- @{file}"/> |
|
|
|
</sequential> |
|
|
|
</antcontrib:for> |
|
|
|
</target> |
|
|
|
</project> |
|
|
|
</pre> |
|
|
|
</blockquote> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3><a name="currentnamespace">Current namespace</a></h3> |
|
|
|
<p> |
|
|
|
Definitions defined in antlibs may be used in antlibs. However |
|
|
@@ -158,6 +200,8 @@ |
|
|
|
</antlib> |
|
|
|
</pre> |
|
|
|
</blockquote> |
|
|
|
|
|
|
|
|
|
|
|
<h3>Other examples and comments</h3> |
|
|
|
<p> |
|
|
|
Antlibs may make use of other antlibs. |
|
|
@@ -201,7 +245,7 @@ |
|
|
|
</blockquote> |
|
|
|
|
|
|
|
<hr> |
|
|
|
<p align="center">Copyright © 2003-2005 Apache Software |
|
|
|
<p align="center">Copyright © 2003-2006 Apache Software |
|
|
|
Foundation. All rights Reserved.</p> |
|
|
|
|
|
|
|
</body> |
|
|
|