|
|
@@ -675,7 +675,7 @@ platforms. |
|
|
|
<p>Assuming the namespace settings |
|
|
|
<pre><code> rsel="antlib:org.apache.tools.ant.types.resources.selectors" |
|
|
|
rcmp="antlib:org.apache.tools.ant.types.resources.comparators" |
|
|
|
</code></pre> The following selects files a, b, c, and d:</p> |
|
|
|
</code></pre></p> |
|
|
|
<pre> |
|
|
|
<restrict> |
|
|
|
<fileset dir="src" includes="a,b,c,d,e,f,g" /> |
|
|
@@ -685,7 +685,39 @@ platforms. |
|
|
|
</control> |
|
|
|
<rcmp:name /> |
|
|
|
</rsel:compare> |
|
|
|
</restrict></pre> |
|
|
|
</restrict> |
|
|
|
</pre> |
|
|
|
<p>Selects files a, b, c, and d.</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> |
|
|
|
|
|
|
|
<h4><a name="sort">sort</a></h4> |
|
|
@@ -794,37 +826,6 @@ platforms. |
|
|
|
their namespace must be set explicitly. |
|
|
|
</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> |
|
|
|
|
|
|
|
<h4><a name="first">first</a></h4> |
|
|
@@ -952,16 +953,16 @@ larger collection. <strong>Since Ant 1.7.1</strong>.</p> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
|
|
|
|
<h4>Example</h4> |
|
|
|
<h4>Examples</h4> |
|
|
|
<pre> |
|
|
|
<union id="A"> |
|
|
|
<resources id="A"> |
|
|
|
<string value="a"/> |
|
|
|
<string value="b"/> |
|
|
|
</union> |
|
|
|
<union id="B"> |
|
|
|
</resources> |
|
|
|
<resources id="B"> |
|
|
|
<string value="b"/> |
|
|
|
<string value="c"/> |
|
|
|
</union> |
|
|
|
</resources> |
|
|
|
<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> |
|
|
|