<?xml version="1.0"?>
<project name="BuildaJileExamples" default="build" basedir=".">

    <!--============================================================-->
    <!-- remove the class files                                     -->
    <!--============================================================-->
    <target name="info" description="about this build file">
       <echo>This ant build file is provided by Systronix</echo>
       <echo>It performs the following:  </echo>
       <echo>  1) Creates a .jar file containing all the the aJile Systems class files</echo>
       <echo>  2) compiles the example java files.</echo>

    </target>

    <!--============================================================-->
    <!-- remove the class files                                     -->
    <!--============================================================-->
    <target name="clean" description="remove intermediate files">
        <delete dir="Examples/CLDC/classes"/>
        <delete dir="Examples/CLDC/HostClasses"/>
        <delete file="Runtime_cldc11/Rts.jar"/>
	<delete file="Runtime_cldc11/RTS.jar"/>
    </target>



    <!--============================================================-->
    <!-- compile the aJile example programs                         -->
    <!-- javac should have the -target 1.1 switch                   -->
    <!--============================================================-->
    <target name="compileExamples" depends="make.rts.jar" description="Compile the ajile examples" >
       <mkdir dir="../Examples/CLDC/classes"/>
       <javac target="1.1" source="1.3"
          bootclasspath="../Runtime_cldc11/Rts.jar;
                         ../Runtime_cldc11/classes.jar"
          destdir="../Examples/CLDC/classes" >
          <src path="../Examples/CLDC/src"/>
          <exclude name="com/ajile/examples/network/host/**" />
          <exclude name="com/ajile/examples/NANDstorage/host/**" />
       </javac>

    </target>


    <!--============================================================-->
    <!-- Create Rts.jar                                             -->
    <!--                                                            -->
    <!--============================================================-->
    <target name="make.rts.jar" description="create a jar file of the ajile class libs">
       <jar destfile="../Runtime_cldc11/Rts.jar"
          basedir="../Runtime_cldc11/Rts"
        />
    </target>

    <!--============================================================-->
    <!-- build the Systronix examples                               -->
    <!--                                                            -->
    <!--============================================================-->
    <target name="buildExamples" >
       <echo>This ant build file is provided by Systronix</echo>
       <echo>It the example programs for the JStamp and the JStik:  </echo>

       <subant failonerror="true">
            <fileset file="..\Examples\build.xml"  />
       </subant>

    </target>

    <!--============================================================-->
    <!-- compile the aJile example programs                         -->
    <!-- javac should have the -target 1.1 switch                   -->
    <!--============================================================-->
    <target name="build" depends="compileExamples,buildExamples" description="Compile and build the examples" >
    </target>


</project>
