ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From will wang <teler...@yahoo.com>
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
belongs.  

For example, say we have the directory structure,

./some.exe
./dir1/build.xml
./dir1/dir2

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 ==
./some.exe.

Now if we are in ./dir1/dir2, and execute 'ant -f
../build.xml', then some.exe will not be found,
because  
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
*process*.

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

Thanks,
Will




		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

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


Mime
View raw message