| <?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="JSP 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="jsp-api.build" value="build"/> |
| <property name="jsp-api.dist" value="dist"/> |
| <property name="servlet-api.jar" value="../jsr154/dist/lib/servlet-api.jar"/> |
| <property name="jsp-api.jar" value="${jsp-api.dist}/lib/jsp-api.jar"/> |
| <property name="jsp-anttask.jar" value="${jsp-api.build}/jsp-anttask.jar" /> |
| |
| <path id="examples.classpath"> |
| <pathelement location="${jsp-api.build}/classes"/> |
| <pathelement location="${servlet-api.jar}"/> |
| <pathelement location="${mail.jar}"/> |
| </path> |
| |
| |
| <!-- ===================== Prepare Directories ========================= --> |
| <target name="prepare"> |
| |
| <!-- "Build" Hierarchy --> |
| <mkdir dir="${jsp-api.build}"/> |
| <mkdir dir="${jsp-api.build}/classes"/> |
| <mkdir dir="${jsp-api.build}/docs"/> |
| <mkdir dir="${jsp-api.build}/docs/api"/> |
| <mkdir dir="${jsp-api.build}/examples"/> |
| <mkdir dir="${jsp-api.build}/ant"/> |
| |
| <!-- "Dist" Hierarchy --> |
| <mkdir dir="${jsp-api.dist}"/> |
| <mkdir dir="${jsp-api.dist}/docs"/> |
| <mkdir dir="${jsp-api.dist}/docs/api"/> |
| <mkdir dir="${jsp-api.dist}/lib"/> |
| <mkdir dir="${jsp-api.dist}/src"/> |
| <mkdir dir="${jsp-api.dist}/examples"/> |
| |
| <uptodate property="docs.uptodate" targetfile="${jsp-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="${jsp-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="${jsp-api.build}/classes" |
| debug="${compile.debug}" deprecation="${compile.deprecation}" |
| optimize="${compile.optimize}" |
| classpath="${servlet-api.jar}" |
| encoding="ISO-8859-1"/> |
| |
| <!-- Associated property files --> |
| <copy todir="${jsp-api.build}/classes"> |
| <fileset dir="src/share"> |
| <include name="**/*.properties"/> |
| </fileset> |
| </copy> |
| |
| <!-- JSP resources --> |
| <copy todir="${jsp-api.build}/classes/javax/servlet/jsp/resources"> |
| <fileset dir="src/share/dtd"> |
| <include name="jsp*.dtd"/> |
| <include name="jsp*.xsd"/> |
| <include name="web-jsp*.dtd"/> |
| <include name="web-jsp*.xsd"/> |
| </fileset> |
| </copy> |
| |
| </target> |
| |
| |
| <!-- ======================== Build JavaDoc =========================== --> |
| <target name="javadoc" depends="prepare" unless="docs.uptodate"> |
| |
| <javadoc packagenames="javax.servlet.jsp.*" |
| sourcepath="${basedir}/src/share" |
| classpath="${servlet-api.jar}" |
| destdir="${jsp-api.build}/docs/api" |
| use="true" |
| windowtitle="JavaServer Pages API Documentation" |
| doctitle="JavaServer Pages API Documentation" |
| bottom="Copyright &copy; 1999-2012 The Apache Software Foundation. All Rights Reserved."/> |
| |
| </target> |
| |
| |
| <!-- ======================== Build Examples =========================== --> |
| <target name="ant" depends="prepare"> |
| <javac srcdir="src/ant" destdir="${jsp-api.build}/ant" |
| debug="${compile.debug}" deprecation="${compile.deprecation}" |
| optimize="${compile.optimize}" |
| classpath="${ant.home}/lib/ant.jar" |
| encoding="ISO-8859-1"/> |
| <jar jarfile="${jsp-anttask.jar}" basedir="${jsp-api.build}/ant" /> |
| <taskdef name="txt2html" classname="task.Txt2Html" |
| classpath="${jsp-anttask.jar}" /> |
| </target> |
| |
| <target name="examples" depends="prepare,ant"> |
| |
| <copy todir="${jsp-api.build}/examples"> |
| <fileset dir="examples"> |
| <exclude name="build.*"/> |
| </fileset> |
| </copy> |
| |
| <txt2html todir="${jsp-api.build}/examples/jsp2/simpletag"> |
| <fileset dir="examples/WEB-INF/classes/jsp2/examples"> |
| <include name="BookBean.java"/> |
| </fileset> |
| <fileset dir="examples/WEB-INF/classes/jsp2/examples/simpletag"> |
| <include name="FindBookSimpleTag.java"/> |
| <include name="RepeatSimpleTag.java"/> |
| <include name="HelloWorldSimpleTag.java"/> |
| </fileset> |
| <fileset dir="examples/WEB-INF/classes/jsp2/examples/el"> |
| <include name="Functions.java"/> |
| </fileset> |
| </txt2html> |
| |
| <txt2html todir="${jsp-api.build}/examples/jsp2/jspattribute"> |
| <fileset dir="examples/WEB-INF/classes/jsp2/examples"> |
| <include name="FooBean.java"/> |
| </fileset> |
| <fileset dir="examples/WEB-INF/classes/jsp2/examples/simpletag"> |
| <include name="ShuffleSimpleTag.java"/> |
| <include name="TileSimpleTag.java"/> |
| <include name="HelloWorldSimpleTag.java"/> |
| </fileset> |
| </txt2html> |
| |
| <txt2html todir="${jsp-api.build}/examples/cal"> |
| <fileset dir="examples/WEB-INF/classes/cal"> |
| <include name="Entries.java"/> |
| <include name="Entry.java"/> |
| <include name="JspCalendar.java"/> |
| <include name="TableBean.java"/> |
| </fileset> |
| </txt2html> |
| |
| <txt2html todir="${jsp-api.build}/examples/jsptoserv"> |
| <fileset dir="examples/WEB-INF/classes"> |
| <include name="servletToJsp.java"/> |
| </fileset> |
| </txt2html> |
| |
| <txt2html todir="${jsp-api.build}/examples/jsp2/el"> |
| <fileset dir="examples/WEB-INF/classes/jsp2/examples/el"> |
| <include name="Functions.java"/> |
| </fileset> |
| </txt2html> |
| |
| <txt2html todir="${jsp-api.build}/examples/jsp2/misc"> |
| <fileset dir="examples/WEB-INF/classes/jsp2/examples/simpletag"> |
| <include name="EchoAttributesTag.java"/> |
| </fileset> |
| </txt2html> |
| |
| <txt2html todir="${jsp-api.build}/examples/jsp2/tagfiles"> |
| <fileset dir="examples/WEB-INF/tags"> |
| <include name="**/*.tag" /> |
| </fileset> |
| </txt2html> |
| |
| <txt2html todir="${jsp-api.build}/examples"> |
| <fileset dir="examples"> |
| <include name="**/*.jsp" /> |
| <include name="**/*.jspx" /> |
| <include name="**/*.jspf" /> |
| <exclude name="error/errorpge.jsp"/> |
| <exclude name="forward/one.jsp"/> |
| <exclude name="include/foo.jsp"/> |
| <exclude name="jsptoserv/hello.jsp"/> |
| <exclude name="security/protected/error.jsp"/> |
| <exclude name="security/protected/index.jsp"/> |
| <exclude name="security/protected/login.jsp"/> |
| <exclude name="source.jsp"/> |
| </fileset> |
| </txt2html> |
| |
| <javac srcdir="examples/WEB-INF/classes" |
| destdir="${jsp-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> |
| |
| <javac srcdir="examples/plugin/applet" |
| destdir="${jsp-api.build}/examples/plugin/applet" |
| debug="${compile.debug}" deprecation="${compile.deprecation}" |
| optimize="${compile.optimize}" |
| excludes="**/CVS/**" |
| encoding="ISO-8859-1"> |
| <classpath refid="examples.classpath" /> |
| </javac> |
| |
| <jar jarfile="${jsp-api.dist}/examples/examples.war" |
| basedir="${jsp-api.build}/examples" includes="**"/> |
| |
| </target> |
| |
| |
| <!-- ===================== Distribution Files ========================= --> |
| <target name="jar" depends="compile" |
| description="Create jar"> |
| |
| <!-- Prepare Manifest --> |
| <copy tofile="${jsp-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="${jsp-api.jar}" |
| basedir="${jsp-api.build}/classes" |
| manifest="${jsp-api.build}/manifest"> |
| <include name="javax/servlet/jsp/**" /> |
| </jar> |
| |
| </target> |
| |
| <target name="dist" depends="compile,examples,javadoc,jar" |
| description="Create binary distribution"> |
| |
| <!-- Copy Javadocs --> |
| <copy todir="${jsp-api.dist}/docs/api"> |
| <fileset dir="${jsp-api.build}/docs/api"/> |
| </copy> |
| |
| <!-- Copy API source files --> |
| <copy todir="${jsp-api.dist}/src"> |
| <fileset dir="src/share"/> |
| </copy> |
| |
| </target> |
| |
| |
| <!-- ====================== Clean Generated Files ===================== --> |
| <target name="clean" |
| description="Clean previous build results"> |
| |
| <delete dir="${jsp-api.build}"/> |
| <delete dir="${jsp-api.dist}"/> |
| |
| </target> |
| |
| |
| <!-- ========================= All In One Build ======================= --> |
| <target name="all" depends="clean,dist" |
| description="Clean, compile, and dist"/> |
| |
| |
| </project> |