<?xml version="1.0"?>
<project name="BenchMark" default="init">

<!-- Use Windoze enviroment variables to map all drive letters 
	This keeps all the paths in this build file relative so that they
	run anywhere on the Systronix network - and maybe yours too! -->
<property environment="env"/>

<!-- Use the TINI task from TiniAnt.jar installed in D:\jakarta-ant-1.5.1\lib -->
<taskdef name="tini" classname="net.geeba.ant.Tini"/>


<target name="init">
	<echo message="ANT_HOME is set to = ${env.ANT_HOME}"/>
	<echo message="JAVA_HOME is set to = ${env.JAVA_HOME}"/>
	<!-- Create the time stamp -->
	<tstamp/>
	<!-- Create the binary dirs -->
	<mkdir dir="classes_snap"/>
	<mkdir dir="snapbuild"/>
	<mkdir dir="tinibuild"/>
</target>

<target name="jstamp" depends="init">
	<echo message="AJILE_CLDC is set to ${env.AJILE_CLDC}"/>
	<echo>javac should have the -target 1.1 switch</echo>
	<javac target="1.1"
		bootclasspath="${env.AJILE_CLDC}:${env.AJILE_CLDC}/../classes.jar"
		srcdir="src" includes="**/*.java"
		destdir="classes" />
	<echo>Compilation Complete</echo>
</target>

<target name="snap" depends="init">
	<echo message="SNAP_HOME is set to ${env.SNAP_HOME}"/>
	<echo>javac should have the -target 1.1 switch</echo>
	<javac target="1.1"
		bootclasspath="${env.SNAP_HOME}/classes/"
		srcdir="src"
		destdir="classes_snap" />
	<!-- now preverify -->
	<echo>Compilation Complete</echo>	
<exec executable = "${env.SNAP_HOME}/bin/preverify.exe">
        <arg value = "-classpath"/>
        <arg value = "${SNAP_HOME/classes/}"/>
        <arg value = "-nofinalize"/>
        <arg value = "-d"/>
        <arg value = "snapbuild"/>
        <arg value = "classes_snap/."/>
</exec>	
	<echo>Preverification Complete</echo>
</target>

<target name="snap_load" depends="snap">
	<ftp server="10.0.0.104"
		userid="root"
		password="snap"
		binary="true"
		verbose="true"
		remotedir="classes"
		>
		<fileset dir="snapbuild"
			includes = "*.class"
		/>	
	
	</ftp>
	<echo>SNAP FTP download complete</echo>
	
</target>

<target name="tini_compile" depends="init">
	<echo>Compiling for TINI</echo>
	<echo message="TINI_HOME is set to ${env.TINI_HOME}"/>
	<echo>javac should have the -target 1.1 switch</echo>
	<javac target="1.1"
		bootclasspath="${env.TINI_HOME}/bin/tiniclasses.jar"
		srcdir="src" 
		destdir="tinibuild" />
	<echo>TINI Compilation Complete</echo>
</target>

<target name="tini" depends="tini_compile">
	<echo message="Converting for TINI"/>
	<!-- "tini" here is the special TiniAnt task, not the Ant target -->
	<tini
		classpath="${env.TINI_HOME}/bin/tini.jar"
		database="${env.TINI_HOME}/bin/tini.db"
		dependencyfile="${env.TINI_HOME}/bin/owapi_dep.txt"
		outputfile="tinibuild/BenchMark.tini"
		verbose="yes">
		<convert dir="tinibuild" includes="**/*.class"/>
	</tini>
	<echo>Conversion Complete</echo>
</target>

<target name="tini_load" depends="tini">
	<ftp server="166.70.144.45"
		userid="root"
		password="tini"
		binary="true"
		verbose="true"
		>
		<fileset dir="tinibuild"
			includes = "*.tini"
		/>	
	
	</ftp>
	<echo>TINI FTP download complete</echo>
	
</target>


<target name="telnet" depends="tini_load"
	description="runs the benchmark on TINI -- at least in theory">
	<telnet server=""
		userid="root"
		password="tstik72"
		timeout="10"
		
		>
	</telnet>
</target>	


</project>
