<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
    Copyright 2005 The Apache Software Foundation

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!-- $Rev$ $Date$ -->

<project default="default"
    xmlns:j="jelly:core"
    xmlns:u="jelly:util"
    xmlns:ant="jelly:ant"
    xmlns:define="jelly:define"
    xmlns:velocity="jelly:velocity"
    xmlns:artifact="artifact"
    xmlns:m="jelly:maven"
    >
    <goal name="default">
        <attainGoal name="build"/>
    </goal>
    <goal name="build">
        <attainGoal name="qtags"/>
        <attainGoal name="jar:install"/>
    </goal>
    <goal name="rebuild">
        <attainGoal name="clean"/>
        <attainGoal name="build"/>
    </goal>
    <goal name="qtags">
        <mkdir dir="${basedir}/target/src"/>
        <path id="xdoclet.generated.path" location="${basedir}/target/src"/>
        <m:addPath id="maven.compile.src.set" refid="xdoclet.generated.path"/>

        <path id="xdoclet.task.classpath">
        <pathelement location="${basedir}/target/classes"/>
        <path refid="maven.dependency.classpath"/>
        </path>

        <taskdef
        name="xdoclet"
        classname="org.xdoclet.ant.XDocletTask"
        classpathref="xdoclet.task.classpath"
        />

        <xdoclet>
            <fileset dir="${pom.build.sourceDirectory}">
                <include name="**/*.java"/>
            </fileset>

            <component classname="org.generama.VelocityTemplateEngine"/>
            <component classname="org.generama.JellyTemplateEngine"/>
            <component
            classname="org.xdoclet.plugin.qtags.impl.QTagImplPlugin"
            destdir="${basedir}/target/src"
            />
            <component
            classname="org.xdoclet.plugin.qtags.impl.QTagLibraryPlugin"
            destdir="${basedir}/target/src"
            packagereplace="org.apache.geronimo.devtools.xdoclet2.qtags"
            />
            <component
            classname="org.xdoclet.plugin.qtags.xdoc.QTagXDocPlugin"
            destdir="${basedir}/target/generated-xdocs"
            namespace="${xdoclet.qtags.namespace}"
            />
            <component
            classname="org.xdoclet.plugin.qtags.confluence.QTagConfluencePlugin"
            destdir="${basedir}/target/confluence"
            namespace="${xdoclet.qtags.namespace}"
            />
        </xdoclet>
    </goal>
    <goal name="xdoclet2">
        <taskdef name="xdoclet" classname="org.xdoclet.ant.XDocletTask" 
        classpathref="maven.dependency.classpath" />
        <xdoclet>
            <fileset dir="${pom.build.sourceDirectory}">
                <include name="**/*.java"/>
            </fileset>
            <component classname="org.apache.geronimo.devtools.xdoclet2.GeronimoConfigPlugin" 
            destdir="${maven.build.dir}/xdoclet"/>
        </xdoclet>
    </goal>
    <preGoal name="java:compile">
        <path id="maven.compile.src.set">
            <pathelement location="src/java"/>
            <pathelement location="target/src"/>
            <!-- pathelement location="${maven.build.dir}/xdoclet"/ -->
        </path>
        <!-- attainGoal name="xdoclet"/ -->
    </preGoal>
</project>
