| <?xml version="1.0"?> |
| |
| <project name="Webapp Module" default="all" basedir="."> |
| |
| <!-- === BUILD ENVIRONMENT =============================================== --> |
| |
| <!-- ANT FIX: basedir is alwats relative to build.xml --> |
| <property name="basedir" value="${basedir}"/> |
| <property name="targdir" value="${user.dir}"/> |
| |
| <!-- The properties file which will override what's written below --> |
| <property file="${targdir}/build.properties"/> |
| |
| <!-- The WebApp version string --> |
| <property name="version" value="unknown"/> |
| |
| <!-- The layout of the build directory (shared with Makefile(s) --> |
| <property name="build.home" value="${targdir}/build"/> |
| <property name="build.jar" value="${build.home}/tomcat-warp.jar"/> |
| <property name="build.classes" value="${build.home}/classes"/> |
| <property name="build.docs" value="${build.home}/docs"/> |
| <property name="build.javadoc" value="${build.docs}/api-java"/> |
| |
| <!-- The layout of the sources directory --> |
| <property name="source.home" value="${basedir}"/> |
| <property name="source.java" value="${source.home}/java"/> |
| <property name="source.docs" value="${source.home}/docs"/> |
| |
| <!-- Classpath where we need to find stuff (no matter what) --> |
| <path id="classpath"> |
| <pathelement location="${build.classes.dir}"/> |
| <pathelement location="${catalina.home}/server/lib/catalina.jar"/> |
| <pathelement location="${catalina.home}/common/lib/servlet.jar"/> |
| <pathelement location="${catalina.home}/common/lib/servlet-api.jar"/> |
| </path> |
| |
| <!-- === PREPARATION AND GLOBAL TASKS ==================================== --> |
| |
| <target |
| name="init" |
| description="Dump some messages for Make"> |
| |
| <!-- Dump some messages about what we're going to do --> |
| <echo message="Building ${ant.project.name} (version ${version})"/> |
| <echo message="- source path: ${basedir}"/> |
| <echo message="- target path: ${targdir}"/> |
| </target> |
| |
| <!-- |
| Prepare the build directory creating all its subdirectories |
| and check for Tomcat 4 and Xalan in the classpath |
| --> |
| <target |
| name="prepare" |
| description="Prepare the build tree and check classes"> |
| |
| <!-- Create some directories --> |
| <mkdir dir="${build.home}"/> |
| |
| <!-- Check if we can find Container class in the classpath --> |
| <available |
| property="avail.tomcat" |
| classname="org.apache.catalina.Container"> |
| <classpath refid="classpath"/> |
| </available> |
| |
| <!-- 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> |
| |
| <!-- |
| Do-everything target: We want to build docs, javadocs, and compile |
| our sources all in one step... |
| --> |
| <target |
| name="all" |
| description="Build everything" |
| depends="compile,docs,javadoc"/> |
| |
| <!-- |
| Clean up all we generated using ANT (and nothing more) |
| --> |
| <target |
| name="clean" |
| description="Clean up what we built" |
| depends="compile.clean,docs.clean,javadoc.clean"/> |
| |
| |
| <!-- === COMPILATION TASKS =============================================== --> |
| |
| <!-- |
| Check if we found the Tomcat 4.0 classes in our classpath and fail |
| miserably (don't even try to compile) if we didn't. |
| --> |
| <target |
| name="compile.check" |
| depends="prepare" |
| description="Fail build if we don't find Tomcat 4.0" |
| unless="avail.tomcat"> |
| |
| <!-- Just jump out --> |
| <fail message="Cannot find Tomcat 4.0 classes"/> |
| </target> |
| |
| <!-- |
| Delete the generated classes and JAR file. |
| --> |
| <target |
| name="compile.clean" |
| description="Clean up the JAR file and all classes"> |
| <delete file="${build.jar}"/> |
| <delete dir="${build.classes}"/> |
| </target> |
| |
| |
| <!-- |
| Create the directory where classes will be compiled into, then compile |
| our sources, copy over all non-java files, and build up the final JAR. |
| --> |
| <target |
| name="compile" |
| depends="compile.check" |
| description="Compile the WARP connector" |
| if="avail.tomcat"> |
| |
| <!-- Create the directory where we're going to store the classes --> |
| <mkdir dir="${build.classes}"/> |
| |
| <!-- Compile our sources --> |
| <javac |
| srcdir="${source.java}" |
| destdir="${build.classes}" |
| debug="${compile.debug}" |
| deprecation="${compile.deprecation}"> |
| <classpath refid="classpath"/> |
| </javac> |
| |
| <!-- Copy all non-java files into the target directory --> |
| <copy |
| todir="${build.classes}"> |
| <fileset |
| dir="${source.java}"> |
| <exclude name="**/*.java"/> |
| </fileset> |
| </copy> |
| |
| <!-- Build up our JAR file --> |
| <jar |
| jarfile="${build.jar}" |
| basedir="${build.classes}" /> |
| </target> |
| |
| |
| <!-- === DOCUMENT GENERATION TASKS ======================================= --> |
| |
| <!-- |
| Check if we found Xalan in our classpath. We require Xalan because it has |
| some nifty functions that we use throughout the XSLT (and also because |
| we want people to eat our own food, right?) |
| --> |
| <target |
| name="docs.check" |
| depends="prepare" |
| description="Fail if we don't find Xalan" |
| unless="avail.xalan"> |
| |
| <!-- Just jump out --> |
| <fail message="Cannot find the Apache Xalan XSLT processor"/> |
| </target> |
| |
| <!-- |
| Delete the generated documentation |
| --> |
| <target |
| name="docs.clean" |
| description="Clean up the generated docs directory"> |
| <delete dir="${build.docs}"/> |
| </target> |
| |
| <!-- |
| Generate documentation from the XML sources. |
| --> |
| <target |
| name="docs" |
| depends="docs.check" |
| description="Create Documentation"> |
| |
| <!-- Create the directory where we're going to store the docs --> |
| <mkdir dir="${build.docs}"/> |
| |
| <!-- Add some style to our otherwise utterly ugly XML files --> |
| <style |
| basedir="${source.docs}" |
| destdir="${build.docs}" |
| style="${source.docs}/style.xsl" |
| includes="**.xml"/> |
| |
| <!-- Copy all relevant (non processed) files from the sources --> |
| <copy |
| todir="${build.docs}" > |
| <fileset dir="${source.docs}"> |
| <exclude name="**.xml"/> |
| <exclude name="**.xsl"/> |
| <exclude name="**.idx"/> |
| <exclude name="**/images/originals/**"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| |
| <!-- === JAVADOC TASKS =================================================== --> |
| |
| <!-- |
| Check if we found the Tomcat 4.0 classes in our classpath and echo a |
| message if we didn't find it (warnings are allright, ugly, but OK). |
| --> |
| <target |
| name="javadoc.check" |
| depends="prepare" |
| description="Warn if we didn't find Tomcat 4.0" |
| unless="avail.tomcat"> |
| |
| <!-- Just output a simple warning message --> |
| <echo message="Cannot find Tomcat 4.0. Warnings in JavaDOC are ok"/> |
| </target> |
| |
| <!-- |
| Delete the generated JavaDOC output |
| --> |
| <target |
| name="javadoc.clean" |
| description="Clean up the generated javadoc directory"> |
| <delete dir="${build.javadoc}"/> |
| </target> |
| |
| <!-- |
| Run JavaDOC over our set of java sources. |
| --> |
| <target |
| name="javadoc" |
| depends="prepare" |
| description="Create Java API documentation"> |
| |
| <!-- Create the directory where we're going to store the docs --> |
| <mkdir dir="${build.docs}"/> |
| <mkdir dir="${build.javadoc}"/> |
| |
| <!-- Run JavaDoc --> |
| <javadoc |
| sourcepath="${source.java}" |
| destdir="${build.javadoc}" |
| packagenames="org.apache.catalina.connector.warp" |
| author="true" |
| private="false" |
| version="true" |
| doctitle="<h1>${component.title}</h1>" |
| windowtitle="${component.title} (Version ${component.version})" |
| bottom="Copyright (c) 2001-2002 - Apache Software Foundation"> |
| <classpath refid="classpath"/> |
| </javadoc> |
| </target> |
| |
| </project> |
| |
| |