You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by ru...@locus.apache.org on 2000/02/28 03:17:58 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Chmod.java Delete.java Javac.java

rubys       00/02/27 18:17:58

  Modified:    src/main/org/apache/tools/ant/taskdefs Chmod.java
                        Delete.java Javac.java
  Log:
  First installment on \x/ill Uther's changes.
  
  While some (like chmod) are clearly Mac motivated, others (like Javac) are
  fixes to bugs that can appear on any platform.
  Submitted by: William Uther <wi...@cs.cmu.edu>
  
  Revision  Changes    Path
  1.2       +2 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Chmod.java
  
  Index: Chmod.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Chmod.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Chmod.java	2000/01/13 10:41:41	1.1
  +++ Chmod.java	2000/02/28 02:17:57	1.2
  @@ -81,7 +81,8 @@
       public void execute() throws BuildException {
   	try {
   	    // XXX if OS=unix
  -	    if (System.getProperty("path.separator").equals(":"))
  +	    if (System.getProperty("path.separator").equals(":") &&
  +                    !System.getProperty("os.name").startsWith("Mac"))
   		Runtime.getRuntime().exec("chmod " + mod + " " + srcFile );
   	} catch (IOException ioe) {
   	    // ignore, but warn
  
  
  
  1.2       +7 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Delete.java
  
  Index: Delete.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Delete.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Delete.java	2000/01/27 03:50:58	1.1
  +++ Delete.java	2000/02/28 02:17:57	1.2
  @@ -72,10 +72,14 @@
       }
   
       public void execute() throws BuildException {
  -        project.log("Deleting: " + f.getAbsolutePath());
  -
           if (f.exists()) {
  -            f.delete();
  +            if (f.isDirectory()) { 
  +                project.log("Directory: " + f.getAbsolutePath() + 
  +                    " cannot be removed with delete.  Use Deltree instead.");
  +            } else {
  +                project.log("Deleting: " + f.getAbsolutePath());
  +                f.delete();
  +            }
           }
       }
   }
  
  
  
  1.9       +5 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Javac.java	2000/02/27 19:13:56	1.8
  +++ Javac.java	2000/02/28 02:17:57	1.9
  @@ -248,10 +248,14 @@
   
       /**
        * Scans the directory looking for source files to be compiled and
  -     * support files to be copied.
  +     * support files to be copied.  The results are returned in the
  +     * class variables compileList and filecopyList.
        */
   
       private void scanDir(File srcDir, File destDir, String files[]) {
  +
  +        compileList.removeAllElements();
  +        filecopyList.clear();
   
           long now = (new Date()).getTime();