<project name="sc00tests" default="main" basedir=".">

  <target name="init">
    <property name="project" value="sc00tests" />

    <property name="source" value="src" />
    <property name="tests" value="${source}/tests" />
    <property name="nexustests" value="../nexusrmitests" />
    <property name="etc" value="${source}/etc" />
    <property name="build" value="build" />
    <property name="classes" value="${build}/classes" />
    <property name="lib" value="lib" />
    <property name="doc" value="${source}/doc" />

    <property name="classpath" value="${classpath}:${classes}" />
    <!--property name="build.compiler" file="classic" /-->
    <!--property name="build.compiler.emacs" file="true" /-->
    <property name="deprecation" value="false" />
    <property file="${etc}/VERSION" />
    <property name="archive" value="${project}-${version}" />
  </target>


  <!-- Display all the targets -->
  <target name="targets">
    <echo message=""/>
    <echo message="ANT build for ${project} ${version}"/>
    <echo message=""/>
    <echo message="The following targets are available:"/>
    <echo message="  targets       Lists the build targets"/>
    <echo message="  clean         Cleans the build and distribution directories"/>
    <echo message="  all           Cleans and builds all tests"/>
    <echo message="  tests         Builds the test packages (including debugging info)"/>
    <echo message="  nexustests    Builds the nexus tests (including debugging info)"/>
    <echo message=""/>
  </target>


  <!-- Prepare target directories -->
  <target name="prepare">
    <mkdir dir="${build}"/>
    <mkdir dir="${classes}"/>
    <mkdir dir="${nexustests}/classes"/>
    <copyfile src="${etc}/tests.properties" dest="${classes}/tests.properties" />  
  </target>

  <!-- Kill all the directories created in prepare -->
  <target name="clean">
    <deltree dir="${build}"/>
    <deltree dir="${nexustests}/classes/tests"/>
  </target>


  <!-- Build all the sources with debug and deprecation -->
  <target name="tests" depends="prepare">
    <javac srcdir="${source}" destdir="${classes}" includes="**/*.java" excludes="${etc}/**,**/package.html"
           classpath="${classpath}" debug="on" deprecation="${deprecation}" />
  </target>

  <!-- Build all the sources with debug and deprecation -->
  <target name="nexustests">
    <javac srcdir="${nexustests}/src" destdir="${nexustests}/classes" includes="**/*.java" 
           classpath="${nexustests}/globusrmiclasses:${classpath}" debug="on" deprecation="${deprecation}" />
  </target>


  <!-- Same as main, but also cleans and additional targets -->
  <target name="main" depends="prepare,tests"/>

  <!-- Same as main, but also cleans and additional targets -->
  <target name="all" depends="clean,main"/>

</project>
