git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@916120 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -56,6 +56,8 @@ Other changes: | |||||
| * Add prefix attribute to loadproperties task. | * Add prefix attribute to loadproperties task. | ||||
| * Add resource attribute to length task. | |||||
| Changes from Ant 1.8.0RC1 TO Ant 1.8.0 | Changes from Ant 1.8.0RC1 TO Ant 1.8.0 | ||||
| ====================================== | ====================================== | ||||
| @@ -47,9 +47,16 @@ | |||||
| <tr> | <tr> | ||||
| <td valign="top">file</td> | <td valign="top">file</td> | ||||
| <td valign="top">Single file whose length to report.</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> | or one or more nested filesets</td> | ||||
| </tr> | </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> | <tr> | ||||
| <td valign="top">string</td> | <td valign="top">string</td> | ||||
| <td valign="top">The string whose length to report.</td> | <td valign="top">The string whose length to report.</td> | ||||
| @@ -67,6 +67,14 @@ public class Length extends Task implements Condition { | |||||
| this.property = property; | 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. | * Set the single file for this task. | ||||
| * @param file the <code>File</code> whose length to retrieve. | * @param file the <code>File</code> whose length to retrieve. | ||||
| @@ -230,4 +230,11 @@ | |||||
| </au:assertTrue> | </au:assertTrue> | ||||
| </target> | </target> | ||||
| <target name="testResourceAttribute"> | |||||
| <string id="s" value="foo-bar-baz" /> | |||||
| <au:assertTrue> | |||||
| <length length="11" resource="${ant.refid:s}" /> | |||||
| </au:assertTrue> | |||||
| </target> | |||||
| </project> | </project> | ||||