<?xml version="1.0" encoding="UTF-8"?>

<project basedir="." default="all" name="Regression Test Saxon for the Java platform"
         xmlns:dn="antlib:org.apache.ant.dotnet">
         
    <import file="build-constants.xml"/>
    <import file="build-j.xml"/>
    
    <!-- Directory containing a Saxon license file -->
    <property name="license.dir" value="../saxon-licenses"/>
    
    <target name="test-cmd-hej" depends="j, resources">
      <exec executable="java"
            failonerror="true">
         <arg line="-cp ${build-hej.dir}/saxon9he.jar"/>
         <arg line="net.sf.saxon.Transform"/>  
         <arg line="-t"/>
         <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
         <arg line="-xsl:${build-resources.dir}/samples/styles/books.xsl"/>
      </exec>
      <exec executable="java"
            failonerror="true">
         <arg line="-cp ${build-hej.dir}/saxon9he.jar"/>
         <arg line="net.sf.saxon.Query"/>   
         <arg line="-t"/>
         <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
         <arg line="-q:${build-resources.dir}/samples/query/books.xq"/>
      </exec>
    </target>   
    
    <target name="test-cmd-pej" depends="j, resources">
      <exec executable="java"
            failonerror="true">
         <arg line="-cp ${build-pej.dir}/saxon9pe.jar;${license.dir}"/>
         <arg line="net.sf.saxon.Transform"/>   
         <arg line="-t"/>
         <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
         <arg line="-xsl:${build-resources.dir}/samples/styles/books.xsl"/>
      </exec>
      <exec executable="java"
            failonerror="true">
         <arg line="-cp ${build-pej.dir}/saxon9pe.jar;${license.dir}"/>
         <arg line="net.sf.saxon.Query"/>   
         <arg line="-t"/>
         <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
         <arg line="-qs:saxon:line-number((//*)[last()])"/>
         <arg line="-l:on"/>
      </exec>
    </target>
    
    <target name="test-cmd-eej" depends="j, resources">
      <exec executable="java"
            failonerror="true">
         <arg line="-cp ${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
         <arg line="com.saxonica.Transform"/>   
         <arg line="-t"/>
         <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
         <arg line="-xsl:${build-resources.dir}/samples/styles/books.xsl"/>
      </exec>
      <exec executable="java"
            failonerror="true">
         <arg line="-cp ${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
         <arg line="com.saxonica.Query"/>  
         <arg line="-t"/>
         <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
         <arg line="-qs:saxon:line-number((//*)[last()])"/>
         <arg line="-l:on"/>
      </exec>
      <exec executable="java"
            failonerror="true">
         <arg line="-cp ${build-eej.dir}/saxon9ee.jar;${license.dir}"/>
         <arg line="com.saxonica.Validate"/>  
         <arg line="-t"/>
         <arg line="-s:${build-resources.dir}/samples/data/books.xml"/>
         <arg line="-xsd:${build-resources.dir}/samples/data/books.xsd"/>
      </exec>
    </target>
    
    <target name="test-api-hej" depends="j, resources">
       <exec executable="java"
             dir="${build-resources.dir}/samples"
             failonerror="true">
         <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-hej.dir}/saxon9he.jar;${basedir}/${lib.dir}/jdom.jar;${basedir}/${lib.dir}/xom-1.2.1.jar;${basedir}/${lib.dir}/dom4j-1.6.1.jar;c:\saxon-licenses"/>
         <arg line="S9APIExamples"/>  
         <arg line="QueryA"/>
      </exec>
    </target>    
    
    <target name="test-api-pej" depends="j, resources">
       <exec executable="java"
             dir="${build-resources.dir}/samples"
             failonerror="true">
         <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-pej.dir}/saxon9pe.jar;${basedir}/${lib.dir}/jdom.jar;${basedir}/${lib.dir}/xom-1.2.1.jar;${basedir}/${lib.dir}/dom4j-1.6.1.jar;c:\saxon-licenses"/>
         <arg line="S9APIExamples"/>  
         <arg line="nonschema"/>
      </exec>
    </target>
    
    <target name="test-api-eej" depends="j, resources">
       <exec executable="java"
             dir="${build-resources.dir}/samples"
             failonerror="true">
         <arg line="-cp ${basedir}/${build-resources.dir}/samples/java/classes;${basedir}/${build-eej.dir}/saxon9ee.jar;${basedir}/${lib.dir}/jdom.jar;${basedir}/${lib.dir}/xom-1.2.1.jar;${basedir}/${lib.dir}/dom4j-1.6.1.jar;c:\saxon-licenses"/>
         <arg line="S9APIExamples"/>  
         <arg line="all"/>
      </exec>
    </target>
    
    <target name="test-cmd-j" depends="test-cmd-hej, test-cmd-pej, test-cmd-eej"/>
    
    <target name="test-api-j" depends="test-api-hej, test-api-pej, test-api-eej"/>
    
    <target name="test-j" depends="test-cmd-j, test-api-j"/>               
         
         
         
</project>