<?xml version="1.0" encoding="ISO-8859-1" ?>
<project name="SpeechRecorder" default="package" basedir=".">
  <description>VoxForge Speech Recorder (postlet)</description>

  <!-- set global properties for this build -->
  <property name="root"       location="."/>
  <property name="src"        location="src"/>
  <property name="src.java"   location="${src}"/>
  <property name="build"      location="build"/>
  <property name="build.java" location="${build}"/>
  <property name="include"    location="include"/>
  <property name="dist"       location="dist"/>
<!--  <property name="temp"       location="temp"/> -->
  <property name="lib"        location="lib"/>
  <property name="log"        location="log"/>
  <property name="doc"        location="doc"/>

  <property name="version" value="0.1"/>

  <!-- "dev" mode options - I recommend that developers modify these
    on the command line by specifying "-Doptimize=off -Ddebug=on" when 
    running ant. Levae them at their defaults when producing files 
    for real-life use/distribution. -->
  <property name="optimize" value="on"/>
  <property name="debug" value="off"/>

  <target name="init" description="Initialise ant" depends="clean">
    <tstamp>
      <format property="NOW" pattern="dd/MM/yyyy HH:mm" locale="en"/>
    </tstamp>
 <!--   <mkdir dir="${temp}"/> -->
    <mkdir dir="${dist}"/>
    <mkdir dir="${build}"/>
    <mkdir dir="${build.java}"/>
  </target>

  <target name="compile" depends="init"
          description="Compile VoxForge Speech" >

    
    <!-- Compiles both the recorder and the playback code.
       Separation happens at the bundling stage... -->    

    <javac srcdir="${src.java}" destdir="${build.java}"
         optimize="${optimize}"
         debug="${debug}"
         source="1.4"
         target="1.4"
          >
      <include name="speechrecorder/*.java"/>
      <include name="org/xiph/speex/*.java"/>
      <include name="org/xiph/speex/spi/*.java"/>
    </javac>
  </target>




  <target name="package" depends="compile">

   <!-- Before release, a more restricted set of files to include in each JAR should be specified -->
  
    <jar jarfile="${dist}/speechrecorder.jar">
      <fileset dir="${build.java}">
        <include name="**/*.class"/>
        <exclude name="**/Test*"/>
        <exclude name="**/ant/**"/>
     <!--   <exclude name="**/player/**"/> -->
      </fileset>
      <metainf dir="${include}/metainf/"/>
      <manifest>
        <section name="build">
          <attribute name="Build-Date" value="${NOW}"/>
          <attribute name="Built-By" value="${user.name}"/>
          <attribute name="Built-With" value="${os.name} ${os.version} ${os.arch}"/>
        </section>
        <attribute name="Main-Class" value="speechrecorder.RecorderApplet"/>
      </manifest>
    </jar>
  
    <jar jarfile="${dist}/speechrecorder.jar">
      <fileset dir="${build.java}">
        <include name="**/*.class"/>
        <exclude name="**/Test*"/>
        <exclude name="**/ant/**"/>
        <exclude name="net/sf/postlet/**"/>
        <exclude name="netscape/**"/>
<!--

Don't do any excluding until the playback works... just to be sure...

        <exclude name="moodlespeex/CapturePlayback*.class"/>
        <exclude name="moodlespeex/MoodleSpeexRecorder*.class"/>
        <exclude name="moodlespeex/JSpeexEnc*.class"/>
        <exclude name="org/xiph/speex/*Writer.class"/>
        <exclude name="org/xiph/speex/*Encoder.class"/>
-->

      </fileset>
      <metainf dir="${include}/metainf/"/>
      <manifest>
        <section name="build">
          <attribute name="Build-Date" value="${NOW}"/>
          <attribute name="Built-By" value="${user.name}"/>
          <attribute name="Built-With" value="${os.name} ${os.version} ${os.arch}"/>
        </section>
        <attribute name="Main-Class" value="speechrecorder.PlayerApplet"/>
      </manifest>
    </jar>
  
  
  
  
  </target>


  <target name="clean" description="Clean up" >
    <delete dir="${build}"/>
<!--    <delete dir="${temp}"/> -->
  </target>







</project>
