<project name="SchedV2" default="menu" basedir=".">

  <!-- include compiled-servlet and tomcat-dir properties -->

  <property file="global.properties" />


  <property name="model" location="classes" /> 
  
<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>

<target name="menu">
  <echo message="compile - compiles all source code"/>
  <echo message="clean - cleans out all compilable files"/>
  <echo message="create-war - creates a war file"/>
  <echo message="docs - creates javadoc files"/>
</target>

<target name="compile">
  <echo message="Compiling the servlet...."/>
  <javac srcdir="${src}" destdir="${build}"
           includes="com/example/model/**,com/example/web/**">
    <classpath refid="servlet-classpath" />
  </javac>
</target>

<target name="clean">
  <echo message="Deleting and remaking the build and dist directories." />
  <delete dir="${build}" /> 
  <mkdir dir="${build}" /> 
  <delete dir="${dist}" /> 
  <mkdir dir="${dist}" /> 
</target>


<target name="create-war" description="creates war file" depends="clean, compile">
  <echo message="Creating ${web-app-name}.war" />
  <war destfile="${dist}/${web-app-name}.war" 
       webxml="${etc}/web.xml">
    <classes dir="${build}" />
    <!-- <lib dir="${lib}" -->
    <fileset dir="${web}" />
  </war>
</target>

<target name="docs">
  <javadoc packagenames="com.example.web.*,com.example.model.*" sourcepath="${src}" destdir="${javadoc.build}" author="true" version="true" use="true">
    <classpath refid="servlet-classpath"/>
  </javadoc>
</target>

</project>
