ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: circular <import>s
Date Wed, 17 Sep 2003 12:07:11 GMT
Stefan Bodewig wrote:
> Currently a build.xml with
> 
> <project>
>   <import file="build.xml"/>
> </project>
> 
> will print a warning "Skipped already imported file build.xml" and end
> as a successful build after executing the import once.

Correct.

> I feel this is wrong for two reasons:
> 
> (1) The current build file (the one intially loaded) should be added
> to the list of already imported files implicitly so it doesn't get
> loaded twice at all.
>
> (2) circular imports look like a bug to me - the build should fail.

This is the only possible issue. The decision on this point will 
automatically define number 1.

> I understand that unrelated imports should be handled gracefully,
> i.e. if A imports B and C and B and C both import D, this is OK.  But
> a circular import is different from that to me.

As it stands now, there is no such concept as circular imports. You have 
circularity when things gets nested, but in this case there is no nesting.

What happens is that if at least one of the buildfiles asks to import a 
file, that file is added to the list, and other requests are ignored.

So the current behaviour is correct given the actual -flat- import rules.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message