You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Steve Sonntag <VT...@novell.com> on 2000/08/10 00:08:37 UTC

Problems with the "ant" task

Perhaps someone can tell me if this is a bug, or a pilot error.

dir="whatever" in the ant task seems to be relative to the
working directory "${user.dir} and not "${basedir}"  This means that
in order to get ant tasks to work consistently, ${basedir} 
must be added to paths specified in dir="whatever".  This
is due to the fact that as you go deeper into a nested directory
structure, although ${basedir} points to the correct directory,
the working directory is still the initial starting point.

If you take the following antfile and nest it multiple levels deep,
you will readily see the problem.  After the first level, it will
fail on the second ant task line.  If you go to that directory
and run it, it will work.

<project name="anttest" default="all" basedir=".">
 <property name="name" value="anttest"/>
 <target name="init">
  <echo message="${name}: pwd=${user.dir}"/>
  <echo message="${name}: basedir=${basedir}"/>
 </target>

 <target name="all" depends="init">
  <ant dir="${basedir}/test"/>
  <ant dir="test"/>
 </target>
</project>	






------------------------
Steve Sonntag
Novell, Inc., the leading provider of Net services software

Re: Problems with the "ant" task

Posted by Peter Donald <do...@mad.scientist.com>.
I believe this problem was fixed a while back in ant task. (Still present
in a few other tasks thou). Which version are you using ? CVS or released ?
If CVS what day is it ?
Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*