ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Sonntag" <>
Subject Problems with the "ant" task
Date Wed, 09 Aug 2000 22:08:37 GMT
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 name="all" depends="init">
  <ant dir="${basedir}/test"/>
  <ant dir="test"/>

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

View raw message