I think I've found a bug in the <ant> task.
I've tried both of the following in my main build file to pass the <path>
references to the sub-build with <ant>
<ant antfile="build-contrib.xml" target="control" inheritRefs="true" />
and
<ant antfile="build-contrib.xml" target="control" >
<reference refid="build.classpath" />
</ant>
But in my build-contrib.xml file, when I reference "build.classpath", which
I've defined as a <path id="build.classpath"> in my main build, using
something like <classpath refid="build.classpath" />, I get the following
error....
BUILD FAILED
file:D:/myclasses/repository/Barracuda_2002-09-06/Barracuda/src/build.xml:895:
Reference build.classpath not found.
One curious thing to note here is that the error happens at the line of my
<ant ...> call in the main build file whereas the error is actually
happening on line 38 in my build-contrib.xml where I have <classpath
refid="build.classpath" />.
What I've done to work around this is create a <path id="build.classpath">
inside my subbuild and that works for most things. However, when I try to
use the <foreach> task from the ant-contrib project when I initialize the
it with a <taskdef> such as the following...
<taskdef resource="net/sf/antcontrib/antcontrib.properties" >
<classpath refid="build.classpath" />
</taskdef>
I end up getting a really weird error like this:
BUILD FAILED
file:D:/myclasses/repository/Barracuda_2002-09-06/Barracuda/src/build-contrib.xm
l:198:
D:\myclasses\repository\Barracuda_2002-09-06\Barracuda\src\${build.lib.dir}
not found.
The only place ${build.lib.dir} is referenced (as far as <foreach> is
concerned) is in a <fileset> nested inside the original
<path id="build.classpath"> in my main build file which looks like this...
<path id="build.classpath">
<!-- development libraries -->
<fileset dir="${build.lib.dir}" >
<include name="*.jar" />
<exclude name="${jar.all.name}" />
<exclude name="${jar.config.name}" />
<exclude name="${jar.admin.name}" />
</fileset>
<!-- other development libraries -->
<fileset dir="${build.jar.dir}" >
<include name="*.jar" />
</fileset>
</path>
How this is happening, I have no idea???
The <foreach> badness is fixed if I just put the ant-contrib.jar into
$ANT_HOME/lib and leave out the nested <classpath> element inside the
<taskdef> definition for ant-contrib like this...
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
Another odd thing is that the <if> task works just fine with the nested
<classpath> inside the <taskdef>. It is just the <foreach> that doesn't work.
Anyone know what is going on here? There are a few different bugs I've
described, but they all seem to boil down to one root cause, which is <ant>
not passing the ref's properly.
help!
Jake
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>