|
|
@@ -792,7 +792,38 @@ platforms. |
|
|
|
Because the resource comparators used (<code><reverse></code> |
|
|
|
and <code><date></code>) are in an internal antlib |
|
|
|
their namespace must be set explicitly. |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
|
|
|
|
<pre> |
|
|
|
<project rsel="antlib:org.apache.tools.ant.types.resources.selectors"> |
|
|
|
<macrodef name="copyFromPath"> |
|
|
|
<attribute name="todir"/> |
|
|
|
<attribute name="refid"/> |
|
|
|
<element name="nested-resource-selectors" optional="yes" implicit="true"/> |
|
|
|
<sequential> |
|
|
|
<mkdir dir="@{todir}" taskname="copyFromPath"/> |
|
|
|
<copy todir="@{todir}" taskname="copyFromPath"> |
|
|
|
<restrict> |
|
|
|
<path refid="@{refid}"/> |
|
|
|
<rsel:or> |
|
|
|
<nested-resource-selectors/> |
|
|
|
</rsel:or> |
|
|
|
</restrict> |
|
|
|
<flattenmapper/> |
|
|
|
</copy> |
|
|
|
</sequential> |
|
|
|
</macrodef> |
|
|
|
<copyFromPath refid="classpath" todir="todir"> |
|
|
|
<rsel:name name="log4j.properties"/> |
|
|
|
<rsel:name name="default.properties"/> |
|
|
|
</copyFromPath> |
|
|
|
</project> |
|
|
|
</pre> |
|
|
|
<p>Creates the <tt>todir</tt> directory and copies (if present) the |
|
|
|
files <tt>log4j.properties</tt> and <tt>default.properties</tt> |
|
|
|
from the Classpath (already used while compiling). |
|
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
</blockquote> |
|
|
|
|
|
|
@@ -920,6 +951,29 @@ larger collection. <strong>Since Ant 1.7.1</strong>.</p> |
|
|
|
<td valign="top" align="center">No, default <i>true</i></td> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
|
|
|
|
<h4>Example</h4> |
|
|
|
<pre> |
|
|
|
<union id="A"> |
|
|
|
<string value="a"/> |
|
|
|
<string value="b"/> |
|
|
|
</union> |
|
|
|
<union id="B"> |
|
|
|
<string value="b"/> |
|
|
|
<string value="c"/> |
|
|
|
</union> |
|
|
|
<union id="union"><resources refid="A"/><resources refid="B"/></union> |
|
|
|
<intersect id="intersect"><resources refid="A"/><resources refid="B"/></intersect> |
|
|
|
<difference id="difference"><resources refid="A"/><resources refid="B"/></difference> |
|
|
|
<echo> |
|
|
|
A: ${toString:A} = a;b |
|
|
|
B: ${toString:B} = b;c |
|
|
|
|
|
|
|
union : ${toString:union} = a;b;c |
|
|
|
intersect : ${toString:intersect} = b |
|
|
|
difference: ${toString:difference} = a;c |
|
|
|
</echo> |
|
|
|
</pre> |
|
|
|
</blockquote> |
|
|
|
|
|
|
|
|
|
|
|