blob: 1f3ea0038404ab734660b7a68e10f1610aa7b00e [file] [log] [blame]
<?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="tomcat-util" default="build-main" basedir=".">
<!-- ===================== Initialize Property Values =================== -->
<property file="${user.home}/build.properties"/>
<property file="build.properties"/>
<property file="../build.properties.default"/>
<property file="build.properties.sample"/>
<property name="tomcat-util.build" value="${basedir}/build"/>
<property name="jsse.home" location="${base.path}/jsse1.0.2"/>
<property name="jsse.lib" location="${jsse.home}/lib"/>
<property name="jsse.jar" location="${jsse.lib}/jsse.jar"/>
<property name="jnet.jar" location="${jsse.lib}/jnet.jar"/>
<property name="jcert.jar" location="${jsse.lib}/jcert.jar"/>
<property name="puretls.home" location="${base.path}/puretls"/>
<property name="puretls.lib" location="${puretls.home}"/>
<property name="puretls.jar" location="${puretls.lib}/puretls.jar"/>
<property name="commons-logging.jar" location="${base.path}/commons-logging-1.0.4/commons-logging.jar" />
<property name="jmx.jar" location="${base.path}/mx4j-2.0.1/lib/mx4j.jar" />
<property name="tomcat-util.lib" value="${tomcat-util.build}/lib" />
<property name="tomcat-util.jar" value="${tomcat-util.lib}/tomcat-util.jar" />
<property name="tomcat-loader.jar" value="${tomcat-util.lib}/tomcat-loader.jar" />
<property name="tomcat-jni.jar" value="../jni/dist/tomcat-native-1.0.0.jar" />
<path id="compile.classpath">
<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}" />
<pathelement location="${tomcat-jni.jar}" />
</path>
<target name="detect">
<available property="jsse.present" classname="javax.net.ssl.SSLSocket"/>
<available property="jmx.present" file="${jmx.jar}"/>
<available property="puretls.present" file="${puretls.jar}"/>
<available property="commons-logging.present" file="${commons-logging.jar}"/>
<available property="modeler.present" file="${commons-modeler.jar}"/>
<available property="jdk1.4.present" classname="java.lang.CharSequence" />
<available property="jdk1.5.present" classname="javax.net.ssl.CertPathTrustManagerParameters" />
</target>
<target name="build-prepare" depends="detect">
<mkdir dir="${tomcat-util.build}"/>
<mkdir dir="${tomcat-util.build}/classes"/>
<mkdir dir="${tomcat-util.lib}"/>
</target>
<target name="build-main" depends="tomcat-util.jar"/> <!--tomcat-loader.jar -->
<target name="tomcat-util.jar" depends="build-prepare">
<echo message="----- Java-utils -----" />
<echo message="-- puretls.present = ${puretls.present}" />
<echo message="-- jsse.present = ${jsse.present} ${jsse.jar}"/>
<echo message="-- commons-logging = ${commons-logging.present}"/>
<echo message="-- jmx = ${jmx.present} ${jmx.jar}"/>
<echo message="-- modeler = ${modeler.present} ${commons-modeler.jar}"/>
<echo message="-- skip.digester = ${skip.digester}" />
<echo message="-- JDK14 = ${jdk1.4.present}"/>
<echo message="-- JDK15 = ${jdk1.5.present}" />
<javac srcdir="java"
destdir="${tomcat-util.build}/classes"
deprecation="${compile.deprecation}"
debug="${compile.debug}"
optimize="off"
verbose="off"
excludes="**/CVS/**"
encoding="ISO-8859-1">
<classpath refid="compile.classpath"/>
<exclude name="**/util/net/jsse/*" unless="jsse.present"/>
<exclude name="**/util/log/CommonLogHandler.java" unless="commons-logging.present"/>
<exclude name="**/util/net/puretls/*" unless="puretls.present"/>
<exclude name="**/util/mx/*" unless="jmx.present"/>
<exclude name="**/util/threads/ThreadPoolMX*" unless="modeler.present"/>
<exclude name="**/util/compat/Jdk14Compat.java" unless="jdk1.4.present" />
<exclude name="**/util/net/jsse/JSSE14*" unless="jdk1.4.present" />
<exclude name="**/util/net/jsse/JSSE15*" unless="jdk1.5.present" />
<exclude name="**/util/net/jsse/JSSEKeyManager.java" unless="jdk1.4.present" />
<exclude name="**/util/digester/*" if="skip.digester" />
<exclude name="**/util/net/AprEndpoint.java" unless="jdk1.4.present" />
</javac>
<!-- Copy static resource files -->
<copy todir="${tomcat-util.build}/classes">
<fileset dir="java">
<include name="**/*.properties"/>
</fileset>
</copy>
<!-- Copy static resource files -->
<copy todir="${tomcat-util.build}/classes">
<fileset dir="java">
<include name="**/*.properties"/>
</fileset>
</copy>
<jar jarfile="${tomcat-util.jar}"
basedir="${tomcat-util.build}/classes"
manifest="java/tomcat-util.manifest" >
<include name="org/apache/tomcat/util/**"/>
</jar>
</target>
<target name="tomcat-loader.jar" depends="build-prepare">
<mkdir dir="${tomcat-util.build}/loader"/>
<javac srcdir="loader"
destdir="${tomcat-util.build}/loader"
deprecation="${compile.deprecation}"
debug="${compile.debug}"
optimize="off"
verbose="off"
excludes="**/CVS/**"
encoding="ISO-8859-1">
<classpath refid="compile.classpath"/>
</javac>
<jar jarfile="${tomcat-loader.jar}"
basedir="${tomcat-util.build}/loader"
manifest="loader/tomcat-loader.manifest" >
<include name="org/apache/tomcat/util/loader/**"/>
</jar>
</target>
<!-- ================ BUILD: Create Tomcat-Util Javadocs =================== -->
<target name="javadoc" unless="docs-uptodate">
<delete dir="${tomcat-util.build}/javadoc"/>
<mkdir dir="${tomcat-util.build}/javadoc"/>
<javadoc packagenames="org.apache.tomcat.util.*"
sourcepath="java"
destdir="${tomcat-util.build}/javadoc"
author="true"
version="true"
windowtitle="Tomcat Utilities Documentation"
doctitle="Tomcat Utilities"
bottom="Copyright &amp;#169; 2001-2012 Apache Software Foundation. All Rights Reserved.">
<classpath refid="compile.classpath"/>
</javadoc>
</target>
<target name="clean">
<delete dir="${tomcat-util.build}"/>
</target>
</project>