ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Ant.java CallTarget.java
Date Mon, 24 Jul 2000 14:54:50 GMT
bodewig     00/07/24 07:54:49

  Modified:    src/main/org/apache/tools/ant ProjectHelper.java
               src/main/org/apache/tools/ant/taskdefs Ant.java
                        CallTarget.java
  Log:
  Didn't handle relative paths in project's basedir attribute correctly.
  Reported by:	<Glen_Stampoultzis@ansett.com.au>,
                  Jesse Glick <Jesse.Glick@netbeans.com>
  
  Revision  Changes    Path
  1.21      +1 -1      jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java
  
  Index: ProjectHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/ProjectHelper.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ProjectHelper.java	2000/07/13 15:23:03	1.20
  +++ ProjectHelper.java	2000/07/24 14:54:48	1.21
  @@ -233,7 +233,7 @@
               if (project.getProperty("basedir") != null) {
                   project.setBasedir(project.getProperty("basedir"));
               } else {
  -                project.setBasedir(baseDir);
  +                project.setBasedir((new File(buildFile.getParent(), baseDir)).getAbsolutePath());
               }
   
           }
  
  
  
  1.12      +10 -6     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java
  
  Index: Ant.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Ant.java	2000/07/21 14:24:35	1.11
  +++ Ant.java	2000/07/24 14:54:49	1.12
  @@ -79,7 +79,7 @@
    */
   public class Ant extends Task {
   
  -    private String dir = null;
  +    private File dir = null;
       private String antFile = null;
       private String target = null;
       private String output = null;
  @@ -154,12 +154,13 @@
                   reinit();
               }
           
  -            if( dir==null) dir=".";
  +            if(dir == null) 
  +                dir = project.getBaseDir();
   
               initializeProject();
   
  -            p1.setBasedir(dir);
  -            p1.setUserProperty("basedir" , dir);
  +            p1.setBaseDir(dir);
  +            p1.setUserProperty("basedir" , dir.getAbsolutePath());
               
               // Override with local-defined properties
               Enumeration e = properties.elements();
  @@ -168,8 +169,11 @@
                   p.init();
               }
               
  -            if (antFile == null) antFile = dir + "/build.xml";
  +            if (antFile == null) 
  +                antFile = "build.xml";
   
  +            antFile = (new File(dir, antFile)).getAbsolutePath();
  +
               p1.setUserProperty( "ant.file" , antFile );
               ProjectHelper.configureProject(p1, new File(antFile));
               
  @@ -184,7 +188,7 @@
           }
       }
   
  -    public void setDir(String d) {
  +    public void setDir(File d) {
           this.dir = d;
       }
   
  
  
  
  1.3       +1 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/CallTarget.java
  
  Index: CallTarget.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/CallTarget.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CallTarget.java	2000/07/21 13:35:46	1.2
  +++ CallTarget.java	2000/07/24 14:54:49	1.3
  @@ -97,7 +97,7 @@
                                        location);
           }
           
  -        delegate.setDir(".");
  +        delegate.setDir(project.getBaseDir());
           delegate.setAntfile(project.getProperty("ant.file"));
           delegate.setTarget(subTarget);
           delegate.execute();
  
  
  

Mime
View raw message