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 ExecuteOn.java
Date Wed, 21 Nov 2001 17:20:29 GMT
bodewig     01/11/21 09:20:29

  Modified:    .        WHATSNEW
               docs/manual/CoreTasks apply.html
               src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  Add a "relative" attribute to <apply> - this allows users to pass
  relative paths on the command line instead of absolute.
  
  Submitted by:	Matthew O'Haire <mohaire@trysoft.com>
  
  Revision  Changes    Path
  1.176     +3 -0      jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.175
  retrieving revision 1.176
  diff -u -r1.175 -r1.176
  --- WHATSNEW	2001/11/21 08:23:46	1.175
  +++ WHATSNEW	2001/11/21 17:20:29	1.176
  @@ -79,6 +79,9 @@
   
   * Added an optional encoding attribute to <fixcrlf>
   
  +* <apply> has a new attribute relative that allows users to pass the
  +  filenames as relative instead of absolute paths on the command line.
  +
   Changes from Ant 1.4 to Ant 1.4.1
   ===========================================
   
  
  
  
  1.10      +8 -0      jakarta-ant/docs/manual/CoreTasks/apply.html
  
  Index: apply.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/apply.html,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- apply.html	2001/10/30 10:05:34	1.9
  +++ apply.html	2001/11/21 17:20:29	1.10
  @@ -50,6 +50,14 @@
       <td align="center" valign="top">No</td>
     </tr>
     <tr>
  +    <td valign="top">relative</td>
  +    <td valign="top">whether the filenames should be passed on the
  +      command line as absolute or relative pathnames (relative to the
  +      base directory of the corresponding fileset for source files or
  +      the dest attribute for target files).</td>
  +    <td align="center" valign="top">No, default is <i>false</i></td>
  +  </tr>
  +  <tr>
       <td valign="top">os</td>
       <td valign="top">list of Operating Systems on which the command may be
         executed.</td>
  
  
  
  1.18      +15 -2     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ExecuteOn.java	2001/10/29 15:27:14	1.17
  +++ ExecuteOn.java	2001/11/21 17:20:29	1.18
  @@ -78,6 +78,7 @@
   public class ExecuteOn extends ExecTask {
   
       protected Vector filesets = new Vector();
  +    private boolean relative = false;
       private boolean parallel = false;
       protected String type = "file";
       protected Commandline.Marker srcFilePos = null;
  @@ -100,6 +101,14 @@
       }
   
       /**
  +     * Should filenames be returned as relative path names?
  +     */
  +    public void setRelative(boolean relative) {
  +        this.relative = relative;
  +    }
  +
  +
  +    /**
        * Shall the command work on all specified files in parallel?
        */
       public void setParallel(boolean parallel) {
  @@ -348,8 +357,12 @@
   
           // fill in source file names
           for (int i=0; i < srcFiles.length; i++) {
  -            result[srcIndex+i] = 
  -                (new File(baseDirs[i], srcFiles[i])).getAbsolutePath();
  +            if (!relative) {
  +                result[srcIndex+i] = 
  +                    (new File(baseDirs[i], srcFiles[i])).getAbsolutePath();
  +            } else {
  +                result[srcIndex+i] = srcFiles[i];
  +            }
           }
           return result;
       }
  
  
  

--
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