<project name="Webapp Precompilation" default="all" basedir="."> 

<!-- 

Variables passed in from build:

family (ex eserver)
release ex. (v1r3m3)
stage (ex. cur)
nlvid (ex. 2924)

-->


  <target name="jspc"> 

  <property name="tomcat.home" location="/afs/rchland.ibm.com/lande/shadow/dev2000/${family}/${release}/${stage}/shadow/ua/eclipse_help/tomcat_4"/>
  <property name="java.home" 		location="/usr/local/java/J1.4.1_IBM_build_ca141-20030930"/>
  <property name="webapp.path"	location="."/>

  <echo message="tomcat.home: ${tomcat.home}"/>
  <echo message="java.home: ${java.home}"/>
  <echo message="webapp.path: ${webapp.path}"/>

    <taskdef classname="org.apache.jasper.JspC" name="jasper2" > 
      <classpath id="jspc.classpath"> 
        <pathelement location="${java.home}/../lib/tools.jar"/> 
        <fileset dir="${tomcat.home}/server/lib"> 
          <include name="*.jar"/> 
        </fileset> 
        <fileset dir="${tomcat.home}/common/lib"> 
          <include name="*.jar"/> 
        </fileset> 
      </classpath> 
    </taskdef> 

    <jasper2 
             validateXml="false" 
             uriroot="${webapp.path}" 
             webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml" 
             outputDir="${webapp.path}/WEB-INF/src" /> 

  </target> 

  <target name="compile">
<echo message="starting compile phase"/>

    <mkdir dir="${webapp.path}/WEB-INF/classes"/>
    <mkdir dir="${webapp.path}/WEB-INF/lib"/>

    <javac destdir="${webapp.path}/WEB-INF/classes"
           optimize="off"
           debug="on" failonerror="false"
           srcdir="${webapp.path}/WEB-INF/src" 
	   excludes="**/*.smap"
	   encoding="utf-8">
      <classpath>
        <pathelement location="${webapp.path}/WEB-INF/classes"/>
        <fileset dir="${webapp.path}/WEB-INF/lib">
          <include name="*.jar"/>
        </fileset>
        <pathelement location="${tomcat.home}/common/classes"/>
        <fileset dir="${tomcat.home}/common/lib">
          <include name="*.jar"/>
        </fileset>
        <pathelement location="${tomcat.home}/server/classes"/>
        <fileset dir="${tomcat.home}/server/lib">
          <include name="*.jar"/>
        </fileset>
      </classpath>
      <include name="**" />
      <exclude name="tags/**" />
    </javac>

  </target>

  <target name="build" depends="jspc,compile">
  </target>

</project>
