| <?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="Servlet API Classes" default="compile" basedir="."> |
| |
| |
| <!-- =================== Environmental Properties ======================= --> |
| |
| <!-- Load user property definition overrides --> |
| <property file="build.properties"/> |
| <property file="${user.home}/build.properties"/> |
| |
| <!-- Establish property definition defaults --> |
| <property name="compile.debug" value="true"/> |
| <property name="compile.deprecation" value="false"/> |
| <property name="compile.optimize" value="true"/> |
| <property name="implementation.revision" value="public_draft"/> |
| <property name="servlet-api.build" value="build"/> |
| <property name="servlet-api.dist" value="dist"/> |
| <property name="servlet-api.jar" value="${servlet-api.dist}/lib/servlet-api.jar"/> |
| <path id="examples.classpath"> |
| <pathelement location="${servlet-api.build}/classes"/> |
| </path> |
| |
| |
| <!-- ===================== Prepare Directories ========================= --> |
| <target name="prepare"> |
| |
| <!-- "Build" Hierarchy --> |
| <mkdir dir="${servlet-api.build}"/> |
| <mkdir dir="${servlet-api.build}/classes"/> |
| <mkdir dir="${servlet-api.build}/docs"/> |
| <mkdir dir="${servlet-api.build}/docs/api"/> |
| <mkdir dir="${servlet-api.build}/examples"/> |
| |
| <!-- "Dist" Hierarchy --> |
| <mkdir dir="${servlet-api.dist}"/> |
| <mkdir dir="${servlet-api.dist}/docs"/> |
| <mkdir dir="${servlet-api.dist}/docs/api"/> |
| <mkdir dir="${servlet-api.dist}/lib"/> |
| <mkdir dir="${servlet-api.dist}/src"/> |
| <mkdir dir="${servlet-api.dist}/examples"/> |
| |
| <uptodate property="docs.uptodate" targetfile="${servlet-api.build}/docs/api/index.html"> |
| <srcfiles dir="src/share" includes="**/*.java" /> |
| </uptodate> |
| </target> |
| |
| |
| <!-- ======================= Static Files ============================== --> |
| <target name="static" depends="prepare"> |
| |
| <!-- "Dist" Hierarchy --> |
| <copy todir="${servlet-api.dist}"> |
| <fileset dir="." includes="BUILDING.txt"/> |
| <fileset dir="." includes="LICENSE"/> |
| <fileset dir="." includes="README.txt"/> |
| </copy> |
| |
| </target> |
| |
| |
| <!-- ======================== Compile Classes ========================== --> |
| <target name="compile" depends="static" |
| description="Compile API classes (Default)"> |
| |
| <!-- Java classes --> |
| <javac srcdir="src/share" destdir="${servlet-api.build}/classes" |
| debug="${compile.debug}" deprecation="${compile.deprecation}" |
| optimize="${compile.optimize}" |
| encoding="ISO-8859-1"/> |
| |
| <!-- Associated property files --> |
| <copy todir="${servlet-api.build}/classes"> |
| <fileset dir="src/share"> |
| <include name="**/*.properties"/> |
| </fileset> |
| </copy> |
| |
| <!-- Servlet resources --> |
| <copy todir="${servlet-api.build}/classes/javax/servlet/resources"> |
| <fileset dir="src/share/dtd" includes="*.dtd,*.xsd"> |
| <exclude name="jsp*.dtd"/> |
| <exclude name="web-jsp*.dtd"/> |
| </fileset> |
| </copy> |
| |
| </target> |
| |
| |
| <!-- ======================== Build JavaDoc =========================== --> |
| <target name="javadoc" depends="prepare" unless="docs.uptodate"> |
| |
| <javadoc packagenames="javax.servlet.*" |
| sourcepath="${basedir}/src/share" |
| destdir="${servlet-api.build}/docs/api" |
| use="true" |
| windowtitle="Servlet API Documentation" |
| doctitle="Servlet API Documentation" |
| bottom="Copyright &copy; 1999-2012 The Apache Software Foundation. All Rights Reserved."/> |
| |
| </target> |
| |
| |
| <!-- ======================== Build JavaDoc =========================== --> |
| <target name="examples" depends="prepare"> |
| |
| <copy todir="${servlet-api.build}/examples"> |
| <fileset dir="examples"> |
| <exclude name="build.*"/> |
| </fileset> |
| </copy> |
| |
| <javac srcdir="examples/WEB-INF/classes" |
| destdir="${servlet-api.build}/examples/WEB-INF/classes" |
| debug="${compile.debug}" deprecation="${compile.deprecation}" |
| optimize="${compile.optimize}" |
| excludes="**/CVS/**" |
| encoding="ISO-8859-1"> |
| <classpath refid="examples.classpath" /> |
| </javac> |
| |
| <jar jarfile="${servlet-api.dist}/examples/examples.war" |
| basedir="${servlet-api.build}/examples" includes="**"/> |
| |
| </target> |
| |
| |
| <!-- ===================== Distribution Files ========================= --> |
| <target name="jar" depends="compile" |
| description="Create the jar"> |
| |
| <!-- Prepare Manifest --> |
| <copy tofile="${servlet-api.build}/manifest" |
| file="src/etc/manifest" overwrite="yes" encoding="ISO-8859-1"> |
| <filterset> |
| <filter token="implementation.revision" |
| value="${implementation.revision}"/> |
| </filterset> |
| </copy> |
| |
| <!-- Create JAR file --> |
| <jar jarfile="${servlet-api.jar}" |
| basedir="${servlet-api.build}/classes" |
| manifest="${servlet-api.build}/manifest"> |
| <include name="javax/servlet/**"/> |
| <exclude name="javax/servlet/jsp/**"/> |
| </jar> |
| |
| </target> |
| |
| <target name="dist" depends="compile,examples,javadoc,jar" |
| description="Create binary distribution"> |
| |
| <!-- Copy Javadocs --> |
| <copy todir="${servlet-api.dist}/docs/api"> |
| <fileset dir="${servlet-api.build}/docs/api"/> |
| </copy> |
| |
| <!-- Copy API source files --> |
| <copy todir="${servlet-api.dist}/src"> |
| <fileset dir="src/share"/> |
| </copy> |
| |
| </target> |
| |
| |
| <!-- ====================== Clean Generated Files ===================== --> |
| <target name="clean" |
| description="Clean previous build results"> |
| |
| <delete dir="${servlet-api.build}"/> |
| <delete dir="${servlet-api.dist}"/> |
| |
| </target> |
| |
| |
| <!-- ========================= All In One Build ======================= --> |
| <target name="all" depends="clean,dist" |
| description="Clean, compile, and dist"/> |
| |
| |
| </project> |