ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sitsky <s...@users.sourceforge.net>
Subject Re: [PATCH] basedir for child project not set correctly from <ant> task
Date Sun, 21 Oct 2001 21:40:31 GMT
> - if you pass dir="...", that is the basedir you will get; this is
> documented in the <ant/> page, though it should be emphasized there that
> the subproject's basedir attr is ignored
>
> - (note that the default script is then ${thatdir}/build.xml--docs say
> default is "build.xml" but do not clarify that this is relative to the
> passed-in dir)
>
> - if you pass antfile="...", you can specify e.g. "zotdir/build.xml" but
> then the basedir is inherited from the current project (!)
>
> - you can pass both if you want
>
> As far as I can tell, there is no way to do the thing which I at least
> would 95% of the time want to do: run a specific build script and ask Ant
> to give it the basedir it specifies for itself (without hardcoding this
> into the calling script).

I would have thought this is what most users would be wanting too.  For all 
of my own "nested" buildfiles,  I had basedir="." and always called them 
using the "dir" attribute in the <ant> task.  I didn't realise basedir in the 
nested task is ignored in this circumstance (my fault for not reading the 
manual properly).

I came across this situation, because I was calling a third-party 
component (src/build/build.xml in their distribution) with their own build 
file that set "../.." as their basedir.

I find it a little odd that I need to have knowledge of a build file's 
basedir and set it appropriately in the _calling_ buildfile in order to call 
it properly.  If the distribution build file changes their basedir, it means 
all build files which call it also need to be changed.

Thanks for the explanation.

Cheers,
David

Mime
View raw message