ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject dynamic taskdefs
Date Mon, 18 Sep 2000 14:22:51 GMT
Hi all,

the patch I've just committed should allow tasks to built and used in
the same buildfile. Something like

<target name="buildtask">
  <javac src="src/" dest="dest/" includes="org/example/" />
  <taskdef name="example" classname="org.example.Task">
      <pathelement location="dest/" />

<target name="usetask" depends="buildtask">
  <example ... />

should work now with one exception (see below). 

As a side effect you can put all kind of well formed XML into your
targets - as long as you don't try to execute those targets of course.
Ant's own build file now includes a <junit> task inside the runtests
target unconditionally - as long as you don't run this target Ant
won't complain even if you didn't install JUnit.

The exception: Dynamic loading of tasks from a classpath other than
the bootstrap class loader fails on JDK 1.1 (only checked with 1.1.7
on Linux) with a NoClassDefFoundError I haven't been able to pin down
yet. Any takers are welcome.


View raw message