ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Ant.java
Date Fri, 26 Oct 2001 11:50:37 GMT
Hi,

The diff below has seemed to break a whole bunch of my build files and I am 
not imediately sure why. One particular example was demonstrated in gumps 
runs of late for one of the Avalon projects (see 
<http://jakarta.apache.org/builds/gump/2001-10-25/jakarta-avalon-cornerstone.html>).

This is contained in a build file in a subdirectory to call back to main 
build file. It previously worked but no longer does.

<ant antfile="build.xml" dir="../.." target="compile" inheritall="false"/>

What happens is that the base build.xml inherits the current projects basedir 
and does not use it's own, nor does it use the dir passed in. 

So what am I missing?

On Tue, 23 Oct 2001 22:15, bodewig@apache.org wrote:
> bodewig     01/10/23 05:15:46
>
>   Modified:    .        WHATSNEW
>                src/main/org/apache/tools/ant/taskdefs Ant.java
>   Log:
>   Only override subbuild's basedir if inheritall has been set to false.
>
>   Submitted by:	Craeg K. Strong <cstrong@arielpartners.com>
...snip...
>   1.29      +11 -4    
> 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.28
>   retrieving revision 1.29
>   diff -u -r1.28 -r1.29
>   --- Ant.java	2001/09/30 13:21:53	1.28
>   +++ Ant.java	2001/10/23 12:15:46	1.29
>   @@ -160,6 +160,10 @@
>            Enumeration et = taskdefs.keys();
>            while (et.hasMoreElements()) {
>                String taskName = (String) et.nextElement();
>   +            if (taskName.equals("property")) {
>   +                // we have already added this taskdef in #init
>   +                continue;
>   +            }
>                Class taskClass = (Class) taskdefs.get(taskName);
>                newProject.addTaskDefinition(taskName, taskClass);
>            }
>   @@ -224,15 +228,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()) {

-- 
Cheers,

Pete

"Artists can color the sky red because they know it's blue.  Those of us who
 aren't artists must color things the way they really are or people might 
 think we're stupid." -- Jules Feiffer 

Mime
View raw message