<?xml version="1.0"?>

<!-- ===================================================================

   Build file for rdfapi

Notes:
   This is a build file for use with the Jakarta Ant build tool.

Prerequisites:

   jakarta-ant from http://jakarta.apache.org

Build Instructions:
   To build, run

     java org.apache.tools.ant.Main <target>

   on the directory where this file is located with the target you want.

Most useful targets:

 - compile  -> compile classes package in "./${build.dir}/classes"
 - jar      -> jar the classes to "${build.lib}/${name}.jar"
 - javadocs -> creates the javadocs in "./${build.dir}/javadocs"
 - dist     -> creates the complete binary distribution

Authors:

  David Li <david@d11e.com>

Copyright:
  Copyright 2000 (c) DigitalSesame 

   $Id: build.xml,v 1.1.2.2 2000/12/09 08:55:47 david Exp $

==================================================================== -->

<project default="jar" basedir=".">

  <!-- =================================================================== -->
  <!-- Initialize the environment                                          -->
  <!-- =================================================================== -->
  <target name="init">
    <property name="app.name" value="rdfapi"/>
    <property name="app.Name" value="rdfapi"/>
    <property name="app.version" value="20001205"/>
    <property name="year" value="2000"/>

    <property name="build.compiler" value="classic"/>
    <property name="debug" value="off"/>

    <property name="src.dir" value="src"/>
    <property name="doc.dir" value="doc"/>
    <property name="examples.dir" value="${src.dir}/examples"/>

    <property name="packages" value="org.*,edu.*"/>

    <property name="build.dir"      value="ant.build"/>
    <property name="build.classes"  value="${build.dir}/classes"/>
    <property name="build.lib"      value="${build.dir}/lib"/>
    <property name="build.javadocs" value="${build.dir}/javadocs"/>
    <property name="build.jar"      value="${build.lib}/${app.name}.jar"/>

    <property name="dist.dir"      value="${build.dir}/${app.Name}-${app.version}"/>
    <property name="dist.doc"      value="${dist.dir}/doc"/>
    <property name="dist.lib"      value="${dist.dir}/lib"/>
    <property name="dist.javadocs" value="${dist.dir}/javadocs"/>

  </target>

  <!-- =================================================================== -->
  <!-- Prepares the build directory                                        -->
  <!-- =================================================================== -->
  <target name="prepare" depends="init">
    <mkdir dir="${build.dir}"/>
    <mkdir dir="${build.classes}"/>
    <mkdir dir="${build.lib}"/>
    <mkdir dir="${build.javadocs}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Compiles the source directory                                       -->
  <!-- =================================================================== -->
  <target name="compile" depends="prepare">
    <javac srcdir="${src.dir}" 
	   destdir="${build.classes}"
	   debug="${debug}"
	   excludes="org/w3c/rdf/util/RDFDigestUtil.java"
	   />
  </target>

  <!-- =================================================================== -->
  <!-- Jar the classes                                                     -->
  <!-- =================================================================== -->
  <target name="jar" depends="compile">
    <mkdir dir="${build.lib}"/>
    <jar jarfile="${build.jar}" basedir="${build.classes}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Creates the API documentation                                       -->
  <!-- =================================================================== -->
  <target name="javadocs" depends="prepare">
    <mkdir dir="${build.javadocs}"/>
    <javadoc packagenames="${packages}"
	     sourcepath="${src.dir}"
             destdir="${build.javadocs}"
             author="true"
             version="true"
             use="true"
             windowtitle="${app.Name} API"
             doctitle="${app.Name}"
             bottom="Copyright &#169; ${year}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Creates the binary distribution                                            -->
  <!-- =================================================================== -->
  <target name="dist" depends="jar, javadocs">
    <copy todir="${dist.javadocs}">
      <fileset dir="${build.javadocs}"/>
    </copy>
    <copy todir="${dist.lib}">
      <fileset dir="${build.lib}"/>
    </copy>
    <copy todir="${dist.doc}">
      <fileset dir="${doc.dir}"/>
    </copy>
  </target>

  <!-- =================================================================== -->
  <!-- Cleans everything                                                   -->
  <!-- =================================================================== -->
  <target name="clean" depends="init">
    <delete dir="${dist.dir}"/>
    <delete dir="${build.dir}"/>
  </target>

</project>
