<project name="beerV1" default="compile" 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="compile">
    <echo message="Compiling the servlet...."/>
    <javac srcdir="${src}" destdir="${build}"
           includes="com/example/model/**,com/example/web/**"
           classpath="${tomcat.jar}"> 

    </javac>
</target>

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

  <mkdir 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>

</project>