<project name="ciranda" default="build" basedir=".">
    <description>Detects Speech-Acts inside emails</description>
  <property name="src" location="src"/>
  <property name="javadoc" location="javadoc"/>
  <property name="build" location="class"/>
  <property name="models" location="src/ciranda/models"/>
  <property name="destmodels" location="class/ciranda/models"/>
  <property name="distDir" location="dist"/>

  <target name="build-clean" depends="clean,build"  description="compile the source from scratch"/>

  <target name="build" depends="init"
        description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}" debug="on"/>
    <copy todir="${destmodels}"> <fileset dir="${models}"/> </copy>
  </target>

  <target name="init" description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <mkdir dir="${build}"/>
    <mkdir dir="${javadoc}"/>
  </target>

  <target name="clean" description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
    <delete dir="${javadoc}"/>
  </target>

  <target name="javadoc" description="rebuild java docs">
    <delete dir="${javadoc}"/>    
    <mkdir dir="${javadoc}"/>
    <javadoc sourcepath="${src}" destdir="${javadoc}" packagenames="*"/>
  </target>

<target name="dist" description="generate the distribution" depends="clean,build">
  <mkdir dir="${distDir}"/>
  <!-- Put everything in ${classDir} into the minorThird-${DSTAMP}.jar file -->
  <jar jarfile="${distDir}/ciranda.jar" basedir="${build}">
    <manifest>
      <attribute name="Main-Class" value="ciranda.SpeechAct"/>
      <attribute name="Class-Path" value="minorThird.jar"/>
    </manifest>
    <fileset dir="${build}">
	    <include name="ciranda/**.*"/>
    </fileset>
  </jar>
</target>
</project>
