ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@bost.de>
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/Task.java" />
  <taskdef name="example" classname="org.example.Task">
    <classpath>
      <pathelement location="dest/" />
    </classpath>
  </taskdef>
</target>

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

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.

Stefan

Mime
View raw message