ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <>
Subject Deferring references
Date Fri, 22 Sep 2006 14:00:52 GMT
Currently in ant, there is two steps in processing
a project build file, a parsing step and an execution
step. In the parsing step a DOM like structure of
Targets and UnknownElements are build up.
These targets and unknown elements are then processed
in the execution step. This model works quite ok.
One part that does not work like this is the processing
of the "id" attribute, these get processed at parsing

This has given rise to a lot of bugs and strange behaviour.

This type of bug will happen more as people write
larger build files (or equivalate using lots of <import> and <macrodef>)
and use shared build files.

I propose that we defer handing id's until the processing

The change to do this is very small.
Index: src/main/org/apache/tools/ant/helper/


--- src/main/org/apache/tools/ant/helper/    (revision

+++ src/main/org/apache/tools/ant/helper/    (working

@@ -1007,8 +1007,6 @@


-            context.configureId(task, attrs);
             if (parent != null) {
                 // Nested element
                 ((UnknownElement) parent).addChild(task);

I have have played a little with this and everthing seems
to work fine.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message