rules. Minor corrections to their documentation. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272341 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -55,7 +55,8 @@ a relative-path filename (eg., <code>lib/myjar.jar</code>), | |||||
| or a simple filename (eg., <code>myjar.jar</code>). | or a simple filename (eg., <code>myjar.jar</code>). | ||||
| <pre> <basename property="cmdname" file="D:/usr/local/foo.exe" suffix=".exe"/></pre> | <pre> <basename property="cmdname" file="D:/usr/local/foo.exe" suffix=".exe"/></pre> | ||||
| will set <code>cmdname</code> to <code>foo</code>. | will set <code>cmdname</code> to <code>foo</code>. | ||||
| <pre> <basename property="temp.dirname" file="${env.TEMP}"/></pre> | |||||
| <pre> <property environment="env"/> | |||||
| <basename property="temp.dirname" file="${env.TEMP}"/></pre> | |||||
| will set <code>temp.dirname</code> to the last directory element of | will set <code>temp.dirname</code> to the last directory element of | ||||
| the path defined for the <code>TEMP</code> environment variable.</p> | the path defined for the <code>TEMP</code> environment variable.</p> | ||||
| @@ -43,7 +43,7 @@ the directory will be the current directory. | |||||
| will set <code>antfile.dir</code> to the directory path for | will set <code>antfile.dir</code> to the directory path for | ||||
| <code>${ant.file}</code>. | <code>${ant.file}</code>. | ||||
| <pre> <dirname property="foo.dirname" file="foo.txt"/></pre> | <pre> <dirname property="foo.dirname" file="foo.txt"/></pre> | ||||
| will set <code>foo.dirname</code> to the current directory.</p> | |||||
| will set <code>foo.dirname</code> to the project's basedir.</p> | |||||
| <hr> | <hr> | ||||
| <p align="center">Copyright © 2002 Apache Software Foundation. | <p align="center">Copyright © 2002 Apache Software Foundation. | ||||
| @@ -84,6 +84,8 @@ import org.apache.tools.ant.Task; | |||||
| * | * | ||||
| * @version $Revision$ | * @version $Revision$ | ||||
| * | * | ||||
| * @since Ant 1.5 | |||||
| * | |||||
| * @ant.task category="property" | * @ant.task category="property" | ||||
| */ | */ | ||||
| @@ -122,7 +124,7 @@ public class Basename extends Task { | |||||
| int pos = value.indexOf('.'); | int pos = value.indexOf('.'); | ||||
| value = value.substring(0, pos); | value = value.substring(0, pos); | ||||
| } | } | ||||
| this.project.setProperty(property, value); | |||||
| getProject().setNewProperty(property, value); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -77,6 +77,8 @@ import org.apache.tools.ant.Task; | |||||
| * | * | ||||
| * @version $Revision$ | * @version $Revision$ | ||||
| * | * | ||||
| * @since Ant 1.5 | |||||
| * | |||||
| * @ant.task category="property" | * @ant.task category="property" | ||||
| */ | */ | ||||
| @@ -104,7 +106,7 @@ public class Dirname extends Task { | |||||
| throw new BuildException("file attribute required", location); | throw new BuildException("file attribute required", location); | ||||
| } else { | } else { | ||||
| String value = file.getParent(); | String value = file.getParent(); | ||||
| this.project.setProperty(property, value); | |||||
| getProject().setNewProperty(property, value); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||