ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
Date Tue, 16 Nov 2004 21:46:46 GMT
mbenson     2004/11/16 13:46:46

  Modified:    .        WHATSNEW
               src/testcases/org/apache/tools/ant/taskdefs
                        ExecuteOnTest.java
               docs/manual/CoreTasks apply.html
               src/etc/testcases/taskdefs/exec apply.xml
               src/main/org/apache/tools/ant/taskdefs ExecuteOn.java
  Log:
  Change <apply>'s "overwrite" attribute name to "force".  Also commit missing
  Java changes.  Oops.
  
  Revision  Changes    Path
  1.685     +1 -1      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.684
  retrieving revision 1.685
  diff -u -r1.684 -r1.685
  --- WHATSNEW	16 Nov 2004 20:58:22 -0000	1.684
  +++ WHATSNEW	16 Nov 2004 21:46:46 -0000	1.685
  @@ -86,7 +86,7 @@
   * Junit task -- display suite first.
     Bugzilla report 31962.
   
  -* <apply> has a new "overwrite" attribute that, when true, disables
  +* <apply> has a new "force" attribute that, when true, disables
     checking of target files.
   
   Changes from Ant 1.6.2 to current Ant 1.6 CVS version
  
  
  
  1.8       +2 -2      ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java
  
  Index: ExecuteOnTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/ExecuteOnTest.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ExecuteOnTest.java	16 Nov 2004 20:58:22 -0000	1.7
  +++ ExecuteOnTest.java	16 Nov 2004 21:46:46 -0000	1.8
  @@ -554,8 +554,8 @@
           executeTarget("ignoremissing");
       }
   
  -    public void testOverwrite() {
  -        executeTarget("overwrite");
  +    public void testForce() {
  +        executeTarget("force");
       }
   
       //borrowed from TokenFilterTest
  
  
  
  1.33      +1 -1      ant/docs/manual/CoreTasks/apply.html
  
  Index: apply.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/apply.html,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- apply.html	16 Nov 2004 20:58:22 -0000	1.32
  +++ apply.html	16 Nov 2004 21:46:46 -0000	1.33
  @@ -256,7 +256,7 @@
       <td align="center" valign="top">No, default is <i>true</i></td>
     </tr>
     <tr>
  -    <td valign="top">overwrite</td>
  +    <td valign="top">force</td>
       <td valign="top">Whether to bypass timestamp comparisons
         for target files.  <em>Since Ant 1.7.</em></td>
       <td align="center" valign="top">No, default is <i>false</i></td>
  
  
  
  1.7       +2 -2      ant/src/etc/testcases/taskdefs/exec/apply.xml
  
  Index: apply.xml
  ===================================================================
  RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/exec/apply.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apply.xml	16 Nov 2004 20:58:22 -0000	1.6
  +++ apply.xml	16 Nov 2004 21:46:46 -0000	1.7
  @@ -378,7 +378,7 @@
           </fail>
       </target>
   
  -    <target name="overwrite" depends="init,xyz,pad" if="echo.can.run">
  +    <target name="force" depends="init,xyz,pad" if="echo.can.run">
           <presetdef name="ekko">
               <apply executable="echo" append="true" dest="${basedir}">
                   <filelist refid="xyzlist" />
  @@ -393,7 +393,7 @@
           </pathconvert>
   
           <ekko outputproperty="foo" />
  -        <ekko outputproperty="bar" overwrite="true" />
  +        <ekko outputproperty="bar" force="true" />
           <fail>
               <condition>
                   <not>
  
  
  
  1.57      +18 -22    ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  
  Index: ExecuteOn.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- ExecuteOn.java	16 Aug 2004 21:56:24 -0000	1.56
  +++ ExecuteOn.java	16 Nov 2004 21:46:46 -0000	1.57
  @@ -60,6 +60,7 @@
       private boolean addSourceFile = true;
       private boolean verbose = false;
       private boolean ignoreMissing = true;
  +    private boolean force = false;
   
       /**
        * Has &lt;srcfile&gt; been specified before &lt;targetfile&gt;
  @@ -181,6 +182,15 @@
       }
   
       /**
  +     * Whether to bypass timestamp comparisons for target files.
  +     *
  +     * @since Ant 1.7
  +     */
  +    public void setForce(boolean b) {
  +        force = b;
  +    }
  +
  +    /**
        * Marker that indicates where the name of the source file should
        * be put on the command line.
        */
  @@ -563,13 +573,7 @@
        * be included on the command line.
        */
       protected String[] getFiles(File baseDir, DirectoryScanner ds) {
  -        if (mapper != null) {
  -            SourceFileScanner sfs = new SourceFileScanner(this);
  -            return sfs.restrict(ds.getIncludedFiles(), baseDir, destDir,
  -                                mapper);
  -        } else {
  -            return ds.getIncludedFiles();
  -        }
  +        return restrict(ds.getIncludedFiles(), baseDir);
       }
   
       /**
  @@ -577,13 +581,7 @@
        * should be included on the command line.
        */
       protected String[] getDirs(File baseDir, DirectoryScanner ds) {
  -        if (mapper != null) {
  -            SourceFileScanner sfs = new SourceFileScanner(this);
  -            return sfs.restrict(ds.getIncludedDirectories(), baseDir, destDir,
  -                                mapper);
  -        } else {
  -            return ds.getIncludedDirectories();
  -        }
  +        return restrict(ds.getIncludedDirectories(), baseDir);
       }
   
       /**
  @@ -593,14 +591,12 @@
        * @since Ant 1.6.2
        */
       protected String[] getFilesAndDirs(FileList list) {
  -        if (mapper != null) {
  -            SourceFileScanner sfs = new SourceFileScanner(this);
  -            return sfs.restrict(list.getFiles(getProject()),
  -                                list.getDir(getProject()), destDir,
  -                                mapper);
  -        } else {
  -            return list.getFiles(getProject());
  -        }
  +        return restrict(list.getFiles(getProject()), list.getDir(getProject()));
  +    }
  +
  +    private String[] restrict(String[] s, File baseDir) {
  +        return (mapper == null || force) ? s
  +            : new SourceFileScanner(this).restrict(s, baseDir, destDir, mapper);
       }
   
       /**
  
  
  

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


Mime
View raw message