ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colin Sampaleanu <colin...@exis.com>
Subject Re: How can tasks in 'imported' build files know the basedir of the imported file itsef?
Date Tue, 30 Dec 2003 15:57:57 GMT
To answer my own question, there is a slightly indirect solution, by 
using the <dirname> task to define a new property which contains just 
the dir from the ant.file property...

    <dirname property="ant.file.dir" file="${ant.file.<name>}"/>


Colin Sampaleanu wrote:

> When you import another build file via the new 1.6 import task, 
> special properties
>    ant.file.<name>
>    ant.version.<name>
> and so on are created, where <name> is the name attribute from the 
> imported build file.
>
> Now ant.file.<name> may be used by tasks within the imported build 
> file to refer to the imported build file itself, but I want to refer 
> to the base directly in which the imported build file is located. 
> Unfortunately, there seems to be no
>  basedir.<name>
> property defined. If the imported code just uses ${basedir}, it gets 
> the basedir of whoever imported it, which is not what I want.
>
> Can anybody point out a way to get at the base directory of the build 
> file?
>
> Regards,
> Colin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>



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


Mime
View raw message