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

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

    <!-- Build classpath -->
    <path id="classpath">
        <fileset dir="../../../build/lib">
            <include name="**/*.jar"/>
        </fileset>
        <fileset dir="../../../bin">
            <include name="**/*.jar"/>
        </fileset>
    </path>

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

        <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>
