Targets do not execute in any directory... Ant executes within a JVM which
is executed from the current directory. Targets contain tasks (which are
usually implemented in pure Java) that execute within that JVM. These tasks
are configured to operate on specified directories explicitly (or implicitly
based on the global 'basedir', which cannot be overridden), but usually do
not care which current directory ant is running from (the basedir attribute
is the key info!).

That said, there are a few tasks that fork a new JVM or another process, for
which the current directory could matter, but beside <exec>/<apply>, I doubt
many other tasks of Ant Core are influenced by the working dir.

Not knowing what you 'execute', it's hard to say much more. I hope this
helps though. --DD

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 17, 2002 9:06 AM
To: [EMAIL PROTECTED]
Subject: Changing directory calling a target

Hello, 

I'm new to Ant, so please excuse me for this basic question.

I have a target A that calls a target B (A and B are in the same file),
 and whereas the target A executes into the directory FOO, 
I'd like the target B to be executed into the directory BAR.

I tried to override the basedir (with the value BAR), after setting the 
inheritAll property to false, but the overriding is ignored.

How can I do that? I got something working putting the target B
into another file, but I'd like to avoid using this solution which I 
found very ugly.

        Thank you

                PaScaL

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to