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

<project name="Stan Model PDF" default="pdf" basedir=".">

  <property name="version"  
            value="2.0.0"/>

  <path id="classpath">
    <pathelement location="stan-models.jar"/>
  </path>

  <target name="clean">
    <delete dir="build"/>
    <delete failonerror="false" file="stan-models.jar"/>
    <delete failonerror="false" file="stan-models-${version}.aux"/>
    <delete failonerror="false" file="stan-models-${version}.idx"/>
    <delete failonerror="false" file="stan-models-${version}.log"/>
    <delete failonerror="false" file="stan-models-${version}.out"/>
    <delete failonerror="false" file="stan-models-${version}.pdf"/>
    <delete failonerror="false" file="stan-models-${version}.tex"/>
    <delete failonerror="false" file="stan-models-${version}.toc"/>
  </target>

  <target name="compile">
    <mkdir dir="build/classes"/>
    <javac optimize="on"
           debug="yes"
           debuglevel="source,lines,vars"
           destdir="build/classes"
           includeAntRuntime="false">
      <compilerarg value="-Xlint:all"/>
      <src path="src"/>
    </javac>
  </target>

  <target name="jar"
          depends="compile">
    <jar destfile="stan-models.jar">
      <fileset dir="build/classes"
               includes="**/*" />
    </jar>
  </target>

<target name="pdf"
        depends="jar">
  <java classname="MakeModelTex"
        fork="true">
    <classpath refid="classpath"/>
    <arg value="stan-models-${version}.tex" />
    <arg value="../../models/bugs_examples/vol1" />
    <arg value="../../models/bugs_examples/vol2" />
    <arg value="../../models/bugs_examples/vol3" />
    <arg value="../../models/misc"/>
  </java>
  <exec executable="pdflatex"> 
    <arg value="stan-models-${version}.tex" />
  </exec>
  <exec executable="pdflatex"> 
    <arg value="stan-models-${version}.tex" />
  </exec>
  <exec executable="makeindex"> 
    <arg value="stan-models-${version}.idx" />
  </exec>
  <exec executable="pdflatex"> 
    <arg value="stan-models-${version}.tex" />
  </exec>
</target>



</project>


