<?xml version="1.0" encoding="ISO-8859-1"?>

<project name="OSCON 2007 - Demo 5 - VelocityView" basedir="." default="war">

  <target name="props">
    <property name="name" value="demo5" />
    <property name="base" value="${basedir}/${name}" />
    <property name="lib" value="${base}/WEB-INF/lib"/>
  </target>

  <target name="compile" depends="props">
    <!-- compile the classes -->
    <mkdir dir="${base}/WEB-INF/classes"/>
    <javac srcdir="${base}/WEB-INF/src"
           includes="*/**"
           debug="true"
           destdir="${base}/WEB-INF/classes">
      <classpath>
        <fileset dir="${lib}">
          <include name="*.jar"/>
        </fileset>
      </classpath>
    </javac>
  </target>

  <target name="war" depends="compile">
    <jar jarfile="${basedir}/${name}.war"
         basedir="${base}"/>
    <echo>                                                  </echo>
    <echo>  A WAR file (Web ARchive) was created for you at </echo>
    <echo>                                                  </echo>
    <echo>      ${basedir}/${name}.war                      </echo>
    <echo>                                                  </echo>
    <echo>  To use it with Tomcat, copy the ${name}.war file</echo>
    <echo>  to the webapps directory in the Tomcat tree     </echo>
    <echo>  (assuming a standard Tomcat installation)  and  </echo>
    <echo>  then restart Tomcat.  To access the page        </echo>
    <echo>  point your browser to                           </echo>
    <echo>                                                  </echo>
    <echo>     http://localhost:8080/${name}/index.vm       </echo>
    <echo>                                                  </echo>
    <echo>  If you have any questions, don't hesitate to    </echo>
    <echo>  ask on the Velocity user list.                  </echo>
  </target>

  <target name="clean">
    <delete file="${base}/${name}.war"/>
    <delete dir="${base}/WEB-INF/classes"/>
  </target>

</project>


