ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <>
Subject Re: ant 1.5.4 : Import
Date Thu, 24 Jul 2003 12:26:21 GMT

Conor MacNeill wrote, On 24/07/2003 13.36:

> On Thu, 24 Jul 2003 07:19 pm, peter reilly wrote:
>>What are the issues with import.
>>I think we should write them down and deal with
>>them - it cannot be that difficult..
>>The difficult ones (manipulation of basebir etc)
>>we should explicitly defer to ant > 1.6.
> Not difficult but the issues are there.
> The renaming of overridden targets depends on project names but lots of 
> projects don't have names. I believe the name can be provided in the import 
> task to access overridden targets in unnamed projects and also to handle name 
> collisions. 

What about:

  <import file="blah.xml" name="blah"/>

>Probably would require creation of the parsing context in the 
> import task.


> The basedir issue :-). I'd rather get it right in 1.6 than create a backward 
> compatibility issue down the track. Got enough of those to deal with already. 
> Import file resolution must be done relative to the basedir of the project 
> doing the import, regardless of whether that is the outermost project.
> For example,
> <project basedir="..">
>   <import file="base2/build.xml"/>
>   <echo message="base1/build.xml"/>
> </project>
> This will not work:
> Cannot find base2/build.xml imported from base1/build.xml
> I've attached a small zip (will it make it through email?). I believe all 3 
> builds should work as you would expect. Currently only the one without 
> imports does.

In base1/build.xml I changed the import to:

   <import file="../base2/build.xml"/>

And it works.

So IIUC it's really only about making the import task resolve files 
relative to the basedir of the project that imports, as you say above.

> Telling people only to use absolute imports is not acceptable, IMHO.

IMHO what you propose is the correct behaviour, and the one that users 
(me too) would think should happen (least surprise rule).

>>import is a real cool feature.
> Sure enough and also important enough to get right.


Nicola Ken Barozzi         
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)

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

View raw message