diff --git a/WHATSNEW b/WHATSNEW index f62683ff8..d27ce1743 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -19,8 +19,10 @@ org.apache.tools.ant to org.apache.tools.ant.types. Other changes: -------------- -* New tasks: sql, junit, mparse, execon. All except sql pending -documentation, most of them pending review. +* New tasks: sql, genkey, cab. + +* New tasks junit, mparse, execon. All pending documentation, most of +them pending review. * uses ClassLoader of its own in no-fork mode if a classpath is specified. @@ -55,3 +57,7 @@ respect to the Project's basedir. * Project didn't interpret the basedir attribute correctly in all cases. + +* Nested in caused NullPointerException. + +* Corrupt Zip- and Jar-files ar now deleted if the task fails. \ No newline at end of file diff --git a/src/main/org/apache/tools/ant/taskdefs/Exec.java b/src/main/org/apache/tools/ant/taskdefs/Exec.java index a07ed3906..fc39f2114 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Exec.java +++ b/src/main/org/apache/tools/ant/taskdefs/Exec.java @@ -62,6 +62,9 @@ import java.io.*; * * @author duncan@x180.com * @author rubys@us.ibm.com + * + * @deprected Instead of using this class, please extend ExecTask or + * delegate to Execute. */ public class Exec extends Task { private String os; diff --git a/src/main/org/apache/tools/ant/taskdefs/Execute.java b/src/main/org/apache/tools/ant/taskdefs/Execute.java index 255e9b4f9..314d5c7a8 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Execute.java +++ b/src/main/org/apache/tools/ant/taskdefs/Execute.java @@ -127,7 +127,8 @@ public class Execute { String[] commandLine = cmdl; if (workingDirectory != null && - !antWorkingDirectory.equals(workingDirectory.getAbsolutePath())) { + !antWorkingDirectory.equals(workingDirectory.getAbsolutePath()) && + !myos.equals("Mac OS")) { if (myos.toLowerCase().indexOf("windows") >= 0 && (myos.toLowerCase().indexOf("nt") >= 0 || @@ -200,6 +201,9 @@ public class Execute { * @param project the current project. */ public void setAntRun(Project project) throws BuildException { + if (myos.equals("Mac OS")) + return; + String ant = project.getProperty("ant.home"); if (ant == null) { throw new BuildException("Property 'ant.home' not found"); @@ -240,7 +244,19 @@ public class Execute { protected Process exec() throws IOException { - return Runtime.getRuntime().exec(getCommandline(), getEnvironment()); + String userDir = System.getProperty("user.dir"); + try { + if (myos.equals("Mac OS") && workingDirectory != null) { + System.getProperties().put("user.dir", + workingDirectory.getAbsolutePath()); + } + + return Runtime.getRuntime().exec(getCommandline(), getEnvironment()); + } finally { + if (myos.equals("Mac OS") && workingDirectory != null) { + System.getProperties().put("user.dir", userDir); + } + } } protected void waitFor(Process process) {