ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Basename.java Dirname.java
Date Wed, 10 Apr 2002 13:47:46 GMT
bodewig     02/04/10 06:47:46

  Modified:    docs/manual/CoreTasks basename.html dirname.html
               src/main/org/apache/tools/ant/taskdefs Basename.java
                        Dirname.java
  Log:
  Make sure <basename> and <dirname> don't break property immutability
  rules.
  
  Minor corrections to their documentation.
  
  Revision  Changes    Path
  1.3       +2 -1      jakarta-ant/docs/manual/CoreTasks/basename.html
  
  Index: basename.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/basename.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- basename.html	20 Mar 2002 03:11:48 -0000	1.2
  +++ basename.html	10 Apr 2002 13:47:46 -0000	1.3
  @@ -55,7 +55,8 @@
   or a simple filename (eg., <code>myjar.jar</code>).
   <pre>  &lt;basename property=&quot;cmdname&quot; file=&quot;D:/usr/local/foo.exe&quot;
suffix=&quot;.exe&quot;/&gt;</pre>
   will set <code>cmdname</code> to <code>foo</code>.
  -<pre>  &lt;basename property=&quot;temp.dirname&quot; file=&quot;${env.TEMP}&quot;/&gt;</pre>
  +<pre>  &lt;property environment=&quot;env&quot;/&gt;
  +  &lt;basename property=&quot;temp.dirname&quot; file=&quot;${env.TEMP}&quot;/&gt;</pre>
   
   will set <code>temp.dirname</code> to the last directory element of
   the path defined for the <code>TEMP</code> environment variable.</p>
  
  
  
  1.3       +1 -1      jakarta-ant/docs/manual/CoreTasks/dirname.html
  
  Index: dirname.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/dirname.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- dirname.html	30 Mar 2002 18:50:09 -0000	1.2
  +++ dirname.html	10 Apr 2002 13:47:46 -0000	1.3
  @@ -43,7 +43,7 @@
   will set <code>antfile.dir</code> to the directory path for
   <code>${ant.file}</code>.
   <pre>  &lt;dirname property=&quot;foo.dirname&quot; file=&quot;foo.txt&quot;/&gt;</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>
   <p align="center">Copyright &copy; 2002 Apache Software Foundation.
  
  
  
  1.2       +4 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Basename.java
  
  Index: Basename.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Basename.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Basename.java	20 Mar 2002 02:48:15 -0000	1.1
  +++ Basename.java	10 Apr 2002 13:47:46 -0000	1.2
  @@ -82,7 +82,9 @@
    *
    * @author Diane Holt <a href="mailto:holtdl@apache.org">holtdl@apache.org</a>
    *
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
  + *
  + * @since Ant 1.5
    *
    * @ant.task category="property"
    */
  @@ -122,7 +124,7 @@
               int pos = value.indexOf('.');
               value = value.substring(0, pos);
           }
  -        this.project.setProperty(property, value);
  +        getProject().setNewProperty(property, value);
         }
     }
   }
  
  
  
  1.2       +4 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Dirname.java
  
  Index: Dirname.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Dirname.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Dirname.java	20 Mar 2002 02:48:15 -0000	1.1
  +++ Dirname.java	10 Apr 2002 13:47:46 -0000	1.2
  @@ -75,7 +75,9 @@
    *
    * @author Diane Holt <a href="mailto:holtdl@apache.org">holtdl@apache.org</a>
    *
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
  + *
  + * @since Ant 1.5
    *
    * @ant.task category="property"
    */
  @@ -104,7 +106,7 @@
             throw new BuildException("file attribute required", location);
         } else {
           String value = file.getParent();
  -        this.project.setProperty(property, value);
  +        getProject().setNewProperty(property, value);
         }
     }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message