<?xml version="1.0" encoding="UTF-8"?>
<project name="sjsxp-samples" default="all" basedir=".">

<!-- This default value works with the distribution of SJSXP(Stax Impl.) as part of JWSDP -->
<property name="sjsxp.jar" value="../lib/sjsxp.jar"/>

<!-- This default value works with the distribution of SJSXP(Stax Impl.) as part of JWSDP -->
<property name="stax.api.jar" value="../lib/jsr173_api.jar"/>

<!-- This default value works with the distribution of SJSXP(Stax Impl.) as part of JWSDP -->
<property name="data.dir" value="./data"/>

<!-- This default value works with the distribution of SJSXP(Stax Impl.) as part of JWSDP -->
<property name="src.dir" value="${basedir}"/>

<!-- This default value works with the distribution of SJSXP(Stax Impl.) as part of JWSDP -->
<property name="dest.dir" value="${basedir}"/>

<property name="my.classpath" value="${dest.dir}:${stax.api.jar}:${sjsxp.jar}"/>

    <target name="all" depends="Compile-all, CursorParse, CursorWriter, StreamFP"/>            
    
    <target name="Compile-all">    
        <javac srcdir="${src.dir}"  destdir="${dest.dir}" classpath="${dest.dir}:${stax.api.jar}"/>
    </target>
    
    <target name="CursorParse">
        <echo message="Current directory is ${basedir}"/>
        <echo message=" Running CursorParse Sample."/>
        <java failOnError="true" dir="${dest.dir}" classname="CursorParse" classpath="${my.classpath}" fork="true">
            <arg value="-x"/>
            <arg value="1"/>
            <arg value="${data.dir}/BookCatalogue.xml"/>
        </java>
    </target>

    <target name="CursorWriter">
        <echo message=" Running CursorWriter Sample."/>
        <java failOnError="true" dir="${dest.dir}" classname="CursorWriter" classpath="${my.classpath}" fork="true">
            <arg value="-f"/>
            <!-- Output file name -->
            <arg value="${basedir}/CursorWriter-Output"/>            
        </java>
    </target>
    
    <target name="StreamFP">
        <echo message=" Running StreamFP Sample."/>
        <java failOnError="true" dir="${dest.dir}" classname="StreamFP" classpath="${my.classpath}" fork="true">
            <arg value="-f"/>            
            <arg value="${data.dir}/BookCatalogue.xml"/>            
        </java>
    </target>
        
</project>
