<project name="generate-jdk4-pom"
     default="generate-xdocs">

  <target name="generate-xdocs">
    <path id="tools.classpath">
      <fileset dir="${lib}">
        <include name="pmd-build-*.jar"/>
      </fileset>
    </path>

    <taskdef name="pmd-build"
       classname="net.sourceforge.pmd.ant.PmdBuildTask">
      <classpath refid="tools.classpath"/>
    </taskdef>
    <echo>Generating documentation into ${target}, into ${rules.src}</echo>
    <mkdir       dir="${target}"/>
    <pmd-build   siteXml="${siteXml}"
                 rulesDirectory="${rules.src}"
                 target="${target}"/>
   </target>

   <!--
     Unit test of this task

     Should be run from tools/ant directory
   -->
   <target name="test">

     <antcall target="generate-xdocs">
       <param name="target"    value="target-test"/>
       <param name="lib"       value="../lib"/>
       <param name="rules.src" value="../../src/site/xdocs"/>
     </antcall>
   </target>

</project>
