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/04/01 16:25:07 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Exec.java

rubys       00/04/01 06:25:07

  Modified:    src/main/org/apache/tools/ant/taskdefs Exec.java
  Log:
  JavaDoc doesn't use basedir for sourcePath
  PR: 61
  Obtained from: will+ant@cs.cmu.edu
  
  Revision  Changes    Path
  1.9       +8 -5      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Exec.java
  
  Index: Exec.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Exec.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Exec.java	2000/02/06 21:16:57	1.8
  +++ Exec.java	2000/04/01 14:25:07	1.9
  @@ -67,7 +67,7 @@
   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 @@
               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 void setDir(String d) {
  -        this.dir = d;
  +        this.dir = project.resolveFile(d);
       }
   
       public void setOs(String os) {