> The way to solve this is to put your <taskdef> declaration
> inside the <target> that builds yor <task> and then
> make the targets that use it to be dependant on that target.
>
> I am doing that right now and it works just great.

I'm very happy about this answer. However I can't completely figure out what
I'm doing wrong compared to your description. I've attached my build.xml to
this mail, and would appreciate very much if you could give me a hint on how
to work around this:

---8<---
Buildfile: build.xml

BUILD FAILED

Could not create task of type: transform because I can't find it in the list
of task class definitions
---8<---

Best regards, Madsie
<project name="Madsie" default="dist" basedir=".">

  <!-- set global properties for this build -->
  <property name="src" value="src" />
  <property name="build" value="build" />
  <property name="dist"  value="dist" />

  <property name="build.compiler" value="modern"/>

  <target name="prepare">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}" />
  </target>

  <target name="compile" depends="prepare">
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}" />
  </target>

  <target name="dist" depends="compile">
    <!-- Create the ${dist}/lib directory -->
    <mkdir dir="${dist}/lib" />

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}" />
  </target>

  <target name="clean">
    <!-- Delete the ${build} and ${dist} directory trees -->
    <deltree dir="${build}" />
    <deltree dir="${dist}" />
  </target>

  <target name="all" depends="collections,renderers,compile,javadoc">
  </target>

  <target name="prepareTransform">
    <!-- Make sure the XSLTransformTask is available -->
    <mkdir dir="${build}" />
    <javac srcdir="${src}/com/madsie/util/xsl/XSLTransformTask.java" destdir="${build}" />
    <taskdef name="transform" classname="com.madsie.util.xsl.XSLTransformTask"/>
  </target>

  <target name="collections" depends="prepareTransform">
    <transform srcdir="${src}/com/madsie/util/collections"
               destdir="${src}/com/madsie/util/collections"
               xsl="${src}/com/madsie/util/collections/ArrayList.xsl"
	       includes="*ArrayList.xml" />
  </target>

  <target name="renderers" depends="prepareTransform">
    <!-- Create normal triangle renderers -->
    <transform srcdir="${src}/com/madsie/graphics/software/triangle"
               destdir="${src}/com/madsie/graphics/software/triangle"
               xsl="${src}/com/madsie/graphics/software/triangle/Mappings.xsl;${src}/com/madsie/graphics/software/triangle/TriangleRenderer.xsl"
	       includes="*TriangleRenderer.xml"
	       excludes="*DitheredTriangleRenderer.xml,*BilinearTriangleRenderer.xml" />
    <!-- Create dithered triangle renderers -->
    <transform srcdir="${src}/com/madsie/graphics/software/triangle"
               destdir="${src}/com/madsie/graphics/software/triangle"
               xsl="${src}/com/madsie/graphics/software/triangle/Mappings.xsl;${src}/com/madsie/graphics/software/triangle/DitheredTriangleRenderer.xsl"
	       includes="*DitheredTriangleRenderer.xml" />
  </target>

  <target name="javadoc">
     <javadoc packagenames="com.madsie.vecmath.*,com.madsie.core.*,com.madsie.graphics.*,com.madsie.geometry.*,com.madsie.util.xsl.*,com.madsie.util.collections"
              sourcepath="src"
              destdir="doc/api"
              use="true"
              overview="src/com/madsie/overview.html"
              splitindex="true"
              windowtitle="Madsie corp. API Specification"
              doctitle="Madsie corp. API Specification"
              bottom="&lt;i&gt;Copyright &#169; 2000 Madsie Corp. All Rights Reserved.&lt;/i&gt;">
    </javadoc>
  </target>

</project>

Reply via email to