<?xml version = '1.0' encoding = 'windows-1252'?>
<project name="Batch Audit" default="display.pdf">
  
  <property file="./audit.properties"/>
  
  <target name="audit">
     <echo message="Auditing ${project.name}"/>
     <exec executable="${audit.exec}" 
           dir="${audit.home}"
           vmlauncher="false">
       <arg line="-profile ${profile.name}"/>
       <arg line="-output ${working.dir}/${output.name}"/>
       <arg line="-title '${report.title}'"/>
       <arg line="${project.dir}/${project.name}"/>
     </exec>
     <echo message="Generated ${working.dir}/${output.name}"/>
  </target>

  <target name="transform" depends="audit">
     <style style="${working.dir}/html.xsl" 
            in="${working.dir}/audit.xml" 
            out="${working.dir}/audit.html"/>
  </target>

  <target name="processfo" depends="audit">
     <style style="${working.dir}/fo.xsl" 
            in="${working.dir}/audit.xml" 
            out="${working.dir}/audit.fo"/>
  </target>

  <target name="display.html" depends="transform">
    <exec executable="${working.dir}/audit.html"
          vmlauncher="false"/>
  </target>
   
  <path id="fo.path">
    <pathelement location="${working.dir}/classes"/>
    <pathelement location="${apache.fop.dir}/lib/avalon-framework-cvs-20020806.jar"/>
    <pathelement location="${apache.fop.dir}/lib/batik.jar"/>
    <pathelement location="${apache.fop.dir}/build/fop.jar"/>
  </path>
  
  <target name="compile" depends="processfo">
     <mkdir dir="${working.dir}/classes"/>
     <javac destdir="${working.dir}/classes" srcdir="." debug="on" encoding="Cp1252">
        <classpath refid="fo.path"/>
        <include name="audit/util/ApachePDFProducer.java"/>
     </javac>
  </target> 
  
  <target name="display.pdf" depends="compile">
    <java classname="audit.util.ApachePDFProducer"
          classpathref="fo.path"
          dir="."
          fork="true">
       <arg value="${working.dir}/audit.fo"/>
    </java>
    
    <exec executable="${working.dir}\audit.pdf"
          vmlauncher="false"/>
    <!-- In case pdf is not associated with Acrobat reader:      
    <exec executable="C:\wininstalldir\Adobe\Acrobat 6.0\Reader\AcroRd32.exe"
          vmlauncher="false">
      <arg value="${working.dir}\audit.pdf"/>
    </exec-->
  </target>

   <target name="clean">
      <delete dir="${working.dir}/classes"/>
   </target>
   
</project>
