ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From will wang <>
Subject Relative path in the "executable" attribute in <exec>
Date Sat, 12 Mar 2005 09:23:06 GMT
I'm not sure if this is bug or intentional.  The path
to the executable specified in the "executable"
attribute of <exec> seems to be calculated from the
directory where ANT is invoked, rather than the
basedir of the build file where the <exec> task

For example, say we have the directory structure,


and say ./dir1/build.xml contains the exec task,

<exec executable="../some.exe"/>

If we are in ./dir1 and execute 'ant', then this works
fine because the working directory of the ant
*process*  is ./dir1, and thus ./dir1/../some.exe ==

Now if we are in ./dir1/dir2, and execute 'ant -f
../build.xml', then some.exe will not be found,
this time, the working directory of the ant *process*
is ./dir1/dir2 and thus ./dir1/dir2/../some.exe ==
./dir1/some.exe == No Such a File.

Basically, instead of using the BASEDIR of the ant
*build file* to calculate the path to the executable,
<exec> is using the WORKING DIRECTORY of the ant

Is this the expected behavior?  I'm willing to make
the fix if we do deem it a bug.


Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site! 

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

View raw message