|
|
@@ -25,6 +25,7 @@ |
|
|
|
<body> |
|
|
|
|
|
|
|
<h2>ResourceCount</h2> |
|
|
|
|
|
|
|
<h3>Description</h3> |
|
|
|
<p>Display or set a property containing the size of a nested |
|
|
|
<a href="../CoreTypes/resources.html#collection">Resource Collection</a>. |
|
|
@@ -63,12 +64,14 @@ |
|
|
|
<td valign="top" align="center">No; default is "equal"</td> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
|
|
|
|
<h3>Parameters specified as nested elements</h3> |
|
|
|
<h4>Resource Collection</h4> |
|
|
|
<p>A single |
|
|
|
<a href="../CoreTypes/resources.html#collection">Resource Collection</a> |
|
|
|
should be specified via a nested element or the <code>refid</code> attribute. |
|
|
|
</p> |
|
|
|
|
|
|
|
<h3>Examples</h3> |
|
|
|
<pre><resourcecount property="count.foo"> |
|
|
|
<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) |
|
|
|
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> |
|
|
|
</html> |
|
|
|
|