Browse Source

Add resource attribute to length task.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@916120 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 15 years ago
parent
commit
e46c4cd3c8
4 changed files with 25 additions and 1 deletions
  1. +2
    -0
      WHATSNEW
  2. +8
    -1
      docs/manual/CoreTasks/length.html
  3. +8
    -0
      src/main/org/apache/tools/ant/taskdefs/Length.java
  4. +7
    -0
      src/tests/antunit/taskdefs/length-test.xml

+ 2
- 0
WHATSNEW View File

@@ -56,6 +56,8 @@ Other changes:

* Add prefix attribute to loadproperties task.

* Add resource attribute to length task.

Changes from Ant 1.8.0RC1 TO Ant 1.8.0
======================================



+ 8
- 1
docs/manual/CoreTasks/length.html View File

@@ -47,9 +47,16 @@
<tr>
<td valign="top">file</td>
<td valign="top">Single file whose length to report.</td>
<td valign="top" align="center" rowspan="2">One of these,
<td valign="top" align="center" rowspan="3">One of these,
or one or more nested filesets</td>
</tr>
<tr>
<td valign="top">resource</td>
<td valign="top">Single resource whose length to report (using extended
<a href="../properties.html#propertyHelper">properties handling</a>).
<em>Since Ant 1.8.1</em>
</td>
</tr>
<tr>
<td valign="top">string</td>
<td valign="top">The string whose length to report.</td>


+ 8
- 0
src/main/org/apache/tools/ant/taskdefs/Length.java View File

@@ -67,6 +67,14 @@ public class Length extends Task implements Condition {
this.property = property;
}

/**
* Set the single resource for this task.
* @param resource the Resource whose length to retrieve.
*/
public synchronized void setResource(Resource resource) {
add(resource);
}

/**
* Set the single file for this task.
* @param file the <code>File</code> whose length to retrieve.


+ 7
- 0
src/tests/antunit/taskdefs/length-test.xml View File

@@ -230,4 +230,11 @@
</au:assertTrue>
</target>

<target name="testResourceAttribute">
<string id="s" value="foo-bar-baz" />
<au:assertTrue>
<length length="11" resource="${ant.refid:s}" />
</au:assertTrue>
</target>

</project>

Loading…
Cancel
Save