| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <project name="jk" default="build-main" basedir="."> |
| |
| <!-- We'll build jk for 3.3 or 4.0 ( depending on what you have installed ). |
| You need to set tomcat5.home, tomcat40.home, and/or tomcat33.home in |
| build.properties ( either the path to 'official' distribution or the |
| development dirs ) |
| --> |
| |
| <!-- ===================== Initialize Property Values ================ --> |
| <property file="build.properties"/> |
| <property file="../build.properties"/> |
| <property file="../build.properties.default"/> |
| <property file="${user.home}/build.properties"/> |
| <property file="${user.home}/.build.properties"/> |
| |
| <property name="jk.build" location="${basedir}/build"/> |
| <property name="build.docs" location="${basedir}/build/docs"/> |
| <property name="source.docs" location="./xdocs"/> |
| <property name="gen.dev.doc" value="false"/> |
| |
| <!-- Compile options --> |
| <property name="optimize" value="off" /> |
| <property name="compile.debug" value="true" /> |
| <property name="compile.deprecation" value="false" /> |
| |
| <property name="tomcat-jk.jar" value="${jk.build}/lib/tomcat-jk.jar" /> |
| <property name="tomcat-jkconfig.jar" value="${jk.build}/lib/jkconfig.jar" /> |
| <property name="tomcat-jkshm.jar" value="${jk.build}/lib/jkshm.jar" /> |
| <property name="tomcat-jk2.jar" value="${jk.build}/lib/tomcat-jk2.jar" /> |
| <property name="tomcat-jni.jar" value="${jk.build}/lib/tomcat-jni.jar" /> |
| <property name="tomcat-apr.jar" value="../jni/dist/tomcat-native-1.0.0.jar" /> |
| |
| <!-- default locations, overrident by properties --> |
| <property name="base.path" location="/usr/share/java"/> |
| |
| <property name="tomcat33.home" |
| location="../../jakarta-tomcat/build/tomcat/lib/common/tomcat_core.jar" /> |
| <property name="tomcat40.home" |
| location="../../jakarta-tomcat-4.0/build" /> |
| <property name="tomcat41.home" |
| location="../../jakarta-tomcat-4.1/build" /> |
| <property name="tomcat5.home" |
| location="../../jakarta-tomcat-catalina/build" /> |
| <property name="coyote.home" |
| location="../coyote/build" /> |
| <property name="tomcat-util.home" location="../util/build" /> |
| <property name="tomcat-coyote.jar" location="${coyote.home}/lib/tomcat-coyote.jar" /> |
| <property name="servlet-api.jar" location="${tomcat5.home}/common/lib/servlet-api.jar" /> |
| <property name="tomcat-util.jar" location="${tomcat-util.home}/lib/tomcat-util.jar" /> |
| |
| <property name="tc4-catalina.jar" location="${tomcat41.home}/server/lib/catalina.jar" /> |
| <property name="tc5-catalina.jar" location="${tomcat5.home}/server/lib/catalina.jar" /> |
| <property name="tc3-core.jar" location="${tomcat33.home}/lib/common/tomcat_core.jar" /> |
| <property name="tc3-core_util.jar" location="${tomcat33.home}/lib/common/core_util.jar" /> |
| <property name="tc3-util.jar" location="${tomcat33.home}/lib/container/tomcat_util.jar" /> |
| <property name="tc3-modules.jar" location="${tomcat33.home}/lib/container/tomcat_modules.jar" /> |
| <property name="commons-modeler.jar" location="../../jakarta-commons/modeler/dist/commons-modeler.jar" /> |
| |
| <!-- Fix build via ECLIPSE which didn't export ant's jars --> |
| <path id="xml-apis.classpath"> |
| <pathelement path="${jaxp.home}/jaxp.jar"/> |
| <pathelement path="${jaxp.home}/crimson.jar"/> |
| <pathelement path="${xerces2.home}/xml-apis.jar"/> |
| <pathelement path="${xml-parser-apis.jar}"/> |
| </path> |
| |
| <path id="build-main.classpath"> |
| <pathelement location="../util/build/classes"/> |
| <pathelement location="${servlet-api.jar}"/> |
| <pathelement location="${tomcat-util.jar}" /> |
| <pathelement location="${commons-logging.jar}"/> |
| <pathelement location="${commons-modeler.jar}"/> |
| <pathelement location="${jmx.jar}"/> |
| <pathelement location="${tomcat-coyote.jar}"/> |
| </path> |
| |
| <path id="build-tc4.classpath"> |
| <pathelement location="${tc4-catalina.jar}" /> |
| <pathelement location="${servlet-api.jar}" /> |
| </path> |
| <path id="build-tc5.classpath"> |
| <pathelement location="${tc5-catalina.jar}" /> |
| <pathelement location="${servlet-api.jar}" /> |
| </path> |
| <path id="build-tc3.classpath"> |
| <pathelement location="${tc3-core.jar}" /> |
| <pathelement location="${tc3-core_util.jar}" /> |
| <pathelement location="${tc3-util.jar}" /> |
| <pathelement location="${tc3-modules.jar}" /> |
| <pathelement location="${servlet-api.jar}" /> |
| </path> |
| <!-- ==================== Detection and reports ==================== --> |
| |
| <target name="report" > |
| <echo message="Tomcat33: ${tomcat33.detect} ${tomcat33.home}" /> |
| <echo message="Tomcat40: ${tomcat40.detect} ${tomcat40.home}" /> |
| <echo message="Tomcat41: ${tomcat41.detect} ${tomcat41.home}" /> |
| <echo message="Tomcat5: ${tomcat5.detect} ${tomcat5.home}" /> |
| <echo message="Apache13: ${apache13.detect} ${apache13.home}" /> |
| <echo message="Apache2: ${apache2.detect} ${apache2.home}" /> |
| <echo message="iPlanet: ${iplanet.detect} ${iplanet.home}" /> |
| <echo message="IIS: ${iis.detect} ${iis.home}" /> |
| <echo message="AOLserver: ${aolserver.detect} ${aolserver.home}" /> |
| <echo message="jmx: ${jmx.jar} ${jmx.detect} ${commons-modeler.jar} ${modeler.detect}" /> |
| </target> |
| |
| <target name="detect" > |
| <echo message="-------- tomcat-connectors --------" /> |
| <available property="tomcat33.detect" |
| file="${tc3-core.jar}" /> |
| <available property="tomcat40.detect" |
| file="${tc4-catalina.jar}" /> |
| <available property="tomcat41.detect" |
| file="${tomcat41.home}/server/webapps" /> |
| <condition property="tomcat5.detect"> |
| <and> |
| <available |
| classname="javax.servlet.ServletRequestEvent" |
| classpath="${servlet-api.jar}" /> |
| <available file="${tc5-catalina.jar}" /> |
| </and> |
| </condition> |
| <available property="apache13.detect" |
| file="${apache13.home}" /> |
| <available property="apache2.detect" |
| file="${apache2.home}" /> |
| <available property="iis.detect" |
| file="${iis.home}" /> |
| <available property="iplanet.detect" |
| file="${iplanet.home}" /> |
| <available property="aolserver.detect" |
| file="${aolserver.home}" /> |
| <available property="jmx.detect" |
| file="${jmx.jar}" /> |
| <available property="jdk14.detect" |
| classname="java.nio.MappedByteBuffer" /> |
| <available property="modeler.detect" |
| file="${commons-modeler.jar}" /> |
| <!-- Check if we can find the XSLTProcessor class in the classpath --> |
| <available |
| property="avail.xalan" |
| classname="org.apache.xalan.xslt.Process"> |
| <!-- |
| <classpath refid="classpath"/> |
| --> |
| </available> |
| </target> |
| |
| <target name="prepare" depends="detect" > |
| <mkdir dir="${jk.build}"/> |
| <mkdir dir="${jk.build}"/> |
| <mkdir dir="${jk.build}/conf"/> |
| <mkdir dir="${jk.build}/classes"/> |
| <mkdir dir="${jk.build}/classes/META-INF" /> |
| <mkdir dir="${jk.build}/lib"/> |
| <copy todir="${jk.build}/conf" > |
| <fileset dir="conf" includes="*" /> |
| </copy> |
| |
| <!-- util and coyote must be build first --> |
| <copy tofile="${jk.build}/lib/tomcat-coyote.jar" |
| file="${tomcat-coyote.jar}" /> |
| |
| <!-- Fix build via ECLIPSE which didn't export ant's jars --> |
| <path id="xml-apis.classpath"> |
| <pathelement path="${jaxp.home}/jaxp.jar"/> |
| <pathelement path="${jaxp.home}/crimson.jar"/> |
| <pathelement path="${xerces2.home}/xml-apis.jar"/> |
| <pathelement path="${xml-parser-apis.jar}"/> |
| </path> |
| |
| </target> |
| |
| <target name="build-main" |
| depends="prepare,report,jkjava" /> |
| |
| <!-- build all the stuff --> |
| <target name="all" |
| depends="prepare,report,coyote,jkjava,jkant" /> |
| |
| <!-- Build only jk, assume coyote and utils are built --> |
| <target name="build-jk" |
| depends="prepare,report,jkjava" /> |
| |
| <!-- ==================== Building ==================== --> |
| <target name="jkjava-static" depends="prepare,report" > |
| <!-- Copy static resource files --> |
| <copy todir="${jk.build}/classes"> |
| <fileset dir="java"> |
| <include name="**/*.properties"/> |
| </fileset> |
| </copy> |
| <copy todir="${jk.build}/classes" > |
| <fileset dir="java" includes="**/*.xml" /> |
| </copy> |
| </target> |
| <target name="jkjava-shared" depends="jkjava-static" |
| description="Build shared java side of the connector" > |
| <javac srcdir="java" |
| destdir="${jk.build}/classes" |
| deprecation="${compile.deprecation}" |
| debug="${compile.debug}" |
| optimize="${optimize}" |
| verbose="off" |
| encoding="ISO-8859-1"> |
| <include name="org/apache/jk/**"/> |
| <include name="org/apache/coyote/ajp/**" /> |
| <exclude name="org/apache/coyote/ajp/*Apr*" unless="jdk.1.4.present" /> |
| <exclude name="org/apache/jk/common/ChannelNioSocket.java" unless="jdk14.detect"/> |
| <exclude name="org/apache/jk/common/JkMX.java" unless="jmx.detect"/> |
| <exclude name="org/apache/jk/common/ModJkMX.java" unless="jmx.detect"/> |
| <exclude name="org/apache/jk/common/Shm14.java" unless="jdk14.detect"/> |
| <exclude name="org/apache/jk/config/*Config.java" /> |
| <exclude name="org/apache/jk/ant/**" /> |
| <classpath> |
| <pathelement location="${tomcat-apr.jar}" /> |
| <path refid="xml-apis.classpath"/> |
| <path refid="build-main.classpath"/> |
| </classpath> |
| </javac> |
| <jar jarfile="${tomcat-jkconfig.jar}" |
| basedir="${jk.build}/classes" |
| manifest="conf/jkconfig.manifest"> |
| <include name="org/apache/jk/config/**" /> |
| </jar> |
| <jar jarfile="${tomcat-jk2.jar}" |
| manifest="conf/tomcat-jk2.manifest" |
| basedir="${jk.build}/classes" > |
| <include name="org/apache/jk/**" /> |
| <include name="org/apache/coyote/ajp/**" /> |
| <exclude name="org/apache/jk/ant/**" /> |
| </jar> |
| |
| <jar jarfile="${tomcat-jni.jar}" |
| basedir="${jk.build}/classes" |
| manifest="conf/jk2.manifest" > |
| <include name="org/apache/jk/apr/**" /> |
| <include name="org/apache/jk/core/**" /> |
| </jar> |
| |
| </target> |
| <target name="jkjava-tc5" depends="jkjava-shared" if="tomcat5.detect" |
| description="Build TC5 java side of the connector" > |
| <javac srcdir="java" |
| destdir="${jk.build}/classes" |
| deprecation="${compile.deprecation}" |
| debug="${compile.debug}" |
| optimize="${optimize}" |
| verbose="off" |
| encoding="ISO-8859-1"> |
| <include name="org/apache/coyote/ajp/**"/> |
| <include name="org/apache/jk/config/**"/> |
| <classpath> |
| <path refid="xml-apis.classpath"/> |
| <path refid="build-main.classpath"/> |
| <path refid="build-tc5.classpath"/> |
| </classpath> |
| </javac> |
| <jar jarfile="${tomcat-jkconfig.jar}" |
| basedir="${jk.build}/classes" |
| manifest="conf/jkconfig.manifest"> |
| <include name="org/apache/jk/config/**" /> |
| </jar> |
| </target> |
| <target name="jkjava-tc4" depends="jkjava-shared" if="tomcat40.detect" |
| description="Build the TC4 java side of the connector"> |
| <javac srcdir="java" |
| destdir="${jk.build}/classes" |
| deprecation="${compile.deprecation}" |
| debug="${compile.debug}" |
| optimize="${optimize}" |
| verbose="off" |
| encoding="ISO-8859-1"> |
| <include name="org/apache/ajp/**" /> |
| <exclude name="org/apache/ajp/tomcat33/**" /> |
| <classpath> |
| <path refid="xml-apis.classpath"/> |
| <path refid="build-main.classpath"/> |
| <path refid="build-tc4.classpath"/> |
| </classpath> |
| |
| </javac> |
| |
| <jar jarfile="${tomcat-jk.jar}" |
| basedir="${jk.build}/classes"> |
| <include name="org/apache/ajp/**" /> |
| </jar> |
| |
| <jar jarfile="${tomcat-jkshm.jar}" |
| basedir="${jk.build}/classes" |
| manifest="conf/shm.manifest"> |
| <include name="org/apache/ajp/common/Shm.class" /> |
| </jar> |
| </target> |
| <target name="jkjava-tc3" depends="jkjava-shared" if="tomcat33.detect" |
| description="Build the TC3 java side of the connector"> |
| <javac srcdir="java" |
| destdir="${jk.build}/classes" |
| deprecation="${compile.deprecation}" |
| debug="${compile.debug}" |
| optimize="${optimize}" |
| verbose="off" |
| encoding="ISO-8859-1"> |
| <include name="org/apache/ajp/**" /> |
| <exclude name="org/apache/ajp/tomcat4/**" /> |
| <classpath> |
| <path refid="xml-apis.classpath"/> |
| <path refid="build-main.classpath"/> |
| <path refid="build-tc3.classpath"/> |
| </classpath> |
| |
| </javac> |
| |
| <jar jarfile="${tomcat-jk.jar}" |
| basedir="${jk.build}/classes"> |
| <include name="org/apache/ajp/**" /> |
| </jar> |
| |
| </target> |
| <target name="jkjava" depends="jkjava-tc3,jkjava-tc4,jkjava-tc5" |
| description="Build java side of the connector" > |
| </target> |
| |
| <target name="jkant" > |
| <mkdir dir="${jk.build}/classes"/> |
| <mkdir dir="${jk.build}/classes/META-INF" /> |
| <mkdir dir="${jk.build}/lib"/> |
| <javac srcdir="jkant/java" |
| destdir="${jk.build}/classes" |
| debug="${compile.debug}" |
| deprecation="${compile.deprecation}" |
| optimize="${optimize}" |
| verbose="off" |
| encoding="ISO-8859-1"> |
| </javac> |
| <copy todir="${jk.build}/classes/META-INF" |
| file="jkant/ant.tasks"/> |
| <jar jarfile="${jk.build}/lib/jkant.jar" |
| basedir="${jk.build}/classes" > |
| <include name="org/apache/jk/ant/**" /> |
| <include name="META-INF/ant.tasks" /> |
| </jar> |
| </target> |
| |
| <target name="coyote" |
| description="Build utils" > |
| <ant dir="../util" /> |
| <ant dir="../coyote" /> |
| </target> |
| |
| |
| <!-- ================ Experimental: Xdoclet =================== --> |
| |
| <!-- Use Javadoc tags to generate auxiliary files. |
| --> |
| <target name="xdoclet" depends="prepare"> |
| <path id="xdoclet.classpath"> |
| <pathelement location="../lib/xdoclet.jar"/> |
| <pathelement location="../lib/log4j-core.jar"/> |
| <pathelement location="${ant.home}/lib/ant.jar"/> |
| <path refid="build-main.classpath" /> |
| </path> |
| |
| |
| <taskdef name="webdoclet" |
| classname="xdoclet.web.WebDocletTask" |
| classpathref="xdoclet.classpath" /> |
| <taskdef name="document" |
| classname="xdoclet.doc.DocumentDocletTask" |
| classpathref="xdoclet.classpath" /> |
| <taskdef name="jmxdoclet" |
| classname="xdoclet.jmx.JMXDocletTask" |
| classpathref="xdoclet.classpath" /> |
| |
| <jmxdoclet sourcepath="java" |
| destdir="${jk.build}/jmx-java" |
| classpathref="xdoclet.classpath" |
| force="${xdoclet.force}"> |
| <fileset dir="java"> |
| <include name="**/*.java" /> |
| </fileset> |
| |
| <!-- Create the {0}MBean interface for the MBean --> |
| <mbeaninterface mergedir="java"/> |
| |
| <!-- Create the OpenJMX specific description adaptor class for the MBean --> |
| <openjmxDescription /> |
| |
| <!--create the jbossmx xml descriptor for the mbean--> |
| <jbossxmbean/> |
| |
| <!--create the jboss xml service template for the mbean--> |
| <jbossXmlServiceTemplate/> |
| </jmxdoclet> |
| |
| |
| <document sourcepath="java" |
| destdir="${jk.build}/todo" |
| classpathref="xdoclet.classpath" > |
| <fileset dir="java"> |
| <include name="**/*.java" /> |
| </fileset> |
| <info header="Todo list" |
| projectname="JK2" |
| tag="todo" /> |
| </document> |
| |
| </target> |
| |
| <!-- ================ javadocs =================== --> |
| <target name="javadoc" unless="docs-uptodate"> |
| <delete dir="${jk.build}/javadoc"/> |
| <mkdir dir="${jk.build}/javadoc"/> |
| <javadoc packagenames="org.apache.ajp,org.apache.ajp.tomcat4,org.apache.ajp,org.apache.ajp.tomcat5" |
| sourcepath="java" |
| classpath="${tomcat5.home}/server/lib/catalina.jar:${tomcat5.home}/common/lib/servlet-api.jar:${tomcat41.home}/server/lib/catalina.jar:${tomcat41.home}/common/lib/servlet.jar:${tomcat40.home}/server/lib/catalina.jar:${tomcat40.home}/common/lib/servlet.jar:${tomcat-util.jar}" |
| destdir="${jk.build}/javadoc" |
| author="true" |
| version="true" |
| windowtitle="Jk Connector Documentation" |
| doctitle="Jk Connector" |
| bottom="Copyright &#169; 2001-2012 Apache Software Foundation. All Rights Reserved." |
| /> |
| </target> |
| |
| <target name="clean"> |
| <delete dir="${jk.build}/classes"/> |
| <delete dir="${jk.build}/lib"/> |
| <delete dir="${jk.build}/javadoc"/> |
| <delete dir="${build.docs}"/> |
| </target> |
| |
| <!-- It's better to call it directly with individual tags --> |
| <target name="native" depends="jkant,detect,report" > |
| <ant dir="native" antfile="build.xml" /> |
| <ant dir="native2" antfile="build.xml" /> |
| </target> |
| |
| <target name="clean-native"> |
| <ant dir="native" antfile="build.xml" target="clean" /> |
| <ant dir="native2" antfile="build.xml" target="clean" /> |
| </target> |
| |
| |
| </project> |