| <?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="Tester" default="build-main" basedir="."> |
| |
| |
| <!-- ===================== Initialize Property Values =================== --> |
| |
| <property file="build.properties"/> |
| <property file="../build.properties"/> |
| <property file="${user.home}/build.properties"/> |
| |
| <property name="build.compiler" value="modern"/> |
| <property name="api.home" value="../../jakarta-servletapi-5/dist"/> |
| <property name="tester.build" value="${basedir}/build"/> |
| <property name="tester.deploy" value="${basedir}/../build"/> |
| <property name="tester.dist" value="${basedir}/dist"/> |
| |
| <!-- ================== Derived Property Values ========================= --> |
| <property name="ant.jar" value="${ant.home}/lib/ant.jar"/> |
| <property name="servlet-api.jar" value="${api.home}/jsr154/dist/lib/servlet-api.jar"/> |
| |
| <!-- =================== BUILD: Create Directories ====================== --> |
| <target name="build-prepare"> |
| <mkdir dir="${tester.build}"/> |
| <mkdir dir="${tester.build}/bin"/> |
| <mkdir dir="${tester.build}/classes"/> |
| <mkdir dir="${tester.build}/conf"/> |
| <mkdir dir="${tester.build}/lib"/> |
| </target> |
| |
| |
| <!-- =================== BUILD: Copy Static Files ======================= --> |
| <target name="build-static" depends="build-prepare"> |
| |
| <!-- Executable Commands --> |
| <mkdir dir="${tester.build}/bin"/> |
| <copy todir="${tester.build}/bin"> |
| <fileset dir="src/bin" /> |
| </copy> |
| <fixcrlf srcdir="${tester.build}/bin" includes="*.sh" eol="lf" |
| encoding="ISO-8859-1" fixlast="false" /> |
| <fixcrlf srcdir="${tester.build}/bin" includes="*.bat" eol="crlf" |
| encoding="ISO-8859-1" fixlast="false" /> |
| <chmod perm="+x" file="${tester.build}/bin/tester.sh"/> |
| <copy todir="${tester.build}/conf"> |
| <fileset dir="src/conf" /> |
| </copy> |
| |
| <!-- Compiled Classes --> |
| <mkdir dir="${tester.build}/classes"/> |
| |
| <!-- Web Application --> |
| <mkdir dir="${tester.build}/web"/> |
| <copy todir="${tester.build}/web"> |
| <fileset dir="web"/> |
| </copy> |
| <mkdir dir="${tester.build}/web/WEB-INF/classes"/> |
| |
| </target> |
| |
| |
| <!-- ================= BUILD: Compile Server Components ================= --> |
| <target name="build-main" depends="build-static"> |
| |
| <!-- Compile tester components and tools --> |
| <javac srcdir="src/tester" destdir="${tester.build}/classes" |
| classpath="${ant.jar}:${servlet-api.jar}:${xercesImpl.jar}" |
| deprecation="${compile.deprecation}" |
| debug="${compile.debug}" optimize="off" |
| excludes="**/CVS/**" |
| encoding="ISO-8859-1"/> |
| |
| <!-- Copy static resource files --> |
| <copy todir="${tester.build}/classes"> |
| <fileset dir="src/tester"> |
| <include name="**/*.properties"/> |
| </fileset> |
| <fileset dir="src/tester"> |
| <include name="**/*.txt"/> |
| </fileset> |
| </copy> |
| <copy file="${tester.build}/classes/org/apache/tester/unshared/UnsharedSessionBean.class" |
| tofile="${tester.build}/web/WEB-INF/classes/org/apache/tester/unshared/UnsharedSessionBean.class"/> |
| <copy file="src/tester/org/apache/tester/Resources01.txt" |
| tofile="${tester.build}/web/WEB-INF/classes/org/apache/tester/Unpacked01.txt"/> |
| <copy file="src/tester/org/apache/tester/Resources01.txt" |
| tofile="${tester.build}/classes/org/apache/tester/shared/Shared01.txt"/> |
| <copy file="src/tester/org/apache/tester/Resources01.txt" |
| tofile="${tester.build}/classes/org/apache/tester/unpshared/UnpShared01.txt"/> |
| <copy file="src/tester/org/apache/tester/Resources03.txt" |
| tofile="${tester.build}/web/WEB-INF/classes/org/apache/tester/Unpacked03.txt"/> |
| <copy file="src/tester/org/apache/tester/Resources03.txt" |
| tofile="${tester.build}/classes/org/apache/tester/shared/Shared03.txt"/> |
| <copy file="src/tester/org/apache/tester/Resources03.txt" |
| tofile="${tester.build}/classes/org/apache/tester/unpshared/UnpShared03.txt"/> |
| <copy file="src/tester/org/apache/tester/Resources05.txt" |
| tofile="${tester.build}/web/WEB-INF/classes/org/apache/tester/Unpacked05.txt"/> |
| |
| <!-- Install Xerces --> |
| <copy todir="${tester.build}/web/WEB-INF/lib" file="${xercesImpl.jar}"/> |
| <copy todir="${tester.build}/web/WEB-INF/lib" file="${xml-apis.jar}"/> |
| |
| <!-- Create and install tester library --> |
| <mkdir dir="${tester.build}/web/WEB-INF/lib"/> |
| <jar jarfile="${tester.build}/web/WEB-INF/lib/tester.jar"> |
| <fileset dir="${tester.build}/classes"> |
| <exclude name="**/shared/*"/> |
| <exclude name="**/unshared/*"/> |
| </fileset> |
| </jar> |
| |
| </target> |
| |
| |
| <!-- ================ BUILD: Create Tester Javadocs ===================== --> |
| <target name="javadoc" depends="build-main"> |
| <delete dir="${tester.build}/javadoc"/> |
| <mkdir dir="${tester.build}/javadoc"/> |
| <javadoc packagenames="org.apache.tester.*" |
| classpath="${ant.jar}:${tester.build}/classes" |
| sourcepath="src/tester" |
| destdir="${tester.build}/javadoc" |
| author="true" |
| version="true" |
| windowtitle="Tester Internal API Documentation" |
| doctitle="Tester Tools and Tests API" |
| bottom="Copyright &#169; 2000-2011 Apache Software Foundation. All Rights Reserved." |
| /> |
| </target> |
| |
| |
| <!-- ======================= BUILD: Clean Directory ===================== --> |
| <target name="build-clean"> |
| <delete dir="${tester.build}"/> |
| </target> |
| |
| |
| <!-- ==================== BUILD: Rebuild Everything ===================== --> |
| <target name="all" depends="build-clean,build-main"/> |
| |
| |
| <!-- ====================== DEPLOY: Create Directories ================== --> |
| <target name="deploy-prepare"> |
| <mkdir dir="${tester.deploy}"/> |
| <mkdir dir="${tester.deploy}/bin"/> |
| <mkdir dir="${tester.deploy}/conf"/> |
| </target> |
| |
| |
| <!-- ====================== DEPLOY: Copy Static Files =================== --> |
| <target name="deploy-static" depends="build-main,deploy-prepare"> |
| |
| <!-- Executable Commands --> |
| <copy todir="${tester.deploy}/bin"> |
| <fileset dir="${tester.build}/bin" /> |
| </copy> |
| <fixcrlf srcdir="${tester.deploy}/bin" includes="*.sh" eol="lf" |
| encoding="ISO-8859-1" fixlast="false" /> |
| <fixcrlf srcdir="${tester.deploy}/bin" includes="*.bat" eol="crlf" |
| encoding="ISO-8859-1" fixlast="false" /> |
| <chmod perm="+x" file="${tester.deploy}/bin/tester.sh"/> |
| <copy todir="${tester.deploy}/conf" overwrite="true"> |
| <fileset dir="${tester.build}/conf" /> |
| </copy> |
| |
| <!-- Unpacked Shared Classes --> |
| <mkdir dir="${tester.deploy}/shared/classes"/> |
| <copy todir="${tester.deploy}/shared/classes"> |
| <fileset dir="${tester.build}/classes"> |
| <include name="**/unpshared/*"/> |
| </fileset> |
| </copy> |
| |
| <!-- Shared Library --> |
| <mkdir dir="${tester.deploy}/shared/lib"/> |
| <jar jarfile="${tester.deploy}/shared/lib/tester-shared.jar"> |
| <fileset dir="${tester.build}/classes"> |
| <include name="**/shared/*"/> |
| </fileset> |
| </jar> |
| |
| <!-- Web Application --> |
| <mkdir dir="${tester.deploy}/webapps/tester"/> |
| <copy todir="${tester.deploy}/webapps/tester"> |
| <fileset dir="${tester.build}/web"/> |
| </copy> |
| |
| </target> |
| |
| |
| <!-- ====================== DEPLOY: Create Tester JAR =================== --> |
| <target name="deploy-main" depends="deploy-static"/> |
| |
| |
| <!-- ====================== DEPLOY: Deploy Tester Build ================= --> |
| <target name="deploy" depends="deploy-main"/> |
| |
| |
| <!-- ====================== DEPLOY: Clean Directories =================== --> |
| <target name="deploy-clean"> |
| <delete dir="${tester.deploy}/webapps/tester"/> |
| </target> |
| |
| |
| <!-- ================ DIST: Create Distribution ========================= --> |
| <target name="dist" depends="build-main"> |
| |
| <mkdir dir="${tester.dist}/bin"/> |
| <copy todir="${tester.dist}/bin"> |
| <fileset dir="${tester.build}/bin" /> |
| </copy> |
| <fixcrlf srcdir="${tester.dist}/bin" includes="*.sh" eol="lf" |
| encoding="ISO-8859-1" fixlast="false" /> |
| <fixcrlf srcdir="${tester.dist}/bin" includes="*.bat" eol="crlf" |
| encoding="ISO-8859-1" fixlast="false" /> |
| <chmod perm="+x" file="${tester.dist}/bin/tester.sh"/> |
| |
| <mkdir dir="${tester.dist}/webapps"/> |
| <jar jarfile="${tester.dist}/webapps/tester.war" |
| basedir="${tester.build}/web"/> |
| |
| </target> |
| |
| |
| <!-- ======================== DIST: Clean Directory ===================== --> |
| <target name="dist-clean"> |
| <delete dir="${tester.dist}"/> |
| </target> |
| |
| |
| <!-- ====================== Convenient Synonyms ========================= --> |
| <target name="clean" depends="build-clean, dist-clean"/> |
| |
| |
| </project> |