craigmcc    00/11/11 17:19:27

  Modified:    .        Tag: tomcat_32 build.xml
  Log:
  Update build.xml for Tomcat 3.2 to run under Ant 1.2 with no deprecation
  warnings.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.53.2.5  +174 -128  jakarta-tomcat/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/build.xml,v
  retrieving revision 1.53.2.4
  retrieving revision 1.53.2.5
  diff -u -r1.53.2.4 -r1.53.2.5
  --- build.xml 2000/11/11 01:08:56     1.53.2.4
  +++ build.xml 2000/11/12 01:19:27     1.53.2.5
  @@ -1,81 +1,95 @@
   <project name="Tomcat" default="main" basedir=".">
   
  -  <target name="init">
  -    <!-- Ant.home is set automatically by ant. If you set it here it will not
  -         work  -->
  -    <property name="ant.home" value="../jakarta-ant" />
  -    <property name="build.compiler" value="classic"/>
  -    <property name="servlet.jar" 
  -              value="../jakarta-servletapi/lib/servlet.jar"/>
  -    <property name="tomcat.build" value="../build/tomcat"/>
  -    <property name="tomcat.home" value="../dist/tomcat"/>
  -    <property name="j2ee.home" value="../../j2ee/build/unix"/>
  -    <property name="optimize" value="true" />
  -    <property name="jaxp" value="../jaxp-1.0.1" />
  -  </target>
  +
  +  <!-- ==================== Initialization properties ===================== -->
  +  <property name="ant.home" value="../jakarta-ant"/>
  +  <property name="build.compiler" value="classic"/>
  +  <property name="debug" value="on"/>
  +  <property name="j2ee.home" value="../../j2ee/build/unix"/>
  +  <property name="jaxp" value="../jaxp-1.0.1" />
  +  <property name="optimize" value="true" />
  +  <property name="servlet.jar" value="../jakarta-servletapi/lib/servlet.jar"/>
  +  <property name="tomcat.build" value="../build/tomcat"/>
  +  <property name="tomcat.dist" value="../dist/tomcat"/>
  +
   
  -  <!-- ==================== Copy static files ==================== -->
  -  <!-- IF YOU CHANGE, sync dist.prepare !!! -->
  +  <!-- ======================== Copy static files ========================= -->
  +  <target name="prepare">
   
  -  <target name="prepare" depends="init">
  -    <mkdir dir="src/doc"/> <!-- Temp change until dir is not empty -->
  +    <!-- Create destination directories -->
       <mkdir dir="${tomcat.build}"/>
  +    <mkdir dir="${tomcat.build}/bin"/>
       <mkdir dir="${tomcat.build}/classes"/>
       <mkdir dir="${tomcat.build}/conf"/>
  -    <mkdir dir="${tomcat.build}/src"/>
  -    <mkdir dir="${tomcat.build}/lib"/>
  -    <mkdir dir="${tomcat.build}/logs"/>
  -    <mkdir dir="${tomcat.build}/bin"/>
       <mkdir dir="${tomcat.build}/doc"/>
  -    <mkdir dir="${tomcat.build}/webapps"/>
  -
  -    <copydir src="src/shell" dest="${tomcat.build}/bin" />
  -    <copydir src="src/etc" dest="${tomcat.build}/conf"/>
  -    <copydir src="src/doc" dest="${tomcat.build}/doc"/>
  -
  -    <copyfile src="build.xml" dest="${tomcat.build}/conf/build.xml"/>
  +    <mkdir dir="${tomcat.build}/lib"/>
       <mkdir dir="${tomcat.build}/lib/test"/>
       <mkdir dir="${tomcat.build}/lib/test/Golden"/>
  -    <copydir src="src/tests/share/tests/jsp/Golden" 
  -             dest="${tomcat.build}/lib/test/Golden"/>
  +    <mkdir dir="${tomcat.build}/logs"/>
  +    <mkdir dir="${tomcat.build}/src"/>
  +    <mkdir dir="${tomcat.build}/webapps"/>
   
  -    <!-- include ant, it is used for testing and will be used for
  -         configuration and few other tasks -->
  -    <copydir src="${ant.home}/bin" dest="${tomcat.build}/bin"/>
  -    <copyfile src="${ant.home}/lib/ant.jar" 
  -              dest="${tomcat.build}/lib/ant.jar"/>
  -    <copyfile src="${servlet.jar}" dest="${tomcat.build}/lib/servlet.jar"/>
  -    <copyfile src="LICENSE" dest="${tomcat.build}/LICENSE"/>
  +    <!-- Copy executables and scripts -->
  +    <copy todir="${tomcat.build}/bin">
  +      <fileset dir="${ant.home}/bin" includes="ant*"/>
  +      <fileset dir="src/shell"/>
  +    </copy>
  +
  +    <!-- Copy configuation files -->
  +    <copy todir="${tomcat.build}/conf">
  +      <fileset dir="src/etc"/>
  +    </copy>
  +    <copy tofile="${tomcat.build}/conf/build.xml"
  +            file="build.xml"/>
  +
  +    <!-- Copy documentation and other miscellaneous files -->
  +    <copy todir="${tomcat.build}/doc">
  +      <fileset dir="src/doc"/>
  +    </copy>
  +    <copy tofile="${tomcat.build}/LICENSE" file="LICENSE"/>
  +
  +    <!-- Copy library JAR files -->
  +    <copy tofile="${tomcat.build}/lib/ant.jar"
  +            file="${ant.home}/lib/ant.jar"/>
  +    <copy tofile="${tomcat.build}/lib/servlet.jar"
  +            file="${servlet.jar}"/>
  +    <copy tofile="${tomcat.build}/lib/jaxp.jar"
  +            file="${jaxp}/jaxp.jar"/>
  +    <copy tofile="${tomcat.build}/lib/parser.jar"
  +            file="${jaxp}/parser.jar"/>
  +
  +    <!-- Copy golden files for the tests webapp -->
  +    <copy todir="${tomcat.build}/lib/test/Golden">
  +      <fileset dir="src/tests/share/tests/jsp/Golden"/>
  +    </copy>
   
  +    <!-- Fixups for line endings and executable permissions -->
       <fixcrlf srcdir="${tomcat.build}" includes="**/*.sh" cr="remove"/>
       <fixcrlf srcdir="${tomcat.build}" includes="**/*.bat" cr="add"/>
  -
       <chmod perm="+x" file="${tomcat.build}/bin/ant"/>
       <chmod perm="+x" file="${tomcat.build}/bin/antRun"/>
  -    <chmod perm="+x" file="${tomcat.build}/bin/tomcat.sh"/>
       <chmod perm="+x" file="${tomcat.build}/bin/jspc.sh"/>
       <chmod perm="+x" file="${tomcat.build}/bin/startup.sh"/>
       <chmod perm="+x" file="${tomcat.build}/bin/shutdown.sh"/>
  -
  -    <!-- Fixups for the Application Developer's Guide -->
  -    <fixcrlf srcdir="${tomcat.build}/doc/appdev/sample"
  -           includes="**/*.bat" cr="add"/>
  -    <fixcrlf srcdir="${tomcat.build}/doc/appdev/sample"
  -           includes="build" cr="remove"/>
  -    <chmod perm="+x" file="${tomcat.build}/doc/appdev/sample/build"/>
  +    <chmod perm="+x" file="${tomcat.build}/bin/tomcat.sh"/>
  +    <chmod perm="+x" file="${tomcat.build}/doc/appdev/sample/build.sh"/>
   
     </target>
   
  -  <!-- ==================== Build tomcat ==================== -->
  +
  +  <!-- ============================= Build tomcat ========================= -->
     <target name="tomcat" depends="prepare">
  +
  +    <!-- Determine availability of optional components -->
       <available property="jsse.present" 
                  classname="com.sun.net.ssl.internal.ssl.Provider" />
       <available property="jdk12.present"
                  classname="java.security.PrivilegedAction" />
   
  +    <!-- Compile the standard Tomcat components -->
       <javac srcdir="src/share" destdir="${tomcat.build}/classes"
              classpath="${servlet.jar};${jaxp}/jaxp.jar" 
  -           debug="on" 
  +           debug="${debug}" 
              optimize="${optimize}"
              deprecation="off" >
              <exclude name="**/Jdk12Interceptor.java" 
  @@ -94,77 +108,110 @@
                       unless="jsse.present" />
       </javac>
   
  -    <copydir src="src/share" dest="${tomcat.build}/classes">
  -      <include name="**/*.properties" />
  -      <include name="**/*.dtd" />
  -    </copydir>
  +    <!-- Copy the corresponding resource files -->
  +    <copy todir="${tomcat.build}/classes">
  +      <fileset dir="src/share">
  +        <include name="**/*.properties"/>
  +        <include name="**/*.dtd"/>
  +      </fileset>
  +    </copy>
  +
     </target>
   
   
  -  <!-- Build J2EE integration code -->
  +  <!-- ============ Build J2EE integration code =========================== -->
     <target name="j2ee" depends="tomcat">
  +
  +      <!-- Compile the J2EE integration components -->
         <javac srcdir="src/j2ee" 
             optimize="${optimize}"
             destdir="${tomcat.build}/classes"
             
classpath="${servlet.jar};${j2ee.home}/lib/classes;${j2ee.home}/lib/j2ee.jar" 
  -          debug="on" />
  +          debug="${debug}" />
  +
  +      <!-- Copy the corresponding resource files -->
  +      <copy todir="${tomcat.build}/classes">
  +        <fileset dir="src/j2ee">
  +          <include name="**/*.properties"/>
  +          <include name="**/web.dtd"/>
  +          <include name="**/web.xml"/>
  +        </fileset>
  +      </copy>
   
  -      <copydir src="src/j2ee" 
  -            dest="${tomcat.build}/classes">
  -        <include name="**/*.properties" />
  -        <include name="**/web.dtd" />
  -        <include name="**/web.xml" />
  -    </copydir>
     </target>
   
  +
     <!-- ==================== Build all web applications ==================== -->
     <target name="webapps" depends="prepare">
  -    <!-- Examples -->
  +
  +    <!-- Examples context -->
       <mkdir dir="${tomcat.build}/webapps/examples"/>
  -    <copydir src="src/examples" dest="${tomcat.build}/webapps/examples"/>
  +    <copy todir="${tomcat.build}/webapps/examples">
  +      <fileset dir="src/examples"/>
  +    </copy>
       <javac srcdir="src/examples/WEB-INF/classes"
  -           optimize="${optimize}"
  +           optimize="${optimize}" debug="${debug}"
              destdir="${tomcat.build}/webapps/examples/WEB-INF/classes"
              classpath="${tomcat.build}/classes;${servlet.jar}"/>
       <javac srcdir="src/examples/jsp/plugin/applet"
  -           optimize="${optimize}"
  +           optimize="${optimize}" debug="${debug}"
              destdir="${tomcat.build}/webapps/examples/jsp/plugin/applet"/>
   
       <!-- Root context -->
       <mkdir dir="${tomcat.build}/webapps/ROOT"/>
  -    <copydir src="src/webpages" dest="${tomcat.build}/webapps/ROOT"/>
  +    <copy todir="${tomcat.build}/webapps/ROOT">
  +      <fileset dir="src/webpages"/>
  +    </copy>
       <javac srcdir="src/webpages/WEB-INF/classes"
  -           optimize="${optimize}"
  +           optimize="${optimize}" debug="${debug}"
              destdir="${tomcat.build}/webapps/ROOT/WEB-INF/classes"
              classpath="${tomcat.build}/classes;${servlet.jar}"/>
   
  -    <!-- admin context -->
  +    <!-- Admin context -->
       <mkdir dir="${tomcat.build}/webapps/admin"/>
  -    <copydir src="src/admin" dest="${tomcat.build}/webapps/admin"/>
  +    <copy todir="${tomcat.build}/webapps/admin">
  +      <fileset dir="src/admin"/>
  +    </copy>
       <javac srcdir="src/admin/WEB-INF/classes"
  -           optimize="${optimize}"
  +           optimize="${optimize}" debug="${debug}"
              destdir="${tomcat.build}/webapps/admin/WEB-INF/classes"
              classpath="${tomcat.build}/classes;${servlet.jar}"/>
   
       <!-- Test application -->
       <mkdir dir="${tomcat.build}/webapps/test"/>
  -    <copydir src="src/tests/webpages" dest="${tomcat.build}/webapps/test"/>
  +    <copy todir="${tomcat.build}/webapps/test">
  +      <fileset dir="src/tests/webpages"/>
  +    </copy>
       <javac srcdir="src/tests/webpages/WEB-INF/classes"
  -           optimize="${optimize}"
  +           optimize="${optimize}" debug="${debug}"
              destdir="${tomcat.build}/webapps/test/WEB-INF/classes"
              classpath="${tomcat.build}/classes;${servlet.jar}"/>
     </target>
   
   
  -  <!-- ==================== Copy the files to distribution format ======== -->
  +  <!-- ==================== Copy files to distribution format ============= -->
     <target name="dist" depends="main,webapps">
   
  -    <mkdir dir="${tomcat.home}"/>
  -    <copydir src="${tomcat.build}" dest="${tomcat.home}"/>
  -    <copydir src="src/share/org" dest="${tomcat.home}/src/org"/>
  +    <!-- Copy build files and source tree -->
  +    <mkdir dir="${tomcat.dist}"/>
  +    <copy todir="${tomcat.dist}">
  +      <fileset dir="${tomcat.build}"/>
  +    </copy>
  +    <copy todir="${tomcat.dist}/src/org">
  +      <fileset dir="src/share/org"/>
  +    </copy>
  +
  +    <!-- Fixups for executable permissions -->
  +    <chmod perm="+x" file="${tomcat.dist}/bin/ant"/>
  +    <chmod perm="+x" file="${tomcat.dist}/bin/antRun"/>
  +    <chmod perm="+x" file="${tomcat.dist}/bin/jspc.sh"/>
  +    <chmod perm="+x" file="${tomcat.dist}/bin/startup.sh"/>
  +    <chmod perm="+x" file="${tomcat.dist}/bin/shutdown.sh"/>
  +    <chmod perm="+x" file="${tomcat.dist}/bin/tomcat.sh"/>
  +    <chmod perm="+x" file="${tomcat.dist}/doc/appdev/sample/build.sh"/>
   
  -    <!-- create tomcat jar files -->
  -    <jar jarfile="${tomcat.home}/lib/webserver.jar"
  +    <!-- Create tomcat JAR files -->
  +    <jar jarfile="${tomcat.dist}/lib/webserver.jar"
            basedir="${tomcat.build}/classes" >
            <include name="org/apache/tomcat/**" />
            <exclude name="org/apache/tomcat/deployment/**" />
  @@ -172,68 +219,51 @@
            <exclude name="org/apache/tomcat/util/XMLParser.class" />
            <exclude name="org/apache/tomcat/util/XMLTree.class" />
       </jar> 
  -    <jar jarfile="${tomcat.home}/lib/jasper.jar"
  -         basedir="${tomcat.home}/classes"
  +    <jar jarfile="${tomcat.dist}/lib/jasper.jar"
  +         basedir="${tomcat.dist}/classes"
            includes="org/apache/jasper/**"/>
  -    <copyfile src="${servlet.jar}" dest="${tomcat.home}/lib/servlet.jar"/>
  -    <copyfile src="${jaxp}/jaxp.jar" dest="${tomcat.home}/lib/jaxp.jar"/>
  -    <copyfile src="${jaxp}/parser.jar" dest="${tomcat.home}/lib/parser.jar"/>
  +    <delete dir="${tomcat.dist}/classes"/>
   
       <!-- Add Tomcat internal javadoc -->
  -    <mkdir dir="${tomcat.home}/webapps/ROOT/javadoc" />
  -    <javadoc packagenames="org.apache.tomcat.core"
  +    <mkdir dir="${tomcat.dist}/webapps/ROOT/javadoc" />
  +    <javadoc packagenames="org.apache.tomcat.*"
                sourcepath="src/share"
  -             destdir="${tomcat.home}/webapps/ROOT/javadoc"
  +             destdir="${tomcat.dist}/webapps/ROOT/javadoc"
                author="true"
                version="true"
                use="true"
  -             windowtitle="Tomcat internal API"
  -             doctitle="Tomcat internal"
  +             windowtitle="Tomcat Internal API"
  +             doctitle="Tomcat Internal"
                bottom="Copyright &#169; 2000 Apache Software Foundation. All Rights 
Reserved."
       />
  -
  -    <deltree dir="${tomcat.home}/classes"/>
   
  -
  -    <!-- create webapp WARS -->
  -    <jar   jarfile="${tomcat.home}/webapps/examples.war"
  -           basedir="${tomcat.home}/webapps/examples"
  +    <!-- Create webapp WAR files -->
  +    <jar   jarfile="${tomcat.dist}/webapps/examples.war"
  +           basedir="${tomcat.dist}/webapps/examples"
              includes="**" /> 
  -    <deltree dir="${tomcat.home}/webapps/examples"/>
  +    <delete dir="${tomcat.dist}/webapps/examples"/>
   
  -    <jar   jarfile="${tomcat.home}/webapps/admin.war"
  -           basedir="${tomcat.home}/webapps/admin"
  +    <jar   jarfile="${tomcat.dist}/webapps/admin.war"
  +           basedir="${tomcat.dist}/webapps/admin"
              includes="**" /> 
  -    <deltree dir="${tomcat.home}/webapps/admin"/>
  +    <delete dir="${tomcat.dist}/webapps/admin"/>
   
  -    <jar   jarfile="${tomcat.home}/webapps/ROOT.war"
  -           basedir="${tomcat.home}/webapps/ROOT"
  +    <jar   jarfile="${tomcat.dist}/webapps/ROOT.war"
  +           basedir="${tomcat.dist}/webapps/ROOT"
              includes="**" />
  -    <deltree dir="${tomcat.home}/webapps/ROOT"/>
  +    <delete dir="${tomcat.dist}/webapps/ROOT"/>
   
  -    <jar   jarfile="${tomcat.home}/webapps/test.war"
  -           basedir="${tomcat.home}/webapps/test"
  +    <jar   jarfile="${tomcat.dist}/webapps/test.war"
  +           basedir="${tomcat.dist}/webapps/test"
              includes="**" /> 
  -    <deltree dir="${tomcat.home}/webapps/test"/>
  -
  -    <!-- Change permissions for unix -->
  -    <chmod perm="+x" file="${tomcat.home}/bin/tomcat.sh"/>
  -    <chmod perm="+x" file="${tomcat.home}/bin/jspc.sh"/>
  -    <chmod perm="+x" file="${tomcat.home}/bin/startup.sh"/>
  -    <chmod perm="+x" file="${tomcat.home}/bin/shutdown.sh"/>
  -    <chmod perm="+x" file="${tomcat.home}/bin/test-tomcat.sh"/>
  -
  -    <!-- Fixups for the Application Developer's Guide -->
  -    <fixcrlf srcdir="${tomcat.home}/doc/appdev/sample"
  -           includes="**/*.bat" cr="add"/>
  -    <fixcrlf srcdir="${tomcat.home}/doc/appdev/sample"
  -           includes="**/*.sh" cr="remove"/>
  -    <chmod perm="+x" file="${tomcat.home}/doc/appdev/sample/build.sh"/>
  +    <delete dir="${tomcat.dist}/webapps/test"/>
   
     </target>
   
  +
  +  <!-- =================== Create J2EE integration distributin ============ -->
     <target name="j2ee-dist" depends="j2ee"> 
  -    <jar jarfile="${tomcat.home}/lib/tomcat-j2ee.jar"
  +    <jar jarfile="${tomcat.dist}/lib/tomcat-j2ee.jar"
            basedir="${tomcat.build}/classes" >
            <include name="org/apache/tomcat/deployment/**" />
            <include name="org/apache/tomcat/j2ee/**" />
  @@ -241,23 +271,39 @@
            <include name="org/apache/tomcat/util/XMLTree.class" />
       </jar> 
     </target>
  -  <!-- =================================================================== -->
  -  <!-- Packages the distribution with ZIP                                  -->
  -  <!-- =================================================================== -->
  +
  +
  +  <!-- ================== Package distribution as a ZIP file ============== -->
     <target name="dist-zip" depends="dist">
  -    <zip zipfile="${Name}-${version}.zip" basedir="${tomcat.home}" 
  +    <zip zipfile="${Name}-${version}.zip" basedir="${tomcat.dist}" 
            includes="**"/>
     </target>
   
  -  
   
  -  <!-- ==================== Admin ==================== -->
  -  <target name="clean" depends="init">
  -    <deltree dir="${tomcat.build}"/>
  -    <deltree dir="${tomcat.home}"/>
  +  <!-- ==================== Administrative targets  ======================= -->
  +  <target name="clean">
  +    <delete dir="${tomcat.build}"/>
  +    <delete dir="${tomcat.dist}"/>
     </target>
  -  
     <target name="all" depends="clean,dist"/>
     <target name="main" depends="tomcat,webapps"/>
  +
     
  +  <!-- =============================== Help =============================== -->
  +  <target name="targets">
  +    <echo message=""/>
  +    <echo message="ANT build targets for Tomcat"/>
  +    <echo message=""/>
  +    <echo message="The following targets are available:"/>
  +    <echo message="  all                  Clean, then create distribution"/>
  +    <echo message="  clean                Clean build and dist directories"/>
  +    <echo message="  dist                 Create distribution"/>
  +    <echo message="  dist-zip             Package distribution as a ZIP"/>
  +    <echo message="  j2ee                 Build J2EE integration code"/>
  +    <echo message="  j2ee-dist            Create J2EE distribution"/>
  +    <echo message="  main                 (Default) Build tomcat and webapps"/>
  +    <echo message="  tomcat               Build Tomcat basic components"/>
  +    <echo message="  webapps              Build included web applications"/>
  +  </target>
  +
   </project>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to