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 <will+ant@cs.cmu.edu> git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267621 13f79535-47bb-0310-9956-ffa450edef68master
@@ -81,7 +81,8 @@ public class Chmod extends Task { | |||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
try { | try { | ||||
// XXX if OS=unix | // 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 ); | Runtime.getRuntime().exec("chmod " + mod + " " + srcFile ); | ||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
// ignore, but warn | // ignore, but warn | ||||
@@ -72,10 +72,14 @@ public class Delete extends Task { | |||||
} | } | ||||
public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
project.log("Deleting: " + f.getAbsolutePath()); | |||||
if (f.exists()) { | 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(); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -248,11 +248,15 @@ public class Javac extends MatchingTask { | |||||
/** | /** | ||||
* Scans the directory looking for source files to be compiled and | * 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[]) { | private void scanDir(File srcDir, File destDir, String files[]) { | ||||
compileList.removeAllElements(); | |||||
filecopyList.clear(); | |||||
long now = (new Date()).getTime(); | long now = (new Date()).getTime(); | ||||
for (int i = 0; i < files.length; i++) { | for (int i = 0; i < files.length; i++) { | ||||