You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ma...@mdumontier.com on 2005/11/15 21:35:40 UTC

problems with current working directory and

Hi,

I've setup my project with cruisecontrol, so that my build.xml gets called
from a parent directory.

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.

Is there anyway to change directories from within ant? or what would be
the right solution to this problem.

thanks,
Marc Dumontier



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


Re: problems with current working directory and

Posted by ma...@mdumontier.com.
yes, that fixed my problem

thank you


> Have you tried playing around with the antworkingdir property in your
> CruiseControl config.xml file?  Maybe have it point to your parent
> directory and then put a sub-directory in the buildfile property.
>
> marc@mdumontier.com wrote:  Hi,
>
> I've setup my project with cruisecontrol, so that my build.xml gets called
> from a parent directory.
>
> 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.
>
> Is there anyway to change directories from within ant? or what would be
> the right solution to this problem.
>
> thanks,
> Marc Dumontier
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>
>
>
>
>
> ---------------------------------
>  Yahoo! FareChase - Search multiple travel sites in one click.



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


Re: problems with current working directory and

Posted by Ninju Bohra <ni...@yahoo.com>.
Have you tried playing around with the antworkingdir property in your CruiseControl config.xml file?  Maybe have it point to your parent directory and then put a sub-directory in the buildfile property.

marc@mdumontier.com wrote:  Hi,

I've setup my project with cruisecontrol, so that my build.xml gets called
from a parent directory.

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.

Is there anyway to change directories from within ant? or what would be
the right solution to this problem.

thanks,
Marc Dumontier



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







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

Re: problems with current working directory and

Posted by Ivan Ivanov <ra...@yahoo.com>.
Hello Marc,

--- marc@mdumontier.com 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
attribuites:
[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>
task.

Hope this helps.

Regards
Ivan


		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

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