You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Conor MacNeill <co...@cortexebusiness.com.au> on 2003/01/08 07:33:34 UTC

Improt task and project basedir

The import task does not currently use the project basedir to resolve import 
files. So, the following does not work as I would have expected

<project default="test" basedir="..">
   <import file="base2/base2.xml"/>

   <echo message="base1.xml"/>
</project>

Is this desirable?

Conor


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Improt task and project basedir

Posted by Costin Manolache <cm...@yahoo.com>.
Conor MacNeill wrote:

> Costin Manolache wrote:
>> 
>> No, the basedir was lost during the refactoring, it used to be
>> extracted from the sax context.
>> 
>> Since Import is a task - the easiest is to change to
>> setFile( File ). I can't work on this right now - I'll try tommorow.
>> 
> 
> Consider then
> 
> project1 ---> import project2 ---> import project3
> 
> Project2 will specify project3 relative to its basedir. The above approach
> will, I think, load the project relative to project1's basedir which would
> be wrong.
> 
> It must be in the context, I think.

You're right - setFile(File) won't work. It needs the base dir of 
the "current" project. It needs to be in a stack ( i.e. part of the
abstraction in ProjectHelper ). 

Costin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Improt task and project basedir

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Costin Manolache wrote:
> 
> No, the basedir was lost during the refactoring, it used to be
> extracted from the sax context.
> 
> Since Import is a task - the easiest is to change to 
> setFile( File ). I can't work on this right now - I'll try tommorow.
> 

Consider then

project1 ---> import project2 ---> import project3

Project2 will specify project3 relative to its basedir. The above approach 
will, I think, load the project relative to project1's basedir which would 
be wrong.

It must be in the context, I think.

Conor



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Improt task and project basedir

Posted by Costin Manolache <cm...@yahoo.com>.
Conor MacNeill wrote:

> The import task does not currently use the project basedir to resolve
> import files. So, the following does not work as I would have expected
> 
> <project default="test" basedir="..">
>    <import file="base2/base2.xml"/>
> 
>    <echo message="base1.xml"/>
> </project>
> 
> Is this desirable?

No, the basedir was lost during the refactoring, it used to be
extracted from the sax context.

Since Import is a task - the easiest is to change to 
setFile( File ). I can't work on this right now - I'll try tommorow.

Costin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>