blob: eeb18551e9951b014b67022356d080abeb6c6b39 [file] [log] [blame]
<?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="Jasper2" default="deploy" basedir=".">
<!-- ===================== Initialize Property Values =================== -->
<!-- See "build.properties.sample" in the top level directory for all -->
<!-- property values you must customize for successful building!!! -->
<property file="${user.home}/build.properties"/>
<property file="build.properties"/>
<property file="build.properties.sample"/>
<property file="${catalina.home}/build.properties"/>
<!-- Build Defaults -->
<property name="jasper.build" value="${basedir}/build"/>
<property name="catalina.home" value="../../jakarta-tomcat-4.1/build"/>
<property name="jasper.deploy" value="${catalina.home}"/>
<property name="jasper.dist" value="${basedir}/dist"/>
<property name="test.failonerror" value="true"/>
<property name="test.runner" value="junit.textui.TestRunner"/>
<property name="tools.jar" value="${java.home}/lib/tools.jar"/>
<property name="ant.jar" value="${ant.home}/lib/ant.jar"/>
<property name="servlet-api.jar" value="${api.home}/jsr154/dist/lib/servlet-api.jar"/>
<property name="jsp-api.jar" value="${api.home}/jsr152/dist/lib/jsp-api.jar"/>
<!-- Construct Jasper classpath -->
<path id="jasper.classpath">
<pathelement location="${ant.jar}"/>
<pathelement location="${servlet-api.jar}"/>
<pathelement location="${jsp-api.jar}"/>
<pathelement location="${tools.jar}"/>
<pathelement location="${jdt.jar}"/>
<pathelement location="${xerces.jar}"/>
<pathelement location="${xercesImpl.jar}"/>
<pathelement location="${xml-apis.jar}"/>
<pathelement location="${commons-el.jar}"/>
<pathelement location="${commons-collections.jar}"/>
<pathelement location="${commons-logging.jar}"/>
<pathelement location="${commons-daemon-launcher.jar}"/>
<pathelement location="${jasper.build}/shared/classes"/>
</path>
<!-- Construct unit tests classpath -->
<path id="test.classpath">
<pathelement location="${ant.jar}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${servlet-api.jar}"/>
<pathelement location="${jsp-api.jar}"/>
<pathelement location="${tools.jar}"/>
<pathelement location="${xerces.jar}"/>
<pathelement location="${xercesImpl.jar}"/>
<pathelement location="${xml-apis.jar}"/>
<pathelement location="${commons-collections.jar}"/>
<pathelement location="${commons-launcher.jar}"/>
<pathelement location="${jasper.build}/shared/classes"/>
<pathelement location="${jasper.build}/tests"/>
</path>
<!-- =================== BUILD: Create Directories ====================== -->
<target name="build-prepare">
<available classname="junit.framework.TestCase" property="junit.present" />
<available property="launcher.present"
classname="org.apache.commons.launcher.Launcher"
classpath="${commons-daemon-launcher.jar}"/>
<available property="launcher.bootstrap.present"
file="${commons-daemon-launcher-bootstrap.class}"/>
<condition property="copy.launcher.jars">
<and>
<equals arg1="${launcher.present}" arg2="true" />
<equals arg1="${launcher.bootstrap.present}" arg2="true" />
</and>
</condition>
<mkdir dir="${jasper.build}"/>
<mkdir dir="${jasper.build}/bin"/>
<mkdir dir="${jasper.build}/common/classes"/>
<mkdir dir="${jasper.build}/common/lib"/>
<mkdir dir="${jasper.build}/shared/classes"/>
<mkdir dir="${jasper.build}/shared/lib"/>
</target>
<!-- =================== BUILD: Copy Launcher Files ===================== -->
<target name="copy-launcher.jars" if="copy.launcher.jars">
<!-- <copy todir="${jasper.build}/common/lib" file="${ant.jar}"/> -->
<copy todir="${jasper.build}/bin" file="${commons-daemon-launcher.jar}"/>
<copy todir="${jasper.build}/bin" file="${commons-daemon-launcher-bootstrap.class}"/>
<copy todir="${jasper.build}/bin">
<fileset dir="src/bin" includes="*-using-launcher.*,launcher.properties,jasper.xml" />
</copy>
</target>
<!-- =================== BUILD: Copy Static Files ======================= -->
<target name="build-static" depends="build-prepare,copy-launcher.jars">
<!-- Executable Commands -->
<copy todir="${jasper.build}/bin">
<fileset dir="src/bin" excludes="*-using-launcher.*,launcher.properties,jasper.xml" />
</copy>
<fixcrlf srcdir="${jasper.build}/bin" includes="*.sh" eol="lf"
encoding="ISO-8859-1" fixlast="false" />
<fixcrlf srcdir="${jasper.build}/bin" includes="*.bat" eol="crlf"
encoding="ISO-8859-1" fixlast="false" />
<chmod perm="+x" dir="${jasper.build}/bin" includes="*.sh"/>
</target>
<!-- ================= BUILD: Compile Server Components ================= -->
<target name="build-main" depends="build-static,build-only">
<!-- Extra operations: Supporting JAR Files -->
<copy todir="${jasper.build}/shared/lib" file="${commons-el.jar}"/>
</target>
<!-- Just build jasper -->
<target name="build-only">
<property name="jasper.classes" value="${jasper.build}/shared/classes"/>
<property name="jasper-compiler.jar" value="${jasper.build}/shared/lib/jasper-compiler.jar"/>
<property name="jasper-runtime.jar" value="${jasper.build}/shared/lib/jasper-runtime.jar"/>
<!-- Compile internal server components -->
<javac srcdir="src/share" destdir="${jasper.classes}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
source="${compile.source}"
optimize="${compile.optimize}"
excludes="**/CVS/**"
encoding="ISO-8859-1">
<classpath refid="jasper.classpath" />
</javac>
<!-- Copy static resource files -->
<copy todir="${jasper.classes}">
<fileset dir="src/share">
<include name="**/*.properties"/>
<include name="**/*.dtd"/>
</fileset>
</copy>
<!-- Jasper Compiler JAR File -->
<jar jarfile="${jasper-compiler.jar}">
<fileset dir="${jasper.classes}">
<include name="org/apache/jasper/compiler/**" />
<include name="org/apache/jasper/xmlparser/**" />
<include name="org/apache/jasper/servlet/**" />
<include name="org/apache/jasper/tagplugins/**" />
<exclude name="org/apache/jasper/Constants.class" />
<exclude name="org/apache/jasper/JasperException.class" />
<include name="org/apache/jasper/*.class" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
</jar>
<!-- Jasper Runtime JAR File -->
<jar jarfile="${jasper-runtime.jar}">
<fileset dir="${jasper.classes}">
<include name="org/apache/jasper/Constants.class" />
<include name="org/apache/jasper/JasperException.class" />
<include name="org/apache/jasper/compiler/Localizer.class" />
<include name="org/apache/jasper/resources/**" />
<include name="org/apache/jasper/runtime/**" />
<include name="org/apache/jasper/security/**" />
<include name="org/apache/jasper/util/**" />
<!-- Javadoc and i18n exclusions -->
<exclude name="**/package.html" />
<exclude name="**/LocalStrings_*" />
</fileset>
</jar>
</target>
<!-- ================ BUILD: Create Jasper Javadocs ===================== -->
<target name="javadoc">
<delete dir="${jasper.build}/javadoc"/>
<mkdir dir="${jasper.build}/javadoc"/>
<javadoc packagenames="org.apache.jasper.*"
classpathref="jasper.classpath"
sourcepath="src/share"
destdir="${jasper.build}/javadoc"
author="true"
version="true"
windowtitle="Jasper Internal API Documentation"
doctitle="Jasper API"
bottom="Copyright &amp;#169; 2000-2011 Apache Software Foundation. All Rights Reserved."
additionalparam="-breakiterator"
/>
</target>
<!-- ======================= BUILD: Clean Directory ===================== -->
<target name="build-clean">
<delete dir="${jasper.build}"/>
</target>
<!-- ==================== BUILD: Rebuild Everything ===================== -->
<target name="all" depends="build-clean,build-main"
description="Clean, build, and deploy Jasper component"/>
<!-- =============== BUILD: Compile Unit Tests ========================== -->
<target name="build-tests" depends="build-main" if="junit.present">
<mkdir dir="${jasper.build}/tests"/>
<!-- Compile unit test classes -->
<!--
<javac srcdir="src/test" destdir="${jasper.build}/tests"
deprecation="${compile.deprecation}"
debug="${compile.debug}"
source="${compile.source}"
optimize="off"
excludes="**/CVS/**"
encoding="ISO-8859-1">
<classpath refid="test.classpath"/>
</javac>
-->
</target>
<!-- ==================== BUILD: Execute Unit Tests ===================== -->
<target name="test" if="junit.present"
description="Run all unit test cases"
depends="build-tests">
</target>
<!-- ====================== DEPLOY: Create Directories ================== -->
<target name="deploy-prepare">
<mkdir dir="${jasper.deploy}"/>
<mkdir dir="${jasper.deploy}/bin"/>
<mkdir dir="${jasper.deploy}/common/lib"/>
</target>
<!-- ====================== DEPLOY: Copy Static Files =================== -->
<target name="deploy-static" depends="build-main,deploy-prepare">
<!-- Executable Commands -->
<copy todir="${jasper.deploy}/bin">
<fileset dir="${jasper.build}/bin" />
</copy>
<fixcrlf srcdir="${jasper.deploy}/bin" includes="*.sh" eol="lf"
encoding="ISO-8859-1" fixlast="false" />
<fixcrlf srcdir="${jasper.deploy}/bin" includes="*.bat" eol="crlf"
encoding="ISO-8859-1" fixlast="false" />
<chmod perm="+x" file="${jasper.deploy}/bin/jspc.sh"/>
</target>
<!-- ====================== DEPLOY: Create Jasper JARs ================== -->
<target name="deploy" depends="deploy-static,build-main"
description="Build and deploy Jasper component">
<echo message="Deploy to ${jasper.deploy}/common/lib" />
<!-- Jasper Compiler JAR File -->
<copy file="${jasper.build}/shared/lib/jasper-compiler.jar"
tofile="${jasper.deploy}/common/lib/jasper-compiler.jar" />
<copy file="${jasper.build}/shared/lib/jasper-runtime.jar"
tofile="${jasper.deploy}/common/lib/jasper-runtime.jar" />
<!-- Copy JARs -->
<copy todir="${jasper.deploy}/common/lib" file="${jdt.jar}"/>
<copy todir="${jasper.deploy}/common/lib" file="${jsp-api.jar}"/>
<copy todir="${jasper.deploy}/common/lib" file="${commons-el.jar}"/>
</target>
<!-- ================ DIST: Create Distribution ========================= -->
<target name="dist" depends="build-main"
description="Create binary distribution">
<!-- Executable commands -->
<mkdir dir="${jasper.dist}/bin"/>
<copy todir="${jasper.dist}/bin">
<fileset dir="${jasper.build}/bin" />
</copy>
<fixcrlf srcdir="${jasper.dist}/bin" includes="*.sh" eol="lf"
encoding="ISO-8859-1" fixlast="false" />
<fixcrlf srcdir="${jasper.dist}/bin" includes="*.bat" eol="crlf"
encoding="ISO-8859-1" fixlast="false" />
<chmod perm="+x" file="${jasper.dist}/bin/jspc.sh"/>
<!-- Jasper Compiler and Runtime JAR Files -->
<mkdir dir="${jasper.dist}/shared/lib"/>
<copy todir="${jasper.dist}/shared/lib">
<fileset dir="${jasper.build}/shared/lib"/>
</copy>
</target>
<!-- ======================== DIST: Clean Directory ===================== -->
<target name="dist-clean">
<delete dir="${jasper.dist}"/>
</target>
<!-- ====================== Convenient Synonyms ========================= -->
<target name="clean" depends="build-clean, dist-clean"
description="Clean build and dist directories"/>
</project>