ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject Re: [PATCH] basedir for child project not set correctly from <ant> task
Date Mon, 22 Oct 2001 08:14:14 GMT
This really looks like a bug to me. After all if you really want to change
the basedir you can always say:

    <ant ... >
        <param name="basedir" value="newdir" />
    </ant>

which by definition should take precedence over basedir as defined in the buildfile.

Passing "dir='somedir'" should be just a shortcut for "file='somedir/build.xml'" which
should be equivalent to executing "ant -f fullpath/somedir/build.xml".

Jose Alberto
----- Original Message ----- 
From: "David Sitsky" <sits@users.sourceforge.net>
To: <ant-dev@jakarta.apache.org>
Sent: Sunday, October 21, 2001 10:40 PM
Subject: Re: [PATCH] basedir for child project not set correctly from <ant> task


> > - 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