<!-- Group 8: Steve Brennan    -->
<!--          Jason Grafinger  -->
<!--          Eric Andersen    -->

<project name="ScheduleG8" default="compile">

  <property file="global.properties" />

  <property name="model" location="classes" /> 

<!--  Used for compiling servlet on porsche.cis.udel.edu -->
<!--  <path id="servlet-classpath">   -->
<!--    <fileset dir="${tomcat.dir}/common/lib">   -->
<!--         <include name="*.jar" />  -->
<!--     </fileset>  -->
<!--     <fileset dir="${tomcat.dir}/common/endorsed">   -->
<!--         <include name="*.jar" />  -->
<!--     </fileset>   -->
<!--   </path>   -->
  

  <path id="junit-classpath">
    <fileset dir="${junit.dir}">
        <include name="*.jar" />
    </fileset>
  </path>


<!--  Used for compiling on strauss     -->
                                  
  <path id="custom-classpath">      
    <fileset dir="/www/htdocs/CIS/software/dist/apache-tomcat-5.5.12/common/lib"> 
      <include name="*.jar" />    
    </fileset>                    
  </path>                         
                                   
<!-- compile looks in src directory model and web for all files -->
  <target name="compile" depends="clean" description="Compiles All Classes">
    <javac srcdir="${src}" destdir="${build}"
        includes="**com/example/model/**,com/example/web/**">
      <classpath refid="custom-classpath" />
    </javac>
  </target>

<!-- cleans and removes all build files in directories -->
  <target name="clean" description="Removes all build files" >
    <delete dir="${build}"/> 
    <delete dir="${dist}"/>
    <mkdir dir="${build}"/> 
    <mkdir dir="${dist}"/> 
  </target>


<!-- runs junit tests -->
<!-- Note: Some tests are set to fail -->

  <target name="test" >
    <junit showoutput="on" printsummary="on" fork="true" haltonfailure="false">
      <batchtest fork="yes"  >
        <fileset dir="${build}">
          <include name="**/*Test.class" />
        </fileset>
	<fileset dir="${src}">
	  <include name="**/*Test.class" />
	  <include name="**/*Test.java" />
	</fileset>
      </batchtest>
      <classpath refid="junit-classpath" />
    </junit>
  </target>

<!-- creates war file to be copied into tomcat/webapps directory -->
  <target name="create-war" depends="compile" description="creates war file">
    <war destfile="${dist}/${web-app-name}.war"
       webxml="${etc}/web.xml">
       <classes dir="${build}" />
       <fileset dir="${web}" />
    </war>
  </target>

<!-- javadocs code -->
  <target name="javadoc" description="Creates Java Documentation">
    <delete dir="${docs}"/>
    <javadoc packagenames="com.example.model.*,com.example.web.*"
           sourcepath="${src}"
           defaultexcludes="yes"
           destdir="${docs}"
           author="true"
           version="true"
           use="true"
           windowtitle="Group 8: Schedule">
    </javadoc>
  </target>
</project>
