blob: 0a38770a768a52fd09a1b9b97f53a8cf834553c8 [file] [log] [blame]
<?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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
<!-- ANT Build Script for the "bsf" Custom Tag Library -->
<project name="bsf" default="main" basedir=".">
<!-- ******************** Adjustable Properties *********************** -->
The following property values should be examined and customized
for each custom tag library subproject.
ant.home Home directory for the ANT build tool
This is normally defaulted from the
ANT_HOME environment variable in the
build script.
servlet.jar Pathname of the servlet API classes
you are using to compile, such as the
one that comes with Tomcat. This is
normally defaulted from the SERVLET_JAR
environment variable in the build script. Base name of this tag library subproject.
<property name="" value="bsf"/>
<property name="ant.home" value="../../jakarta-ant"/>
<property name="servlet.jar" value="../../jakarta-servletapi/lib/servlet.jar"/>
<!-- ****************** Project Standard Properties ******************* -->
The following property values reflect the standard directory
organization for the jakarta-taglibs project, and should not
be changed or overridden.
build.dir Base directory for build targets
dist.dir Base directory for distribution targets
taglibs.xsl Taglibs stylesheet
<property name="build.dir" value="../build"/>
<property name="dist.dir" value="../dist"/>
<property name="taglibs.xsl" value="src/doc/stylesheets/taglibs.xsl"/>
<!-- *********************** Default Properties ********************** -->
The following property values reflect the recommended directory
structure for each custom tag library subproject. You should only
need to adjust or override them if you use a different organization.
conf.src Library configuration source directory
doc.src Documentation app source directory
examples.src Examples app source directory
library.src Library Java source directory
<property name="conf.src" value="conf"/>
<property name="doc.src" value="doc"/>
<property name="examples.src" value="examples"/>
<property name="library.src" value="src"/>
<property name="lib.src" value="lib"/>
<!-- ********************* Derived Properties ************************* -->
These property values are derived from the previously defined values,
and should not normally be overridden from the command line.
build.doc Target directory for documentation app
build.examples Target directory for examples app
build.library Target directory for tag library
dist.doc Destination WAR for documentation app
dist.examples Destination WAR for examples app
dist.library Destination JAR for tag library
dist.tld Destination TLD file for tag library
<property name="build.doc" value="${build.dir}/${}-doc"/>
<property name="build.examples" value="${build.dir}/${}-examples"/>
<property name="build.library" value="${build.dir}/classes"/>
<property name="dist.doc" value="${dist.dir}/${}-doc.war"/>
<property name="dist.examples" value="${dist.dir}/${}-examples.war"/>
<property name="dist.library" value="${dist.dir}/${lib.src}/${}.jar"/>
<property name="dist.tld" value="${dist.dir}/${}.tld"/>
<property name="taglibs.doc" value="${dist.dir}/${}-doc"/>
<!-- ********************** Destination Preparation ********************* -->
<target name="prepare">
<!-- Set up build directories -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.doc}"/>
<mkdir dir="${build.doc}/WEB-INF"/>
<mkdir dir="${build.doc}/WEB-INF/classes"/>
<mkdir dir="${build.doc}/WEB-INF/lib"/>
<mkdir dir="${build.examples}"/>
<mkdir dir="${build.examples}/WEB-INF"/>
<mkdir dir="${build.examples}/WEB-INF/classes"/>
<mkdir dir="${build.examples}/WEB-INF/lib"/>
<mkdir dir="${build.library}"/>
<mkdir dir="${build.library}/META-INF"/>
<!-- Set up distribution directory -->
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/${}"/>
<!-- **************** Compile Tag Library Components ******************** -->
<!-- Compile the documentation application -->
<target name="documentation" depends="prepare">
<copy todir="${build.doc}/WEB-INF">
<fileset dir="${doc.src}/conf"/>
<!-- intro.xml isn't part of the documentation application,
this is just a handy place to build it for the web site. -->
<style in="xml/intro.xml"
<param name="prefix" expression="../../"/>
<copy todir="${build.doc}">
<fileset dir="${doc.src}/web">
<include name="**/*.html"/>
<!-- Compile the examples application -->
<target name="examples" depends="library-dist">
<copy todir="${build.examples}/WEB-INF">
<fileset dir="${examples.src}/conf"/>
<copy todir="${build.examples}">
<fileset dir="${examples.src}/web"/>
<copy file="${dist.tld}"
<copy file="${dist.library}"
<!-- Compile the tag library itself -->
<target name="compile" depends="prepare">
<copy file="${conf.src}/taglib.tld"
<javac srcdir="${library.src}" destdir="${build.library}" debug="on">
<pathelement location="${servlet.jar}"/>
<pathelement location="${taglib.extraclasspath}"/>
<!-- Compile the library as well as the associated applications -->
<target name="main" depends="compile,documentation,examples"/>
<!-- ******************* Create Distribution Files ********************** -->
<!-- Create the documentation application WAR file -->
<target name="documentation-dist" depends="documentation">
<jar jarfile="${dist.doc}" basedir="${build.doc}" excludes="intro.html"/>
<mkdir dir="${taglibs.doc}"/>
<copy todir="${taglibs.doc}">
<fileset dir="${build.doc}">
<exclude name="WEB-INF"/>
<!-- Create the examples application WAR file -->
<target name="examples-dist" depends="examples">
<jar jarfile="${dist.examples}" basedir="${build.examples}"/>
<!-- Create the library distribution files -->
<target name="library-dist" depends="compile">
<jar jarfile="${dist.library}" basedir="${build.library}"/>
<copy file="${conf.src}/taglib.tld" tofile="${dist.tld}"/>
<!-- Create the entire set of distribution files -->
<target name="dist" depends="library-dist,examples-dist,documentation-dist"/>
<!-- ************************ Utility Commands ************************** -->
<!-- Delete output directories and files so we can build from scratch -->
<target name="clean">
<delete dir="${build.dir}/${}"/>
<delete dir="${dist.dir}/${}"/>