+++ /dev/null
-<?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="Tomcat 7.0" default="extras" basedir=".">
-
-
- <!-- ===================== Initialize Property Values =================== -->
-
- <!-- We read customizable properties from the file "build.properties.default" -->
- <!-- and also from "build.properties" if it exists. -->
- <!-- The values in "build.properties" have stronger preference. -->
- <!-- If you want to customize your build, you can either change the values -->
- <!-- directly in the default file, or create a new build.properties and set -->
- <!-- the values there. This way you don't have to change a file which is part -->
- <!-- of the original project source code. -->
- <!-- See "build.properties.default" in the top level directory for some -->
- <!-- property values you may customize. -->
- <property file="${user.home}/build.properties"/>
- <property file="build.properties"/>
- <property file="build.properties.default"/>
-
- <!-- Build Defaults -->
- <property name="tomcat.classes" value="${basedir}/output/classes"/>
- <property name="tomcat.embed" value="${basedir}/output/embed"/>
- <property name="tomcat.extras" value="${basedir}/output/extras"/>
- <property name="tomcat.tmp" value="${basedir}/output/tmp"/>
-
- <!-- constant to declare a file binary for md5sum -->
- <property name="md5sum.binary-prefix" value=" *" />
-
- <!-- Servlet 3.0 spec requires 1.6+ -->
- <property name="compile.source" value="1.6"/>
-
- <!-- JAR artifacts -->
- <property name="tomcat-juli.jar" value="${tomcat.extras}/tomcat-juli.jar"/>
- <property name="tomcat-juli-adapters.jar" value="${tomcat.extras}/tomcat-juli-adapters.jar"/>
- <property name="catalina-ws.jar" value="${tomcat.extras}/catalina-ws.jar"/>
-
- <property name="catalina-jmx-remote.jar" value="${tomcat.extras}/catalina-jmx-remote.jar"/>
-
- <property name="tomcat-embed-log4j.jar" value="${tomcat.embed}/tomcat-embed-logging-log4j.jar"/>
-
- <!-- Classpath -->
- <path id="tomcat.classpath">
- <pathelement location="${tomcat.classes}"/>
- </path>
-
- <target name="prepare">
- <mkdir dir="${tomcat.extras}"/>
- <mkdir dir="${tomcat.embed}"/>
- </target>
-
- <target name="clean" description="Delete the default output folders">
- <delete dir="${tomcat.extras}"/>
- <delete dir="${tomcat.embed}"/>
- </target>
-
- <target name="commons-logging" depends="prepare"
- description="Build JULI for log4j extras package">
-
- <antcall target="downloadfile">
- <param name="sourcefile" value="${commons-logging-src.loc}"/>
- <param name="destfile" value="${tomcat.extras}/logging/commons-logging-src.tar.gz"/>
- <param name="destdir" value="${tomcat.extras}/logging/"/>
- </antcall>
- <gunzip src="${tomcat.extras}/logging/commons-logging-src.tar.gz"
- dest="${tomcat.extras}/logging/commons-logging-src.tar"/>
- <untar src="${tomcat.extras}/logging/commons-logging-src.tar"
- dest="${tomcat.extras}/logging/"/>
-
- <replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/src/java/org/apache/commons"
- encoding="ISO-8859-1">
- <replacefilter token="org.apache.commons"
- value="org.apache.juli" />
- </replace>
- <mkdir dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/src/java/org/apache/juli" />
- <move todir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/src/java/org/apache/juli">
- <fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/src/java/org/apache/commons" />
- </move>
-
- <replace dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src"
- encoding="ISO-8859-1">
- <replacefilter token="org.apache.commons"
- value="org.apache.juli" />
- <replacefilter token="org/apache/commons/"
- value="org/apache/juli/" />
- </replace>
- <copy tofile="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/build2.xml"
- file="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/build.xml" />
-
- <ant antfile="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/build2.xml"
- dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src"
- target="getlibs" />
- <copy todir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src">
- <fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/lib" />
- </copy>
- <ant antfile="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/build2.xml"
- dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src"
- target="compile" />
-
- <jar jarfile="${tomcat-juli.jar}"
- manifest="${tomcat.tmp}/default.manifest" >
- <fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/target/classes">
- <include name="org/apache/juli/logging/*.class" />
- <include name="org/apache/juli/logging/impl/LogFactoryImpl*.class" />
- <include name="org/apache/juli/logging/impl/WeakHashtable*.class" />
- <include name="org/apache/juli/logging/impl/SimpleLog*.class" />
- <include name="org/apache/juli/logging/impl/NoOpLog*.class" />
- <include name="org/apache/juli/logging/impl/Jdk14Logger.class" />
- <!-- Javadoc and i18n exclusions -->
- <exclude name="**/package.html" />
- <exclude name="**/LocalStrings_*" />
- </fileset>
- <fileset dir="${tomcat.classes}">
- <include name="org/apache/juli/*" />
- <!-- Javadoc and i18n exclusions -->
- <exclude name="**/package.html" />
- <exclude name="**/LocalStrings_*" />
- </fileset>
- <zipfileset file="res/META-INF/default.notice"
- fullpath="META-INF/NOTICE" />
- <zipfileset file="res/META-INF/default.license"
- fullpath="META-INF/LICENSE" />
- </jar>
- <antcall target="md5sum">
- <param name="file" value="${tomcat-juli.jar}" />
- </antcall>
-
- <jar jarfile="${tomcat-juli-adapters.jar}"
- manifest="${tomcat.tmp}/default.manifest" >
- <fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/target/classes">
- <include name="org/apache/juli/logging/impl/**.class" />
- <exclude name="org/apache/juli/logging/impl/WeakHashtable*.class" />
- <exclude name="org/apache/juli/logging/impl/LogFactoryImpl.class" />
- <!-- Javadoc and i18n exclusions -->
- <exclude name="**/package.html" />
- <exclude name="**/LocalStrings_*" />
- </fileset>
- <zipfileset file="res/META-INF/default.notice"
- fullpath="META-INF/NOTICE" />
- <zipfileset file="res/META-INF/default.license"
- fullpath="META-INF/LICENSE" />
- </jar>
- <antcall target="md5sum">
- <param name="file" value="${tomcat-juli-adapters.jar}" />
- </antcall>
- </target>
-
- <target name="webservices" depends="prepare"
- description="Build web services extras package">
-
- <mkdir dir="${tomcat.extras}/webservices"/>
-
- <antcall target="downloadfile">
- <param name="sourcefile" value="${jaxrpc-src.loc}"/>
- <param name="destfile" value="${tomcat.extras}/webservices/jaxrpc.jar"/>
- <param name="destdir" value="${tomcat.extras}/webservices/"/>
- </antcall>
-
- <antcall target="downloadfile">
- <param name="sourcefile" value="${wsdl4j-src.loc}"/>
- <param name="destfile" value="${tomcat.extras}/webservices/wsdl4j.jar"/>
- <param name="destdir" value="${tomcat.extras}/webservices/"/>
- </antcall>
-
- <!-- Classpath -->
- <path id="tomcat.webservices.classpath">
- <pathelement path="${tomcat.classpath}"/>
- <fileset dir="${tomcat.extras}/webservices">
- <include name="jaxrpc.jar"/>
- <include name="wsdl4j.jar"/>
- </fileset>
- </path>
-
- <!-- Compile internal server components -->
- <javac srcdir="java" destdir="${tomcat.classes}"
- debug="${compile.debug}"
- deprecation="${compile.deprecation}"
- source="${compile.source}"
- optimize="${compile.optimize}"
- encoding="ISO-8859-1">
- <classpath refid="tomcat.webservices.classpath" />
- <include name="org/apache/naming/factory/webservices/**" />
- </javac>
-
- <!-- Catalina Main JAR File -->
- <jar jarfile="${catalina-ws.jar}"
- manifest="${tomcat.tmp}/default.manifest">
- <fileset dir="${tomcat.classes}">
- <include name="org/apache/naming/factory/webservices/**" />
- <!-- Javadoc and i18n exclusions -->
- <exclude name="**/package.html" />
- <exclude name="**/LocalStrings_*" />
- </fileset>
- <zipfileset file="res/META-INF/default.notice"
- fullpath="META-INF/NOTICE" />
- <zipfileset file="res/META-INF/default.license"
- fullpath="META-INF/LICENSE" />
- </jar>
- <antcall target="md5sum">
- <param name="file" value="${catalina-ws.jar}" />
- </antcall>
- </target>
-
- <target name="jmx-remote" depends="prepare"
- description="Build JMX remote extras package">
- <!-- Create the JAR file -->
- <jar jarfile="${catalina-jmx-remote.jar}"
- manifest="${tomcat.tmp}/default.manifest" >
- <fileset dir="${tomcat.classes}">
- <include name="org/apache/catalina/mbeans/JmxRemote*" />
- </fileset>
- <zipfileset file="res/META-INF/default.notice"
- fullpath="META-INF/NOTICE" />
- <zipfileset file="res/META-INF/default.license"
- fullpath="META-INF/LICENSE" />
- </jar>
- <antcall target="md5sum">
- <param name="file" value="${catalina-jmx-remote.jar}" />
- </antcall>
- </target>
-
- <target name="extras" depends="prepare,commons-logging,webservices,jmx-remote"
- description="Build all extras packages">
- </target>
-
- <target name="embed" depends="extras"
- description="Embedded packaging for those extras that can use it">
-
- <jar jarfile="${tomcat-embed-log4j.jar}"
- manifest="${tomcat.tmp}/default.manifest" >
- <fileset dir="${tomcat.extras}/logging/commons-logging-${commons-logging-version}-src/target/classes">
- <include name="org/apache/juli/logging/*.class" />
- <include name="org/apache/juli/logging/impl/*.class" />
- <!-- Javadoc and i18n exclusions -->
- <exclude name="**/package.html" />
- <exclude name="**/LocalStrings_*" />
- </fileset>
- <fileset dir="${tomcat.classes}">
- <include name="org/apache/juli/*" />
- <!-- Javadoc and i18n exclusions -->
- <exclude name="**/package.html" />
- <exclude name="**/LocalStrings_*" />
- </fileset>
- <zipfileset file="res/META-INF/default.notice"
- fullpath="META-INF/NOTICE" />
- <zipfileset file="res/META-INF/default.license"
- fullpath="META-INF/LICENSE" />
- </jar>
- <antcall target="md5sum">
- <param name="file" value="${tomcat-embed-log4j.jar}" />
- </antcall>
- </target>
-
- <!-- Download and dependency building -->
- <target name="proxyflags">
- <!-- check proxy parameters. -->
- <condition property="useproxy">
- <equals arg1="${proxy.use}" arg2="on" />
- </condition>
- </target>
-
- <target name="setproxy" depends="proxyflags" if="useproxy">
- <taskdef name="setproxy"
- classname="org.apache.tools.ant.taskdefs.optional.net.SetProxy" />
- <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
- proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
- <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="downloadfile" unless="exist" depends="setproxy,testexist">
- <!-- Download extract the file -->
- <mkdir dir="${destdir}" />
- <get src="${sourcefile}" dest="${destfile}" />
- </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>
-
- <!-- Helper target, used to create a md5 checksum file -->
- <!-- Requires 'file' as a parameter. -->
- <target name="md5sum">
- <fail unless="file" />
- <fail if="filename" />
- <fail if="value" />
- <basename file="${file}" property="filename" />
- <checksum file="${file}" property="value" />
- <echo file="${file}.md5" message="${value}${md5sum.binary-prefix}${filename}" />
- </target>
-</project>