Stephane Bailliez wrote:

I need some explanation about <ant> task and the recent introduction of
inheritall.

It looks like to me that it prevents the called ant file to define its
basedir whether or not inheritall is true/false. Therefore all definitions
that occurs inside the build file are based on the parent basedir and not
the called one.

I always have:
"Override ignored for user property basedir"

Is that the defined behavior ?

It would have been useful so that I can set an external repository of
properties and path that are resolved relative to the called file. Though
I'm walking a little bit on 'build include' side :)

Stephane:

Enclosed please find a tiny patch that resolves the issue you noted above. This is
a resubmission against the very latest CVS version. Stephane-- does this address
your problem? I doubt there are many people using this precise combination of
settings.... is this therefore a good bet for 1.4.1?


Thanks,

--Craeg
Index: Ant.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v
retrieving revision 1.28
diff -u -r1.28 Ant.java
--- Ant.java    2001/09/30 13:21:53     1.28
+++ Ant.java    2001/10/01 18:31:09
@@ -224,15 +224,18 @@
                 reinit();
             }
         
-            if (dir == null) {
+            if ( (dir == null) && (inheritAll == true) )
                 dir = project.getBaseDir();
+
+            if (dir != null) {
+                newProject.setBaseDir(dir);
+                newProject.setUserProperty("basedir" , dir.getAbsolutePath());
+            } else {
+                dir = project.getBaseDir();
             }
 
             initializeProject();
 
-            newProject.setBaseDir(dir);
-            newProject.setUserProperty("basedir" , dir.getAbsolutePath());
-            
             // Override with local-defined properties
             Enumeration e = properties.elements();
             while (e.hasMoreElements()) {

Reply via email to