ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <>
Subject Re: problems with current working directory and <ant>
Date Tue, 15 Nov 2005 21:44:56 GMT
Hello Marc,

--- wrote:

> Hi,
> I've setup my project with cruisecontrol, so that my
> build.xml gets called
> from a parent directory.
How is your build.xml called exactly?

> The problem is that my unit tests that have relative
> paths in them all
> fail now because the current working directory is
> not the project root
> anymore.
If you use <ant> task, note that it has two important
[quote from Ant manual of <ant> task]
antfile - the buildfile to use. Defaults to
"build.xml". This file is expected to be a filename
relative to the dir attribute given.  

dir - the directory to use as a *basedir* for the new
Ant project. Defaults to the current *project's
basedir*, unless inheritall has been set to false, in
which case it doesn't have a default value. This will
override the basedir setting of the called project.
[end of qoute]

So if you want to reset the basedir of the subbuild
(the one called with <ant>) you do the following:
<ant dir="the_dir_of_subbuild" file="sub_build_file">

The directory against which the files used in
sub_build_file will be the_dir_of_subbuild. In short
you need to specify it in "dir" attribute of <ant>

Hope this helps.


Yahoo! FareChase: Search multiple travel sites in one click.

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

View raw message