From 9fd8da35d2835bffe3246164c09d0d2599ad6b44 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Sat, 1 Apr 2000 14:25:07 +0000 Subject: [PATCH] JavaDoc doesn't use basedir for sourcePath PR: 61 Obtained from: will+ant@cs.cmu.edu git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267648 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Exec.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Exec.java b/src/main/org/apache/tools/ant/taskdefs/Exec.java index b34447ad4..6bbcfc2d9 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Exec.java +++ b/src/main/org/apache/tools/ant/taskdefs/Exec.java @@ -67,7 +67,7 @@ import java.io.*; public class Exec extends Task { private String os; private String out; - private String dir = "."; + private File dir; private String command; private static final int BUFFER_SIZE = 512; @@ -89,15 +89,18 @@ public class Exec extends Task { return 0; } + // default directory to the project's base directory + if (dir == null) dir = project.getBaseDir(); + if (myos.toLowerCase().indexOf("windows") >= 0) { - if (!dir.equals(".")) - command = "cmd /c cd " + project.resolveFile(dir) + " && " + command; + if (!dir.equals(project.resolveFile("."))) + command = "cmd /c cd " + dir + " && " + command; } else { String ant = project.getProperty("ant.home"); if (ant == null) throw new BuildException("Property 'ant.home' not found"); String antRun = project.resolveFile(ant + "/bin/antRun").toString(); - command = antRun + " " + project.resolveFile(dir) + " " + command; + command = antRun + " " + dir + " " + command; } try { @@ -145,7 +148,7 @@ public class Exec extends Task { } public void setDir(String d) { - this.dir = d; + this.dir = project.resolveFile(d); } public void setOs(String os) {