<?xml version="1.0"?>

<project name="Apache JDO" default="site" basedir=".">

  <property file="${user.home}/.ant.properties" />
  <property file="${user.home}/build.properties" />
  <property file=".ant.properties" />

  <property name="ant.home" value="."/>
  <property name="debug" value="on"/>
  <property name="optimize" value="on"/>
  <property name="deprecation" value="off"/>

  <property name="docs.dest" value="docs"/>
  <property name="docs.src" value="xdocs"/>

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

  <!-- =================================================================== -->
  <!-- prints the environment                                              -->
  <!-- =================================================================== -->
  <target name="env">
    
    <echo message="java.home = ${java.home}"/>
    <echo message="user.home = ${user.home}"/>
    <echo message="java.class.path = ${java.class.path}"/>
    <echo message="docs.src = ${docs.src}"/>
    <echo message="docs.dest = ${docs.dest}"/>
    <echo message=""/>
  
  </target>

  <!-- =================================================================== -->
  <!-- Make HTML version of Apache JDO site                        -->
  <!-- =================================================================== -->

  <target name="site" 
          description="generates the HTML documentation"
          >
      <taskdef name="anakia"
          classname="org.apache.velocity.anakia.AnakiaTask">
          
          <classpath>
             <path refid="classpath"/>
          </classpath>

      </taskdef>

      <echo>
       #######################################################
       #
       #  Now using Anakia to transform our XML documentation
       #  to HTML.
       #
       #######################################################
      </echo>

      <anakia basedir="${docs.src}" destdir="${docs.dest}/"
           extension=".html" style="./site.vsl"
           projectFile="stylesheets/project.xml"
           excludes="**/stylesheets/** empty.xml"
           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"/>
              <include name="**/*.png"/>
          </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>

