<project name="build-site" default="docs" basedir=".">

    <!-- Initialization properties -->
    <property name="project.name"   value="ant"/>
    <property name="docs.src" value="./xdocs"/>
    <property name="docs.dest" value="./docs"/>

    <path id="anakia.classpath">
        <fileset dir="../../jakarta-site2/lib">
            <include name="*.jar"/>
        </fileset>
    </path>

    <target name="prepare">    
        <available classname="org.apache.velocity.anakia.AnakiaTask" 
                   property="AnakiaTask.present">
            <classpath refid="anakia.classpath"/>
        </available>
    </target>

    <target depends="prepare" name="prepare-error" unless="AnakiaTask.present">
        <echo>
            AnakiaTask is not present! Please check to make sure that 
            velocity.jar is in your classpath.
        </echo>
    </target>

    <target name="docs" depends="prepare-error" if="AnakiaTask.present">
        <taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask">
            <classpath refid="anakia.classpath"/>
        </taskdef>
        
        <anakia basedir="${docs.src}" destdir="${docs.dest}/"
             extension=".html" style="./site.vsl"
             projectFile="stylesheets/project.xml"
             excludes="**/stylesheets/** faq.xml"
             includes="**/*.xml"
             lastModifiedCheck="true"
             templatePath="./xdocs/stylesheets">
        </anakia>

        <anakia basedir="${docs.src}" destdir="${docs.dest}/"
             extension=".html" style="./faq.vsl"
             projectFile="stylesheets/project.xml"
             includes="faq.xml"
             lastModifiedCheck="true"
             templatePath="./xdocs/stylesheets">
        </anakia>

        <!-- In case we have images some day
        <copy todir="${docs.dest}/images" filtering="no">
            <fileset dir="${docs.src}/images">
                <include name="**/*.gif"/>
                <include name="**/*.jpeg"/>
                <include name="**/*.jpg"/>
            </fileset>
        </copy>
        -->
        <!-- In case we have CSS someday
        <copy todir="${docs.dest}" filtering="no">
            <fileset dir="${docs.src}">
                <include name="**/*.css"/>
            </fileset>
        </copy>
        -->
    </target>
</project>
