Browse Source

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 <will+ant@cs.cmu.edu>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267621 13f79535-47bb-0310-9956-ffa450edef68
master
Sam Ruby 25 years ago
parent
commit
f400b0cf33
3 changed files with 14 additions and 5 deletions
  1. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Chmod.java
  2. +7
    -3
      src/main/org/apache/tools/ant/taskdefs/Delete.java
  3. +5
    -1
      src/main/org/apache/tools/ant/taskdefs/Javac.java

+ 2
- 1
src/main/org/apache/tools/ant/taskdefs/Chmod.java View File

@@ -81,7 +81,8 @@ public class Chmod extends Task {
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


+ 7
- 3
src/main/org/apache/tools/ant/taskdefs/Delete.java View File

@@ -72,10 +72,14 @@ public class Delete extends Task {
}

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();
}
}
}
}


+ 5
- 1
src/main/org/apache/tools/ant/taskdefs/Javac.java View File

@@ -248,11 +248,15 @@ public class Javac extends MatchingTask {

/**
* 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();

for (int i = 0; i < files.length; i++) {


Loading…
Cancel
Save