blob: 5f80f61764fb7d6641af49f5dd44556ade93710a [file] [log] [blame]
<?xml version="1.0"?>
<!--
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="Jtc" default="dist" basedir=".">
<!-- ========== Initialize Properties ===================================== -->
<property file="${user.home}/build.properties"/> <!-- User local -->
<property file="build.properties"/> <!-- Component local -->
<property file="build.properties.default"/>
<property name="dist.dir" location="dist" />
<property name="lib.dir" location="${dist.dir}/lib" />
<property name="build.dir" location="build" />
<target name="dist"
description="Compile jtc distribution" depends="build,javadoc">
<copy todir="${dist.dir}" >
<fileset dir="." >
<include name="LICENSE" />
<include name="build.xml" />
<include name="build.properties.default" />
<include name="README.txt" />
<include name="RELEASE-NOTES.txt" />
<include name="doc/**" />
</fileset>
</copy>
<jar file="${dist.dir}/tomcat-connectors-src.jar">
<fileset dir="." includes="**" >
<exclude name="webapp/**"/>
<exclude name="naming/**"/>
<exclude name="build/**"/>
<exclude name="dist/**"/>
<exclude name="release/**"/>
<exclude name="scandoc/**"/>
</fileset>
</jar>
</target>
<target name="build"
description="Compile jtc">
<mkdir dir="${build.dir}/classes" />
<mkdir dir="${lib.dir}" />
<ant dir="util">
<property name="puretls.jar" value="${puretls.jar}" />
<property name="jsse.lib" value="${jsse.lib}" />
<property name="tomcat-util.build" value="${build.dir}" />
<property name="tomcat-util.lib" value="${lib.dir}" />
</ant>
<ant dir="coyote" target="compile">
<property name="catalina.home" value="${tomcat41.home}"/>
<property name="tomcat33.home" value="${tomcat33.home}"/>
<property name="build.home" value="${build.dir}"/>
<property name="tomcat5.detect" value="true"/> <!-- This is a hack to disable ajp -->
<property name="servlet.jar" value="${tomcat41.home}/common/lib/servlet.jar" />
<property name="tomcat-coyote.jar" value="${lib.dir}/tomcat-coyote.jar" />
<property name="tomcat33-coyote.jar" value="${lib.dir}/tomcat33-coyote.jar" />
<property name="tomcat4-coyote.jar" value="${lib.dir}/tomcat4-coyote.jar" />
<property name="tomcat-util.jar"
value="${lib.dir}/tomcat-util.jar"/>
<property name="servlet.jar" value="${servlet-api.jar}"/>
</ant>
<ant dir="http11">
<property name="build.home" value="${build.dir}"/>
<property name="tomcat-http11.jar" value="${lib.dir}/tomcat-http11.jar"/>
<property name="tomcat-coyote.jar" value="${lib.dir}/tomcat-coyote.jar" />
<property name="commons-logging.jar" value="${commons-logging.jar}"/>
</ant>
<ant dir="jk" target="build-jk">
<property name="commons-logging.jar" value="${commons-logging.jar}"/>
<property name="jmx.jar" value="${jmx.jar}"/>
<property name="jmx.detect" value="true"/>
<property name="tomcat-coyote.jar" value="${lib.dir}/tomcat-coyote.jar" />
<property name="jk.build" value="${build.dir}"/>
<property name="tomcat-jk2.jar" value="${lib.dir}/tomcat-jk2.jar" />
<property name="tomcat-jkconfig.jar" value="${lib.dir}/jkconfig.jar" />
<!-- don't include in dist -->
<property name="tomcat5.detect" value="true"/>
<property name="tomcat-jk.jar" value="${build.dir}/lib/tomcat-jk.jar" />
<property name="tomcat-jkshm.jar" value="${build.dir}/lib/jkshm.jar" />
<property name="tomcat-jni.jar" value="${build.dir}/lib/tomcat-jni.jar" />
</ant>
<jar file="${dist.dir}/lib/tomcat33-resources.jar" >
<fileset dir="${build.dir}/classes" >
<include name="**/*.properties" />
</fileset>
</jar>
<jar file="${dist.dir}/tomcat-connectors.jar">
<fileset dir="${build.dir}/classes" >
<include name="**" />
<exclude name="org/apache/ajp/**" />
</fileset>
</jar>
</target>
<target name="javadoc"
description="javadocs">
<mkdir dir="${dist.dir}/doc/api"/>
<path id="compile.classpath">
<pathelement location="${build.dir}/classes" />
<pathelement location="${jmx.jar}" />
<pathelement location="${jsse.jar}" />
<pathelement location="${java.home}/lib/jsse.jar" />
<pathelement location="${jnet.jar}" />
<pathelement location="${jcert.jar}" />
<pathelement location="${puretls.jar}" />
<pathelement location="${commons-logging.jar}" />
<pathelement location="${commons-modeler.jar}" />
</path>
<javadoc
destdir="${dist.dir}/doc/api"
author="true"
version="true"
windowtitle="Tomcat Connector Documentation"
doctitle="Tomcat Connector"
bottom="Copyright &amp;#169; 2003-2011 Apache Software Foundation. All Rights Reserved.">
<fileset dir="util/java" includes="**/*.java"/>
<fileset dir="coyote/src/java" includes="**/*.java">
</fileset>
<fileset dir="http11/src/java" includes="**/*.java"/>
<fileset dir="jk/java" includes="**/*.java">
<exclude name="org/apache/ajp/**"/>
</fileset>
<classpath refid="compile.classpath"/>
</javadoc>
</target>
<target name="coyote"
description="Compile Coyote and all related protocols">
<ant dir="util" />
<ant dir="coyote" target="compile" />
<ant dir="http11" />
<ant dir="jk" target="build-jk"/>
<jar jarfile="jtc.jar"
manifest="coyote/src/conf/MANIFEST.MF" >
<fileset dir="util/build/classes" includes="org/apache/**" />
<fileset dir="coyote/build/classes" includes="org/apache/coyote/**" />
<fileset dir="http11/build/classes" includes="org/apache/coyote/**" />
<fileset dir="jk/build/classes" >
<include name="org/apache/**" />
<exclude name="org/apache/jk/ant/**" />
</fileset>
</jar>
</target>
<target name="clean" description="Delete build and dist trees">
<delete dir="dist" />
<delete dir="build" />
</target>
<target name="download" depends="proxyflags"
description="Download binary packages" >
<mkdir dir="${base.path}" />
<antcall target="downloadgz">
<param name="sourcefile" value="${commons-logging.loc}"/>
<param name="destfile" value="${commons-logging.jar}"/>
</antcall>
<antcall target="downloadgz">
<param name="sourcefile" value="${commons-modeler.loc}"/>
<param name="destfile" value="${commons-modeler.jar}"/>
</antcall>
<antcall target="downloadgz">
<param name="sourcefile" value="${jmx.loc}"/>
<param name="destfile" value="${jmx.jar}"/>
</antcall>
<antcall target="downloadgz">
<param name="sourcefile" value="${tomcat5.loc}"/>
<param name="destfile" value="${tomcat5.jar}"/>
</antcall>
<antcall target="downloadgz">
<param name="sourcefile" value="${tomcat41.loc}"/>
<param name="destfile" value="${tomcat41.jar}"/>
</antcall>
<antcall target="downloadgz">
<param name="sourcefile" value="${tomcat33.loc}"/>
<param name="destfile" value="${tomcat33.jar}"/>
</antcall>
<antcall target="downloadgz">
<param name="sourcefile" value="${regexp.loc}"/>
<param name="destfile" value="${regexp.jar}"/>
</antcall>
</target>
<!-- Common download targets - we should use an import with ant1.6. This is cut&paste from tocmat5 -->
<target name="proxyflags">
<!-- check proxy parameters. -->
<condition property="useproxy">
<equals arg1="${proxy.use}" arg2="on" />
</condition>
</target>
<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="testsrc">
<echo message="Testing for ${destfile} versus ${cvs.base}/${location}/src"/>
<uptodate property="exist"
targetfile="${destfile}">
<srcfiles dir="${cvs.base}/${location}/src" includes="**" />
</uptodate>
</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="release" >
<property name="ver" value="1.1M1" />
<!--
<property name="tag" value="JTC_1_1_M1" />
-->
<property name="tag" value="HEAD" />
<property name="rel.name" value="tomcat-connectors" />
<!--
-->
<delete dir="release" />
<mkdir dir="release" />
<cvs command="checkout"
package="jakarta-tomcat-connectors"
cvsroot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"
dest="release"
tag="${tag}"/>
<rename src="release/jakarta-tomcat-connectors" dest="release/${rel.name}-${ver}-src" />
<zip file="release/${rel.name}-${ver}-src.zip" >
<fileset dir="release" >
<include name="${rel.name}-${ver}-src/**" />
<exclude name="${rel.name}-${ver}-src/webapp/**" />
<exclude name="${rel.name}-${ver}-src/build/**" />
<exclude name="${rel.name}-${ver}-src/dist/**" />
<exclude name="${rel.name}-${ver}-src/scandoc/**" />
<exclude name="${rel.name}-${ver}-src/naming/**" />
</fileset>
</zip>
<tar tarfile="release/${rel.name}-${ver}-src.tar" >
<tarfileset dir="release" >
<include name="${rel.name}-${ver}-src/**" />
<exclude name="${rel.name}-${ver}-src/webapp/**" />
<exclude name="${rel.name}-${ver}-src/build/**" />
<exclude name="${rel.name}-${ver}-src/dist/**" />
<exclude name="${rel.name}-${ver}-src/scandoc/**" />
<exclude name="${rel.name}-${ver}-src/naming/**" />
</tarfileset>
</tar>
<gzip zipfile="release/${rel.name}-${ver}-src.tar.gz" src="release/${rel.name}-${ver}-src.tar"/>
<delete file="release/${rel.name}-${ver}-src.tar" />
<!--
-->
<ant dir="release/${rel.name}-${ver}-src" target="download" />
<ant dir="release/${rel.name}-${ver}-src" target="dist" inheritAll="false" />
<mkdir dir="release/${rel.name}-${ver}" />
<copy todir="release/${rel.name}-${ver}" >
<fileset dir="release/${rel.name}-${ver}-src/dist" includes="**"/>
</copy>
<copy file="release/${rel.name}-${ver}/${rel.name}.jar" tofile="release/${rel.name}-${ver}.jar" />
<zip file="release/${rel.name}-${ver}.zip" >
<fileset dir="release" includes="${rel.name}-${ver}/**"/>
</zip>
<tar tarfile="release/${rel.name}-${ver}.tar" >
<tarfileset dir="release" includes="${rel.name}-${ver}/**"/>
</tar>
<gzip zipfile="release/${rel.name}-${ver}.tar.gz" src="release/${rel.name}-${ver}.tar"/>
</target>
</project>