<?xml version="1.0"?>
<project name="Tomcat 6.0" default="deploy" basedir=".">


  <!-- ===================== Initialize Property Values =================== -->

  <!-- See "build.properties.sample" in the top level directory for all     -->
  <!-- property values you must customize for successful building!!!        -->
  <property file="${user.home}/build.properties"/>
  <property file="build.properties"/>

  <property file="build.properties.default"/>

  <!-- Project Properties -->
  <property name="name"                  value="Apache Tomcat" />
  <property name="year"                  value="2006" />
  <property name="version.major"         value="6" />
  <property name="version.minor"         value="0" />
  <property name="version.build"         value="0" />
  <property name="version.patch"         value="0" />
  <property name="version"               value="6.0.0-dev" />
  <property name="version.number"        value="${version.major}.${version.minor}.${version.build}.${version.patch}" />

  <property name="project"               value="apache-tomcat" />
  <property name="final.name"            value="${project}-${version}" />
  <property name="final-src.name"        value="${project}-${version}-src" />

  <!-- Build Defaults -->
  <property name="tomcat.build"      value="${basedir}/output/build"/>
  <property name="tomcat.classes"    value="${basedir}/output/classes"/>
  <property name="tomcat.dist"       value="${basedir}/output/dist"/>
  <property name="test.failonerror"  value="true"/>
  <property name="test.runner"       value="junit.textui.TestRunner"/>

  <!-- Can't be lower - jsp uses templates -->
  <property name="compile.source" value="1.5"/>

  <!-- JAR artifacts -->
  <property name="bootstrap.jar" value="${tomcat.build}/bin/bootstrap.jar"/>
  <property name="tomcat-juli.jar" value="${tomcat.build}/bin/tomcat-juli.jar"/>

  <property name="annotations-api.jar" value="${tomcat.build}/lib/annotations-api.jar"/>
  <property name="servlet-api.jar" value="${tomcat.build}/lib/servlet-api.jar"/>
  <property name="jsp-api.jar" value="${tomcat.build}/lib/jsp-api.jar"/>
  <property name="el-api.jar" value="${tomcat.build}/lib/el-api.jar"/>
  <property name="catalina.jar" value="${tomcat.build}/lib/catalina.jar"/>
  <property name="catalina-tribes.jar" value="${tomcat.build}/lib/catalina-tribes.jar"/>
  <property name="catalina-ha.jar" value="${tomcat.build}/lib/catalina-ha.jar"/>
  <property name="catalina-ant.jar" value="${tomcat.build}/lib/catalina-ant.jar"/>
  <property name="catalina-ant-jmx.jar" value="${tomcat.build}/lib/catalina-ant-jmx.jar"/>
  <property name="tomcat-coyote.jar" value="${tomcat.build}/lib/tomcat-coyote.jar"/>

  <property name="jasper.jar" value="${tomcat.build}/lib/jasper.jar"/>
  <property name="jasper-el.jar" value="${tomcat.build}/lib/jasper-el.jar"/>

  <property name="tomcat-dbcp.home" value="${base.path}/tomcat6-deps/dbcp" />
  <property name="jasper-jdt.home" value="${base.path}/tomcat6-deps/jdt" />
  <property name="tomcat-dbcp.jar" value="${tomcat-dbcp.home}/tomcat-dbcp.jar"/>
  <property name="jasper-jdt.jar" value="${jasper-jdt.home}/jasper-jdt.jar"/>

  <!-- Classpath -->
  <path id="tomcat.classpath">
    <pathelement location="${ant.jar}"/>
    <pathelement location="${jdt.jar}"/>
  </path>

  <!-- Just build Tomcat -->
  <target name="build-prepare">

    <available classname="junit.framework.TestCase" property="junit.present" />

    <mkdir dir="${tomcat.classes}"/>

    <delete dir="${tomcat.build}/temp" />
    <delete dir="${tomcat.build}/work" />

  	<mkdir dir="${tomcat.build}"/>
    <mkdir dir="${tomcat.build}/bin"/>
    <mkdir dir="${tomcat.build}/conf"/>
    <mkdir dir="${tomcat.build}/lib"/>
    <mkdir dir="${tomcat.build}/temp"/>
    <mkdir dir="${tomcat.build}/webapps"/>

  </target>

  <target name="compile">

    <!-- Compile internal server components -->
    <javac srcdir="java" destdir="${tomcat.classes}"
           debug="${compile.debug}"
           deprecation="${compile.deprecation}"
           source="${compile.source}"
           optimize="${compile.optimize}"
           excludes="**/CVS/**,**/.svn/**">
      <classpath refid="tomcat.classpath" />
      <exclude name="org/apache/tomcat/util/net/puretls/**" />
    </javac>
    <tstamp>
      <format property="TODAY" pattern="MMM d yyyy" locale="en"/>
      <format property="TSTAMP" pattern="hh:mm:ss"/>        
    </tstamp>    
    <!-- Copy static resource files -->
    <filter token="VERSION" value="${version}"/>
    <filter token="VERSION_NUMBER" value="${version.number}"/>
    <filter token="VERSION_BUILT" value="${TODAY} ${TSTAMP}"/>
    <copy todir="${tomcat.classes}" filtering="true">
      <fileset dir="java">
        <include name="**/*.properties"/>
        <include name="**/*.dtd"/>
        <include name="**/*.tasks"/>
        <include name="**/*.xsd"/>
        <include name="**/*.xml"/>
      </fileset>
    </copy>

  </target>

  <target name="build-only" depends="build-prepare,compile,package" />

  <target name="package" >

    <!-- Common Annotations 1.0 JAR File -->
    <jar  jarfile="${annotations-api.jar}">
      <fileset dir="${tomcat.classes}">
        <include name="javax/annotation/*" />
        <include name="javax/annotation/security/*" />
        <include name="javax/ejb/*" />
        <include name="javax/persistence/*" />
        <include name="javax/xml/ws/*" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>

    <!-- Servlet 2.5 Implementation JAR File -->
    <jar  jarfile="${servlet-api.jar}">
      <fileset dir="${tomcat.classes}">
        <include name="javax/servlet/*" />
        <include name="javax/servlet/http/*" />
        <include name="javax/servlet/resources/*" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>

    <!-- JSP 2.1 Implementation JAR File -->
    <jar  jarfile="${jsp-api.jar}">
      <fileset dir="${tomcat.classes}">
        <include name="javax/servlet/jsp/**" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>

    <!-- JSP 2.1 EL Implementation JAR File -->
    <jar  jarfile="${el-api.jar}">
      <fileset dir="${tomcat.classes}">
        <include name="javax/el/*" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>

    <!-- Bootstrap JAR File -->
    <jar jarfile="${bootstrap.jar}" 
        manifest="res/bootstrap.jar.manifest">
      <fileset dir="${tomcat.classes}">
        <include name="org/apache/catalina/startup/Bootstrap.class" />
        <include name="org/apache/catalina/startup/catalina.properties" />
        <include name="org/apache/catalina/startup/CatalinaProperties.class" />
        <include name="org/apache/catalina/startup/ClassLoaderFactory.class" />
        <include name="org/apache/catalina/startup/Tool.class" />
        <include name="org/apache/catalina/loader/StandardClassLoader*.class" />
        <include name="org/apache/catalina/loader/Extension.class" />
        <include name="org/apache/catalina/loader/Reloader.class" />
        <include name="org/apache/catalina/security/SecurityClassLoad.class" />
        <include name="org/apache/naming/JndiPermission.class" />
        <include name="org/apache/tomcat/util/compat/*" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>

    <!-- Tomcat-juli JAR File -->
    <jar jarfile="${tomcat-juli.jar}">
      <fileset dir="${tomcat.classes}">
        <include name="org/apache/juli/**" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>

    <!-- Catalina Main JAR File -->
    <jar jarfile="${catalina.jar}">
      <fileset dir="${tomcat.classes}">
        <include name="org/apache/*" />
        <include name="org/apache/catalina/**" />
        <include name="org/apache/naming/**" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
        <!-- Modules -->
        <exclude name="org/apache/catalina/ant/**" />
        <exclude name="org/apache/catalina/cluster/**" />
        <exclude name="org/apache/catalina/ha/**" />
        <exclude name="org/apache/catalina/tribes/**" />
        <exclude name="org/apache/catalina/launcher/**" />
        <exclude name="org/apache/catalina/storeconfig/**" />
      </fileset>
    </jar>
    
    <!-- Catalina GroupCom/Tribes JAR File -->
    <jar jarfile="${catalina-tribes.jar}">
      <fileset dir="${tomcat.classes}">
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
        <!-- Modules -->
        <include name="org/apache/catalina/tribes/**" />
      </fileset>
    </jar>
    <!-- Catalina Cluster/HA JAR File -->
    <jar jarfile="${catalina-ha.jar}">
      <fileset dir="${tomcat.classes}">
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
        <!-- Modules -->
        <include name="org/apache/catalina/ha/**" />
      </fileset>
    </jar>

    <!-- Catalina Ant Tasks JAR File -->
    <jar jarfile="${catalina-ant.jar}">
      <fileset dir="${tomcat.classes}">
        <include name="org/apache/catalina/ant/*" />
        <include name="org/apache/catalina/ant/jmx/*" />
        <include name="org/apache/catalina/util/Base64.class" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>

    <!-- Protocol handlers - Coyote -->
    <jar jarfile="${tomcat-coyote.jar}">
      <fileset dir="${tomcat.classes}">
        <include name="org/apache/coyote/**" />
        <include name="org/apache/tomcat/jni/**" />
        <include name="org/apache/jk/**" />
        <include name="org/apache/tomcat/util/**" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>

    <!-- Jasper Implementation JAR File -->
    <jar  jarfile="${jasper.jar}">
      <fileset dir="${tomcat.classes}">
        <include name="org/apache/*" />
        <include name="org/apache/jasper/**" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>

    <!-- Jasper EL Implementation JAR File -->
    <jar  jarfile="${jasper-el.jar}">
      <fileset dir="${tomcat.classes}">
        <include name="org/apache/el/**" />
        <!-- Javadoc and i18n exclusions -->
        <exclude name="**/package.html" />
        <exclude name="**/LocalStrings_*" />
      </fileset>
    </jar>

    <!-- i18n JARs -->
    <jar jarfile="${tomcat.build}/lib/tomcat-i18n-es.jar">
      <fileset dir="${tomcat.classes}">
        <include name="**/LocalStrings_es.properties" />
      </fileset>
    </jar>
    <jar jarfile="${tomcat.build}/lib/tomcat-i18n-fr.jar">
      <fileset dir="${tomcat.classes}">
        <include name="**/LocalStrings_fr.properties" />
      </fileset>
    </jar>
    <jar jarfile="${tomcat.build}/lib/tomcat-i18n-ja.jar">
      <fileset dir="${tomcat.classes}">
        <include name="**/LocalStrings_ja.properties" />
      </fileset>
    </jar>

  </target>

  <target name="build-docs">

    <copy todir="${tomcat.build}/webapps">
      <fileset dir="webapps">
        <include name="docs/images/**"/>
        <include name="docs/**/*.html"/>
        <include name="docs/WEB-INF/**"/>
        <include name="docs/appdev/*.txt"/>
        <include name="docs/appdev/sample/**"/>
      </fileset>
        <fileset dir="webapps">
          <include name="docs/architecture/**"/>
          <exclude name="docs/architecture/*.xml"/>
        </fileset>
    </copy>
    <copy todir="${tomcat.build}/webapps/docs">
      <fileset dir=".">
        <include name="BUILDING.txt"/>
        <include name="NOTICE"/>
        <include name="RUNNING.txt"/>
      </fileset>
    </copy>

    <copy   tofile="${tomcat.build}/webapps/docs/appdev/sample/build.xml"
              file="webapps/docs/appdev/build.xml.txt"/>
  	
  	<mkdir dir="${tomcat.build}/webapps/docs/funcspec" />
  	
  	<!-- XSL processing -->
    <style basedir="webapps/docs"
           destdir="${tomcat.build}/webapps/docs"
         extension=".html"
             style="webapps/docs/tomcat-docs.xsl"
          excludes="build.xml project.xml"
          includes="*.xml">
      <param name="relative-path" expression="."/>
    </style>
    <style basedir="webapps/docs/appdev"
           destdir="${tomcat.build}/webapps/docs/appdev"
         extension=".html"
             style="webapps/docs/tomcat-docs.xsl"
          excludes="project.xml"
          includes="*.xml">
      <param name="relative-path" expression=".."/>
    </style>
    <style basedir="webapps/docs/funcspecs"
           destdir="${tomcat.build}/webapps/docs/funcspecs"
         extension=".html"
             style="webapps/docs/tomcat-docs.xsl"
          excludes="project.xml"
          includes="*.xml">
      <param name="relative-path" expression="../.."/>
    </style>
    <style basedir="webapps/docs/config"
           destdir="${tomcat.build}/webapps/docs/config"
         extension=".html"
             style="webapps/docs/tomcat-docs.xsl"
          excludes="project.xml"
          includes="*.xml">
      <param name="relative-path" expression=".."/>
    </style>
    <style basedir="webapps/docs/architecture"
           destdir="${tomcat.build}/webapps/docs/architecture"
         extension=".html"
             style="webapps/docs/tomcat-docs.xsl"
          excludes="project.xml"
          includes="*.xml">
      <param name="relative-path" expression=".."/>
    </style>
    
    <style basedir="webapps/docs/tribes"
               destdir="${tomcat.build}/webapps/docs/tribes"
             extension=".html"
                 style="webapps/docs/tomcat-docs.xsl"
              excludes="project.xml"
              includes="*.xml">
          <param name="relative-path" expression=".."/>
    </style>

  	<!-- Print friendly version -->
  	<mkdir dir="${tomcat.build}/webapps/docs/printer" />
    <copy todir="${tomcat.build}/webapps/docs/printer">
      <fileset dir=".">
        <include name="BUILDING.txt"/>
        <include name="NOTICE"/>
        <include name="RUNNING.txt"/>
      </fileset>
    </copy>
  	<mkdir dir="${tomcat.build}/webapps/docs/appdev/printer" />
    <copy todir="${tomcat.build}/webapps/docs/appdev/printer">
        <fileset dir="webapps">
          <include name="docs/appdev/*.txt"/>
        </fileset>
    </copy>
  	<mkdir dir="${tomcat.build}/webapps/docs/funcspecs/printer" />
    <mkdir dir="${tomcat.build}/webapps/docs/architecture/printer"/>
    <mkdir dir="${tomcat.build}/webapps/docs/config/printer"/>

  	<style basedir="webapps/docs"
           destdir="${tomcat.build}/webapps/docs/printer"
         extension=".html"
             style="webapps/docs/tomcat-docs.xsl"
          excludes="build.xml project.xml"
          includes="*.xml">
      <param name="relative-path" expression="./.."/>
      <param name="project-menu" expression="nomenu"/>
    </style>
    <style basedir="webapps/docs/appdev"
           destdir="${tomcat.build}/webapps/docs/appdev/printer"
         extension=".html"
             style="webapps/docs/tomcat-docs.xsl"
          excludes="project.xml"
          includes="*.xml">
      <param name="relative-path" expression="../.."/>
      <param name="project-menu" expression="nomenu"/>
    </style>
    <style basedir="webapps/docs/funcspecs"
           destdir="${tomcat.build}/webapps/docs/funcspecs/printer"
         extension=".html"
             style="webapps/docs/tomcat-docs.xsl"
          excludes="project.xml"
          includes="*.xml">
      <param name="relative-path" expression="../../.."/>
      <param name="project-menu" expression="nomenu"/>
    </style>
    <style basedir="webapps/docs/config"
           destdir="${tomcat.build}/webapps/docs/config/printer"
         extension=".html"
             style="webapps/docs/tomcat-docs.xsl"
          excludes="project.xml"
          includes="*.xml">
      <param name="relative-path" expression="../.."/>
      <param name="project-menu" expression="nomenu"/>
    </style>
    <style basedir="webapps/docs/architecture"
           destdir="${tomcat.build}/webapps/docs/architecture/printer"
         extension=".html"
             style="webapps/docs/tomcat-docs.xsl"
          excludes="project.xml"
          includes="*.xml">
      <param name="relative-path" expression="../.."/>
      <param name="project-menu" expression="nomenu"/>
    </style>

  </target>

  <target name="deploy" depends="build-only,build-docs">

    <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
            file="${tomcat-native.tar.gz}" />

    <copy todir="${tomcat.build}/bin" file="${commons-daemon.jar}" />
    <copy todir="${tomcat.build}/bin" file="${commons-daemon.jsvc.tar.gz}" />

  	<!-- Copy scripts -->
    <copy todir="${tomcat.build}/bin">
      <fileset dir="bin">
         <exclude name="**/*.launch"/>
      </fileset>
    </copy>

  	<!-- Copy static resource files -->
    <copy todir="${tomcat.build}/conf">
      <fileset dir="conf">
        <include name="**/*.policy"/>
        <include name="**/*.xml"/>
        <include name="**/*.properties"/>
      </fileset>
    </copy>

    <!-- Copy other regular webapps -->
    <copy todir="${tomcat.build}/webapps">
      <fileset dir="webapps">
        <include name="ROOT/**"/>
        <include name="examples/**"/>
        <include name="manager/**"/>
        <include name="host-manager/**"/>
      </fileset>
    </copy>

    <filter token="VERSION" value="${version}"/>
    <copy tofile="${tomcat.build}/webapps/ROOT/RELEASE-NOTES.txt" file="RELEASE-NOTES" 
          filtering="true" />

    <!-- Build classes for examples webapp -->
    <javac   srcdir="webapps/examples/WEB-INF/classes" 
             destdir="${tomcat.build}/webapps/examples/WEB-INF/classes"
             debug="${compile.debug}" deprecation="${compile.deprecation}"
             optimize="${compile.optimize}"
    	     classpath="${tomcat.classes}"
             excludes="**/CVS/**,**/.svn/**">
    </javac>

  	<copy file="${tomcat-dbcp.jar}" todir="${tomcat.build}/lib" />
    <copy file="${jasper-jdt.jar}" todir="${tomcat.build}/lib" />

  </target>

  <target name="clean">
    <delete dir="${tomcat.classes}" />
    <delete dir="${tomcat.build}" />
  </target>

  <!-- Download and dependency building -->
  <target name="setproxy"  if="useproxy">
    <taskdef name="setproxy"
            classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"/>
    <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
  </target>

  <target name="testexist">
    <echo message="Testing  for ${destfile}"/>
    <available file="${destfile}" property="exist"/>
  </target>

  <target name="downloadgz" unless="exist" depends="setproxy,testexist">
    <!-- Download and extract the package -->
    <get src="${sourcefile}" dest="${base.path}/file.tar.gz" />
    <gunzip src="${base.path}/file.tar.gz" dest="${base.path}/file.tar"/>
    <untar src="${base.path}/file.tar" dest="${base.path}"/>
    <delete file="${base.path}/file.tar"/>
    <delete file="${base.path}/file.tar.gz"/>
  </target>

  <target name="downloadzip" unless="exist" depends="setproxy,testexist">
    <!-- Download and extract the package -->
    <get src="${sourcefile}" dest="${base.path}/file.zip" />
    <mkdir dir="${destdir}" />
    <unzip src="${base.path}/file.zip" dest="${destdir}"/>
    <delete file="${base.path}/file.zip"/>
  </target>

  <target name="downloadfile" unless="exist" depends="setproxy,testexist">
    <!-- Download extract the file -->
    <mkdir dir="${destdir}" />
    <get src="${sourcefile}" dest="${destfile}" />
  </target>

  <target name="download"
          description="Builds and download dependent components">

    <antcall target="downloadfile">
      <param name="sourcefile" value="${tomcat-native.loc}"/>
      <param name="destfile" value="${tomcat-native.tar.gz}"/>
      <param name="destdir" value="${tomcat-native.home}"/>
    </antcall>

    <antcall target="downloadgz">
      <param name="sourcefile" value="${commons-daemon.loc}"/>
      <param name="destfile" value="${commons-daemon.jar}"/>
    </antcall>

    <!-- Build Tomcat DBCP bundle -->
    <antcall target="downloadgz">
      <param name="sourcefile" value="${commons-collections-src.loc}"/>
      <param name="destfile" value="${tomcat-dbcp.jar}" />
    </antcall>
    <antcall target="downloadgz">
      <param name="sourcefile" value="${commons-pool-src.loc}"/>
      <param name="destfile" value="${tomcat-dbcp.jar}" />
    </antcall>
    <antcall target="downloadgz">
      <param name="sourcefile" value="${commons-dbcp-src.loc}"/>
      <param name="destfile" value="${tomcat-dbcp.jar}" />
    </antcall>
    <mkdir dir="${tomcat-dbcp.home}"/>
    <antcall target="build-tomcat-dbcp">
      <param name="basedir" value="${tomcat-dbcp.home}" />
    </antcall>

    <!-- Build Jasper JDT bundle -->
    <antcall target="downloadzip">
      <param name="sourcefile" value="${jdt.loc}"/>
      <param name="destfile" value="${jdt.jar}"/>
      <param name="destdir" value="${base.path}"/>
    </antcall>
    <mkdir dir="${jasper-jdt.home}"/>
    <antcall target="build-jasper-jdt">
      <param name="basedir" value="${jasper-jdt.home}" />
    </antcall>

  </target>

  <target name="build-tomcat-dbcp">
    <copy todir="${tomcat-dbcp.home}">
      <fileset dir="${commons-collections.home}" >
        <include name="**/collections/CursorableLinkedList.java" />
        <include name="**/collections/KeyValue.java" />
        <include name="**/collections/LRUMap.java" />
        <include name="**/collections/SequencedHashMap.java" />
      </fileset>
      <fileset dir="${commons-pool.home}">
        <include name="**/*.java" />
        <exclude name="**/test/**" />
      </fileset>
      <fileset dir="${commons-dbcp.home}">
        <include name="**/*.java" />
        <exclude name="**/test/**" />
      </fileset>
    </copy>
    <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons">
      <replacefilter token="return UnmodifiableList.decorate(l);"
            value="return l;" />
      <replacefilter token="import org.apache.commons.collections.list.UnmodifiableList;"
            value=" " />
    </replace>
    <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons" >
      <replacefilter token="org.apache.commons"
            value="org.apache.tomcat.dbcp" />
    </replace>
    <replace dir="${tomcat-dbcp.home}/src/java/org/apache/commons/pool/impl" >
      <replacefilter token="enum"
            value="enumeration" />
    </replace>

    <mkdir dir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp" />
    <move todir="${tomcat-dbcp.home}/src/java/org/apache/tomcat/dbcp">
      <fileset dir="${tomcat-dbcp.home}/src/java/org/apache/commons" />
    </move>
    <mkdir dir="${tomcat-dbcp.home}/classes"/>
    <javac destdir="${tomcat-dbcp.home}/classes"
           optimize="off"
           debug="${compile.debug}"
           deprecation="${compile.deprecation}"
           source="${compile.source}"
           sourcepath="${tomcat-dbcp.home}/src/java"
           srcdir="${tomcat-dbcp.home}/src/java" >
      <include name="**" />
    </javac>
    <jar jarfile="${tomcat-dbcp.jar}"
         index="true">
      <fileset dir="${tomcat-dbcp.home}/classes">
        <include name="**/*.class" />
        <include name="**/*.properties" />
      </fileset>
    </jar>
  </target>

  <target name="build-jasper-jdt">
    <unjar src="${jdt.jar}" dest="${jasper-jdt.home}" />
    <jar destfile="${jasper-jdt.jar}" index="true">
      <fileset dir="${jasper-jdt.home}">
        <include name="org/eclipse/jdt/core/compiler/**"/>
        <include name="org/eclipse/jdt/internal/compiler/**"/>
        <include name="org/eclipse/jdt/internal/core/util/CommentRecorder*"/>
      </fileset>
    </jar>
  </target>

</project>
