@@ -25,6 +25,7 @@
<body>
<body>
<h2>ResourceCount</h2>
<h2>ResourceCount</h2>
<h3>Description</h3>
<h3>Description</h3>
<p>Display or set a property containing the size of a nested
<p>Display or set a property containing the size of a nested
<a href="../CoreTypes/resources.html#collection">Resource Collection</a>.
<a href="../CoreTypes/resources.html#collection">Resource Collection</a>.
@@ -63,12 +64,14 @@
<td valign="top" align="center">No; default is "equal"</td>
<td valign="top" align="center">No; default is "equal"</td>
</tr>
</tr>
</table>
</table>
<h3>Parameters specified as nested elements</h3>
<h3>Parameters specified as nested elements</h3>
<h4>Resource Collection</h4>
<h4>Resource Collection</h4>
<p>A single
<p>A single
<a href="../CoreTypes/resources.html#collection">Resource Collection</a>
<a href="../CoreTypes/resources.html#collection">Resource Collection</a>
should be specified via a nested element or the <code>refid</code> attribute.
should be specified via a nested element or the <code>refid</code> attribute.
</p>
</p>
<h3>Examples</h3>
<h3>Examples</h3>
<pre><resourcecount property="count.foo">
<pre><resourcecount property="count.foo">
<filelist dir="." files="foo,bar" />
<filelist dir="." files="foo,bar" />
@@ -77,6 +80,28 @@ should be specified via a nested element or the <code>refid</code> attribute.
<p>Stores the number of resources in the specified filelist (two)
<p>Stores the number of resources in the specified filelist (two)
in the property named <i>count.foo</i>.</p>
in the property named <i>count.foo</i>.</p>
<pre>
<project>
<property name="file" value="${ant.file}"/>
<resourcecount property="file.lines">
<tokens>
<concat>
<filterchain>
<tokenfilter>
<linetokenizer/>
</tokenfilter>
</filterchain>
<fileset file="${file}"/>
</concat>
</tokens>
</resourcecount>
<echo>The file '${file}' has ${file.lines} lines.</echo>
</project>
</pre>
<p>Stores the number of lines of the current buildfile in the property <tt>file.lines</tt>.
Requires Ant 1.7.1+ as <concat> has to be resource.</p>
</body>
</body>
</html>
</html>