ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <>
Subject Order of attributes versus elements
Date Fri, 01 Mar 2002 11:43:44 GMT
I have been debugging a mutant Gump error. The cause is pretty 
interesting. The build in question, jakarta-avalon-excalibur, assumes 
that nested Elements are created/configured before attributes are set. 
This is never true in mutant and so it causes a build problem. It is at 
least sometimes true in Ant1, but I don't think it is always true. I'd 
appreciate opinions on whether this is something Ant should guarantee.

The construction in question is here (slightly edited)


     <javac srcdir="${java.dir}"
       <classpath refid="project.class.path" />
       <src path="${build.src}"/>

The copy operation replaces some tokens to enable or disable JDBC3 
compilation. Note that the Java file in question is explicitly excluded 
from the compilation but this has no effect as the compiler brings it in 
anyway to satisfy dependencies. This build relies on the <src> element 
being created before the "srcdir" attribute is set to ensure the 
compiler picks up the filtered code and not the unfiltered original.

Actually my expectation was that Ant1 would also set attributes first 
but the RuntimeConfigurable comes into play. Interestingly attribute 
setting is deferred to runtime but nested element creation is not. Hmmm. 
Also, for top-level tasks, it is the other way around.

Anyway, I'd appreciate some thoughts on whether there should be a 
defined order of attribute setting versus element creation.  Should this 
be specified in Ant1? How about Ant2? Alternatively, should it be left 
undefined? In that case Build files which rely on any particular order 
would be considered defective even if they happened to work

Anyway, IMHO, I think this buildfile is broken.



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message