<project default="compile">

  <!-- build.xml for program to 
  make reading notes wiki pages , P. Conrad, 06/18/2007 -->

  <property environment="env"/> <!-- load the environment variables -->

  <target name="compile">
    <javac srcdir="." debug="on" debuglevel="lines,vars,source" />
  </target>

 <target name="clean" depends="cleanOutput">

   <delete>
     <fileset dir="." includes="*.class"/>
   </delete>
 </target>

 <target name="cleanOutput" >

   <delete>
     <fileset dir="output" includes="*"/>
   </delete>
 </target>


 <target name="run" depends="compile,test,cleanOutput">
   <java classname="ReadNotes" fork="yes">
      <arg value="JXPC_data.txt" />
      <arg value="output" />
   </java>
 </target>

 <target name="doc" depends="compile">

   <javadoc sourcepath="."
            destdir="${env.HOME}/public_html/mkWikiPages" 
            author="true" version="true" use="true" >

     <fileset dir="." includes="*.java"/>

   </javadoc>
  </target>


<target name="test" depends="compile">

  <!-- We use haltonfailure no so that we can get a full report
       of all the tests that failed, not just the first test that fails.
 
       After all tests are done, we check the property SomeJunitTestsFailed
       and if it is set, we fail then
  -->

  <junit fork="yes" haltonfailure="no" failureproperty="SomeJUnitTestsFailed">
  
      <!-- The formatter element gives you a report if there is a failure.

           Take out usefile="false" if you want the report stored
           in a file called TEST-testname.txt 

           If you don't use formatter, you probably want printsummary="yes"
           as an attribute on the junit open tag -->
        
      <formatter type="plain" usefile="false" />
      
      <classpath>
        <pathelement location="."/>
      </classpath>

      <test name="ChapterTest"/>
      <test name="SectionTest"/>

  </junit>


  <fail>
     <condition>
         <isset property="SomeJUnitTestsFailed"/>
     </condition>
   </fail>


</target>



</project>


