blob: 2fea253993d07bbf8d2560b80d222dbe92e07f31 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!-- ===================================================================
Build file for Xalan-J 2.x - for use with the Jakarta Ant java build tool
Setup instructions:
Before running an Ant build, you must
- set the JAVA_HOME environment variable to the JDK root directory
- To build 'servlet' sample: Include Servlet SDK in your classpath
- To build docs/javadocs/xsltc: use JDK 1.2.x or higher
- (if shipping a public distribution) have checked out xml-commons
as a sister directory to xml-xalan
Build Instructions:
To build, run
build.bat (win32) or build.sh (unix) [antoptions] [targets]
in the directory where this file is located.
build -projecthelp will show a list of supported targets.
Developers: include a description="" attribute in all user-callable targets.
If you build a target that depends on other targets, those other
targets are *usually* created in the correct order; however a
few of the larger targets like dist do not list all dependencies.
Other Important Notes:
- 'dist' produces a .tar file that works with GNU compatible tar
programs, because that's what Ant does when it finds a path that's
longer than 100 characters (like in our docs). Sorry!
- External build maintainers: look for GUMP: comments; developers
please use great caution when changing these lines!
- Unusual build items: the docs and xsltc.compile targets leave
cruft in the source areas; various clean targets get most of this.
Authors:
Shane Curcuru <shane_curcuru@lotus.com>
Don Leslie <donald_leslie@lotus.com>
Copyright:
Copyright (c) 1999-2001 The Apache Software Foundation.
$Id$
==================================================================== -->
<project name="Xalan" default="jar" basedir=".">
<!-- =================================================================== -->
<!-- Defines paths/names of prerequisite jar files we compile against -->
<!-- =================================================================== -->
<!-- We keep checked-in known-good .jars here -->
<property name="bin.dir" value="./bin"/>
<!-- GUMP: Allows external build systems to replace .jars Xalan
is dependent on as needed. Most have separate name and
location properties to make it simpler to reset these values;
please provide feedback if this is useful.
-->
<property name="parser.jar.name" value="xerces.jar"/>
<property name="parser.jar" value="${bin.dir}/${parser.jar.name}"/>
<property name="bsf.jar.name" value="bsf.jar"/>
<property name="bsf.jar" value="${bin.dir}/${bsf.jar.name}"/>
<property name="stylebook.jar.name" value="stylebook-1.0-b3_xalan-2.jar"/>
<property name="stylebook.jar" value="${bin.dir}/${stylebook.jar.name}"/>
<property name="doclet.jar.name" value="xalan2jdoc.jar"/>
<property name="doclet.jar" value="${bin.dir}/${doclet.jar.name}"/>
<!-- GUMP: Currently 18-Apr-01 used only for xsltc.compile -->
<property name="BCEL.jar.name" value="BCEL.jar"/>
<property name="BCEL.jar" value="${bin.dir}/${BCEL.jar.name}"/>
<property name="crimson.jar.name" value="crimson.jar"/><!-- Why is this here? 10-Sep-01 -sc -->
<property name="crimson.jar" value="${bin.dir}/${crimson.jar.name}"/>
<property name="java_cup.jar.name" value="java_cup.jar"/>
<property name="java_cup.jar" value="${bin.dir}/${java_cup.jar.name}"/>
<property name="JLex.jar.name" value="JLex.jar"/>
<property name="JLex.jar" value="${bin.dir}/${JLex.jar.name}"/>
<property name="runtime.jar.name" value="runtime.jar"/>
<property name="runtime.jar" value="${bin.dir}/${runtime.jar.name}"/>
<property name="xml.jar.name" value="xml.jar"/>
<property name="xml.jar" value="${bin.dir}/${xml.jar.name}"/>
<!-- Defines general variables used by the other targets; name controls output xalan.jar -->
<property name="version.VERSION" value="2"/>
<property name="version.RELEASE" value="2"/>
<property name="version.DEVELOPER" value="D"/><!-- Set this to 'D' if a developer release; blank "" if maintenance release -->
<property name="version.MINOR" value="11"/><!-- EITHER the developer release number, or a maintenance release number -->
<property name="version" value="${version.VERSION}_${version.RELEASE}_${version.DEVELOPER}${version.MINOR}"/><!-- GUMP: version # of dist file -->
<property name="impl.version" value="${version.VERSION}.${version.RELEASE}.${version.DEVELOPER}${version.MINOR}"/><!-- Used in jar task for filtering MANIFEST.MF file -->
<property name="name" value="xalan"/><!-- GUMP: base name of jar target's file -->
<property name="year" value="2001"/>
<property name="build.compiler" value="classic"/>
<property name="debug" value="off"/>
<!-- Relative locations of source directories -->
<property name="manifest.mf" value="./src/MANIFEST.MF"/>
<property name="src.dir" value="./src"/>
<property name="apachexml.reldir" value="org/apache/xml"/>
<property name="xpath.reldir" value="org/apache/xpath"/>
<property name="xalan.reldir" value="org/apache/xalan"/>
<property name="xsltc.reldir" value="${xalan.reldir}/xsltc"/>
<property name="trax.reldir" value="javax/xml/transform"/>
<property name="serialize.reldir" value="org/apache/serialize"/>
<property name="serializer.reldir" value="org/apache/xalan/serialize"/>
<property name="jaxp.reldir" value="javax/xml/parsers"/>
<property name="sax.reldir" value="org/xml/sax"/>
<property name="w3c.reldir" value="org/w3c"/>
<!-- Build and distribution output areas -->
<property name="build.dir" value="./build"/><!-- GUMP: root of all normal builds output -->
<property name="build.xalan.jar" value="${build.dir}/${name}.jar"/><!-- GUMP: actual path/name of jar target output -->
<property name="build.xsltc.jar" value="${build.dir}/xsltc.jar"/>
<property name="build.classes" value="${build.dir}/classes"/>
<property name="build.api.src" value="${build.dir}/commons-src"/><!-- temp location of DOM/SAX/JAXP sources -->
<property name="build.docs" value="${build.dir}/docs"/>
<property name="build.samples" value="${build.dir}/samples"/>
<property name="build.apidocs" value="${build.docs}/apidocs"/>
<property name="dist.file" value="${name}-j_${version}"/><!-- GUMP: actual path/name of dist target .tar.gz/.zip-->
<property name="dist.dir" value="${build.dir}/${dist.file}"/>
<!-- Xalan-J1 compatability stuff. -->
<property name="compat.jar" value="xalanj1compat.jar"/>
<property name="compat.src.dir" value="./compat_src"/>
<property name="build.compat.classes" value="${build.dir}/compat_classes"/>
<property name="build.compat.jar" value="${build.dir}/${compat.jar}"/>
<property name="build.compat.apidocs" value="${build.docs}/compat_apidocs"/>
<!-- Documentation and samples information -->
<property name="Name" value="Xalan-Java"/>
<property name="version.file" value="${xalan.reldir}/processor/XSLProcessorVersion.java"/>
<property name="samples.dir" value="./samples"/>
<property name="build.samples.jar" value="${build.dir}/xalansamples.jar"/>
<property name="build.servlet.jar" value="${build.dir}/xalanservlet.jar"/>
<property name="xdocs.dir" value="./xdocs"/>
<property name="xdocs.book" value="${xdocs.dir}/sources/xalan-jlocal.xml"/>
<property name="xdocs.style" value="${xdocs.dir}/style"/>
<property name="xalanonly-styledocs"
value="dtd/xsl-html40s.dtd,dtd/spec.dtd,stylesheets/patterns.xsl,stylesheets/notice.xsl,stylesheets/spec.xsl,stylesheets/done.xsl,loaderdesign.xml,stylesheets/design2project.xsl,stylesheets/designdoc2html.xsl,stylesheets/xml2fo.xsl"/>
<property name="xalan.cmdline.class" value="org.apache.xalan.xslt.Process"/>
<property name="doc.generator" value="org.apache.stylebook.StyleBook"/>
<property name="doc.generator.styletargz" value="${xdocs.dir}/xml-site-style.tar.gz"/>
<property name="doc.generator.styletar" value="${xdocs.dir}/xml-site-style.tar"/>
<property name="site.root" value="./xml-site"/>
<property name="site.dir" value="${site.root}/target/xalan-j"/>
<property name="site.book" value="${xdocs.dir}/sources/xalan-jsite.xml"/>
<property name="xdocs.DONE.file" value="${xdocs.dir}/sources/xalan/DONE"/>
<path id="docs.class.path">
<pathelement location="${bsf.jar}" />
<pathelement location="${stylebook.jar}" />
<pathelement location="${doclet.jar}" />
<pathelement location="${build.xalan.jar}" />
<pathelement path="${java.class.path}" />
</path>
<!-- Points to tree containing common XML APIs shared between various
Apache XML projects. The base directory refers to the sub directory
that contains the build.xml file that can be used to build the
xml-commons jar file. Note that you *can* rebuild Xalan from the
local copy of sources that are checked in directly to xml-xalan,
(this is for convenience of developers who don't want to
also checkout xml-commons)
but you should not ship a public distribution build this way.
-->
<property name="xml-commons.basedir"
value="../../xml-commons/java/external"/>
<!-- Patternset to specify which xml-commons java files belong to the API -->
<patternset id="api-patternset">
<!-- Include DOM L2 core, ranges, traversal, which is what xalan had previously -->
<include name="org/w3c/dom/*"/>
<include name="org/w3c/dom/ranges/*"/>
<include name="org/w3c/dom/traversal/*"/>
<!-- Include SAX 2.0 -->
<include name="org/xml/sax/**"/>
<!-- Include only transformation APIs from JAXP -->
<include name="javax/xml/transform/**"/>
</patternset>
<!-- =================================================================== -->
<!-- Creates output build directories and doc prerequistes -->
<!-- =================================================================== -->
<target name="prepare">
<echo message="Project:${Name} version:${version} build.xml $Revision$"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
<!-- Note that all testing-related targets *must* depend on
this target, either directly or indirectly, to get
the tests-available property set for them.
-->
<available file="${test.relpath}" property="tests-available" />
<available property="xerces.present"
classname="org.apache.xerces.parsers.SAXParser"/>
<available file="${xml-commons.basedir}/build.xml"
property="xml-commons.present"/>
<echo message="xml-commons code is: ${xml-commons.present}"/>
</target>
<!-- Must depend on jar since we use Xalan to process xml files -->
<target name="prepare.docs" depends="jar">
<mkdir dir="${build.docs}"/>
<mkdir dir="${build.apidocs}"/>
<gunzip src="${doc.generator.styletargz}"/>
<untar src="${doc.generator.styletar}" dest="${xdocs.dir}"/>
<delete file="${doc.generator.styletar}"/>
<echo message="Transform todo.xml and put the result in ${build.docs}"/>
<java fork="yes" classname="${xalan.cmdline.class}">
<classpath refid="docs.class.path" />
<arg line="-in todo.xml -xsl todo.xsl -out build/docs/todo.html"/>
</java>
<!-- We use a Notes agent to periodically extract Xalan-Java 2 commits from our team database into commits.xml. The following operation
transforms commits.xml (just including source code commits) and puts the result in xdocs/sources/xalan for inclusion in the
readme.xml -->
<echo message="Transform commits.xml and put the result in ${xdocs.dir}"/>
<java fork="yes" classname="${xalan.cmdline.class}" >
<classpath refid="docs.class.path" />
<arg line="-in commits.xml -xsl ${xdocs.style}/stylesheets/done.xsl -out ${xdocs.DONE.file}"/>
</java>
<echo message="Generate Xalan-J 2.x design document"/>
<java fork="yes" classname="${doc.generator}" >
<classpath refid="docs.class.path" />
<arg line="loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./build/docs/design/
./xdocs/sources/xalandesign.xml ./xdocs/style"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Copy one set of DOM/SAX/JAXP files for compilation use -->
<!-- =================================================================== -->
<target name="copy-commons-src-from-xml-commons" if="xml-commons.present"
depends="prepare">
<echo message="*** Copying API src from ${xml-commons.basedir}"/>
<copy todir="${build.api.src}" includeemptydirs="no">
<fileset dir="${xml-commons.basedir}/src">
<patternset refid="api-patternset"/>
</fileset>
</copy>
</target>
<target name="copy-commons-src-from-local" unless="xml-commons.present"
depends="prepare">
<echo message="*** Copying API src from local tree..."/>
<echo message="*** WARNING: you should not ship a dist from this build!"/>
<!-- Before shipping a public distribution of xalan on
xml.apache.org, you really must checkout xml-commons
and use those DOM/SAX/JAXP sources!
-->
<copy todir="${build.api.src}" includeemptydirs="no">
<fileset dir="src">
<patternset refid="api-patternset"/>
</fileset>
</copy>
</target>
<!-- This target copies either the 'official' set of DOM/SAX/JAXP
files from the sister xml-commons directory, or the 'fallback'
set of DOM/SAX/JAXP files that are checked into xml-xalan as
a convenience for developers.
-->
<target name="copy-commons-src"
depends="copy-commons-src-from-xml-commons,copy-commons-src-from-local"/>
<!-- =================================================================== -->
<!-- Compile entire source tree - except Xalan-J 1 compatability classes -->
<!-- =================================================================== -->
<target name="compile" depends="prepare,copy-commons-src"
description="Compile Xalan-J 2.x (skips 1.x compat and XSLTC)" >
<echo message="compile entire source tree and copy .properties and .res files to build tree."/>
<!-- Note: split compile into separate javac steps to avoid JDK 1.1.8 bug reported at:
http://developer.java.sun.com/developer/bugParade/bugs/4043508.html
which causes an error like:
[javac] E:\builds\xml-xalan\java\src\org\apache\xalan\templates\ElemTemplate.java:108: Cyclic class inheritance or scoping.
-->
<!-- Compile our temp copy of DOM/SAX/JAXP xml-commons classes -->
<javac srcdir="${build.api.src}"
destdir="${build.classes}"
debug="${debug}"
optimize="${optimize}"
deprecation="off">
<classpath>
<pathelement location="${build.classes}"/>
</classpath>
<patternset refid="api-patternset"/>
</javac>
<!-- Compile XPath engine and some common utilities -->
<javac srcdir="${src.dir}"
destdir="${build.classes}"
debug="${debug}" >
<include name="${apachexml.reldir}/**/*.java" />
<include name="${xpath.reldir}/**/*.java" />
<exclude name="**/CoroutineSAXFilterTest.java"
unless="xerces.present" />
<exclude name="**/CoroutineSAXParser_Xerces.java"
unless="xerces.present" />
<exclude name="**/IncrementalSAXSource_Xerces.java"
unless="xerces.present" />
</javac>
<!-- Compile Xalan main engine (but not xsltc package yet) -->
<javac srcdir="${src.dir}"
destdir="${build.classes}"
includes="${xalan.reldir}/**/*.java"
excludes="${xsltc.reldir}/**/*.java,${xalan.reldir}/lib/**/*.java,${xalan.reldir}/xslt/**/*.java"
debug="${debug}"/>
<!-- Compile various Xalan-specific extensions and command line class -->
<javac srcdir="${src.dir}"
destdir="${build.classes}"
includes="${xalan.reldir}/lib/**/*.java,${xalan.reldir}/xslt/**/*.java"
debug="${debug}"/>
<!-- Copy needed properties, resource, etc. files to be put into .jar file -->
<copy todir="${build.classes}">
<fileset dir="${src.dir}" includes="**/*.properties,**/*.res,**/javax.xml.parsers.*,**/javax.xml.transform.*"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Compile just the XSLTC compiler portion (to be integrated soon!) -->
<!-- =================================================================== -->
<path id="xsltc.class.path">
<pathelement location="${BCEL.jar}" />
<pathelement location="${JLex.jar}" />
<pathelement location="${java_cup.jar}" />
<pathelement location="${runtime.jar}" />
<pathelement location="${xml.jar}" />
<pathelement location="${crimson.jar}" />
<!-- build.classes needed for
org.apache.xalan.xsltc.util.JavaCupRedirect -->
<pathelement location="${build.classes}" />
<pathelement path="${java.class.path}" />
</path>
<!-- The xsltc.compile target should be rewritten to properly
do dependencies on the generated sources: right now, it
will always regenerate the sources, even if it's not needed
(which forces all later steps to re-run as well) -->
<target name="xsltc.compile" depends="prepare"
description="Compile just the XSLTC classes" >
<!-- The first step compiles the utils directpry, which includes
a special wrapper for the java_cup step next. -->
<echo message="Compiling XSLTC utilities"/>
<javac srcdir="${src.dir}"
destdir="${build.classes}"
includes="${xsltc.reldir}/util/**/*.java"
debug="${debug}">
<classpath refid="xsltc.class.path" />
</javac>
<!-- The second step generates sym.java and XPathParser.java, and the
last one generates XPathLexer.java. The lexiographical analyser
has to be generated after sym.java, so order is important. -->
<echo message="java_cup preparsing"/>
<java fork="no" failonerror="true" classname="org.apache.xalan.xsltc.util.JavaCupRedirect" >
<classpath refid="xsltc.class.path" />
<!-- We're using JavaCupRedirect to call the java_cup application -->
<arg line="-parser XPathParser -expect 0 -stdin ${src.dir}/${xsltc.reldir}/compiler/xpath.cup"/>
</java>
<echo message="java_cup move output files"/>
<move file="XPathParser.java" tofile="${src.dir}/${xsltc.reldir}/compiler/XPathParser.java"/>
<move file="sym.java" tofile="${src.dir}/${xsltc.reldir}/compiler/sym.java"/>
<echo message="JLex preparsing"/>
<java fork="no" failonerror="true" classname="JLex.Main" >
<classpath refid="xsltc.class.path" />
<arg line="-static ${src.dir}/${xsltc.reldir}/compiler/xpath.lex"/>
</java>
<echo message="JLex move output file"/>
<move file="${src.dir}/${xsltc.reldir}/compiler/xpath.lex.java" tofile="${src.dir}/${xsltc.reldir}/compiler/XPathLexer.java"/>
<echo message="Compiling remaining XSLTC classes"/>
<javac srcdir="${src.dir}"
destdir="${build.classes}"
includes="${xsltc.reldir}/**/*.java"
debug="${debug}">
<classpath refid="xsltc.class.path" />
</javac>
</target>
<target name="xsltc.jar" depends="xsltc.compile"
description="Jar just the xsltc.jar file" >
<jar jarfile="${build.xsltc.jar}" basedir="${build.classes}" >
<patternset><!-- relative to jar/@basedir -->
<include name="${xsltc.reldir}/**/*" />
</patternset>
</jar>
</target>
<!-- =================================================================== -->
<!-- Creates the xalan JAR -->
<!-- =================================================================== -->
<target name="jar" depends="compile"
description="Jar up xalan.jar" >
<!-- Copy over the manifest, with filtering (for version number) -->
<filter token="impl.version" value="${impl.version}"/>
<copy todir="${build.dir}" file="${manifest.mf}" filtering="true"/>
<jar jarfile="${build.xalan.jar}" manifest="${build.dir}/MANIFEST.MF" basedir="${build.classes}" >
<patternset><!-- relative to jar/@basedir -->
<exclude name="${xsltc.reldir}/**/*" />
<exclude name="javax/xml/parsers/**" />
<exclude name="META-INF/services/javax.xml.parsers*" />
</patternset>
</jar>
</target>
<!-- =================================================================== -->
<!-- Default all target simply Creates the xalan JAR -->
<!-- =================================================================== -->
<target name="all" depends="jar"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
<echo message="Redirect to jar target; please provide input on desired functionality of this target"/>
</target>
<!-- =================================================================== -->
<!-- Creates the Xalan-J1 compatability JAR -->
<!-- =================================================================== -->
<target name="compat.jar" depends="jar"
description="Compile and jar Xalan-J 1.x backwards compat classes" >
<echo message="Compile and jar just the Xalan-J 1 compability API"/>
<mkdir dir="${build.compat.classes}"/>
<javac srcdir="${compat.src.dir}" classpath="${build.xalan.jar}:${java.class.path}"
destdir="${build.compat.classes}"
includes="**/*.java"
debug="${debug}"/>
<copy todir="${build.compat.classes}">
<fileset dir="${compat.src.dir}" includes="**/*.properties,**/*.res"/>
</copy>
<jar jarfile="${build.compat.jar}" manifest="src\MANIFEST.MF" basedir="${build.compat.classes}"/>
</target>
<!-- =================================================================== -->
<!-- Creates the Xalan-J1 compatability javadoc -->
<!-- =================================================================== -->
<target name="compat.javadocs" depends="jar"
description="Build javadocs for Xalan-J 1.x backwards compat classes" >
<mkdir dir="${build.compat.apidocs}"/>
<javadoc
public="true"
sourcepath="${compat.src.dir}"
overview="${compat.src.dir}/compatOverview.html"
packagenames="org.apache.xalan.xslt,org.apache.xalan.xpath,org.apache.xalan.xpath.xml"
author="true"
version="true"
use="true"
destdir="${build.compat.apidocs}"
windowtitle="${Name} 1 Compatability"
doctitle="${Name} 1 Compatability"
bottom="Copyright &#169; ${year} Apache XML Project. All Rights Reserved.">
<classpath refid="docs.class.path" />
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Compiles the samples (servlet excluded) and jars the class files -->
<!-- =================================================================== -->
<target name="samples" depends="jar"
description="Compile and jar the samples (except servlet)" >
<property name="exclude" value="*.xml,*.xsl,*.txt,*.html,*.properties,*.out"/>
<mkdir dir="${build.samples}"/>
<!-- Since the samples are packageless, they must be compiled separately. -->
<javac srcdir="${samples.dir}/SimpleTransform" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samples.dir}/UseStylesheetPI" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samples.dir}/UseStylesheetParam" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samples.dir}/SAX2SAX" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samples.dir}/DOM2DOM" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samples.dir}/Pipe" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samples.dir}/UseXMLFilters" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samples.dir}/Trace" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samples.dir}/ApplyXPath" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samples.dir}/trax" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samples.dir}/extensions" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samples.dir}/Validate" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}" excludes="${exclude}"
debug="${debug}"/>
<jar jarfile="${build.samples.jar}" basedir="${build.samples}"
includes="*.class"/>
</target>
<!-- =================================================================== -->
<!-- Compiles the sample servlet and jars the class files. -->
<!-- The javax.servlet and javax.servlet.http packages -->
<!-- must be on the classpath -->
<!-- =================================================================== -->
<target name="servlet" depends="jar"
description="Compile and jar the servlet samples" >
<echo message="To compile the sample servlets, javax.servlet and javax.servlet.http must be on the classpath"/>
<mkdir dir="${build.samples}/servlet"/>
<javac srcdir="${samples.dir}/servlet" classpath="${java.class.path}:${build.xalan.jar}"
destdir="${build.samples}"
debug="${debug}"/>
<copy todir="${build.samples}/servlet">
<fileset dir="${samples.dir}/servlet"
includes="media.properties,default.xsl,default2.xsl"/>
</copy>
<jar jarfile="${build.servlet.jar}"
basedir="${build.samples}"
includes="servlet/**"/>
</target>
<!-- =================================================================== -->
<!-- Compiles (does not jar) the translet samples in translets. -->
<!-- For time being, classes are generated in place. -->
<!-- To run these samples, add xsltc.jar, runtime.jar, BCEL.jar, -->
<!-- and java_cup.jar (all in the bin directory) to the classpath -->
<!-- -->
<!-- When we have straightened out classpath issues, -->
<!-- add samples in CompiledApplet, CompiledBrazil, and CompiledServlet -->
<!-- =================================================================== -->
<target name="xsltc.samples" depends="jar,xsltc.jar">
<javac srcdir="${samples.dir}/translets" classpath="${java.class.path}:${build.xsltc.jar}"
destdir="${samples.dir}/translets" excludes="${exclude}"
debug="${debug}"/>
</target>
<!-- =================================================================== -->
<!-- Generate HTML docs -->
<!-- =================================================================== -->
<target name="docs" depends="jar,prepare.docs,autodocs"
description="Build the documentation (overview, readme, etc.)" >
<echo message="docs is human-usable target with dependencies"/>
</target>
<target name="autodocs">
<echo message="autodocs is for automated build process, without dependencies"/>
<java fork="yes"
classname="${doc.generator}"
classpathref="docs.class.path" >
<arg line="targetDirectory=${build.docs} ${xdocs.book} ${xdocs.style}"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="javadocs" depends="jar,prepare.docs,autojavadocs"
description="Build the Javadocs for Xalan 2.x sources" >
<echo message="javadocs is human-usable target with dependencies"/>
</target>
<target name="autojavadocs">
<echo message="autojavadocs is for automated build process, without dependencies"/>
<!-- Ant ignores destdir arg if doclet is set, so must send to doclet in doclet subelement-->
<javadoc
public="true"
sourcepath="${src.dir}"
overview="${src.dir}/javadocOverview.html"
packagenames="org.apache.*,org.xml.*,org.w3c.*,javax.xml.*"
author="true"
version="true"
use="true"
windowtitle="${Name} 2"
doctitle="${Name} 2"
bottom="Copyright &#169; ${year} Apache XML Project. All Rights Reserved.">
<classpath refid="docs.class.path" />
<doclet name="xalanjdoc.Standard" path="${doclet.jar}">
<param name="-d" value="${build.apidocs}"/>
</doclet>
<group title="Transformations API for XML (TrAX)" packages="javax.xml.transform*"/>
<group title="Java API for XML Parsing" packages="javax.xml.parsers"/>
<group title="Xalan Core"
packages="org.apache.xalan.processor:org.apache.xalan.templates:org.apache.xalan.transformer"/>
<group title="XPath" packages="org.apache.xpath*"/>
<group title="Document Table Model (DTM)" packages="org.apache.xml.dtm*"/>
<group title="Utilities" packages="org.apache.xml.utils*"/>
<group title="Xalan Other" packages="org.apache.xalan.client:org:org.apache.xalan.extensions:org.apache.xalan.res:org.apache.xalan.stree:org.apache.xalan.trace:org.apache.xalan.xslt"/>
<group title="Xalan Extensions" packages="org.apache.xalan.lib*"/>
<group title="Serializers" packages="org.apache.xalan.serialize"/>
<group title="SAX 2" packages="org.xml.sax*"/>
<group title="DOM 2" packages="org.w3c.dom*"/>
<group title="XSLTC Core"
packages="org.apache.xalan.xsltc*"/>
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Various targets to clean the build tree -->
<!-- =================================================================== -->
<target name="distclean" depends="clean"
description="Clean everything, including dist/jar/docs/xsltc.*" >
<delete dir="${dist.dir}"/>
</target>
<target name="clean" depends="xsltc.clean"
description="Clean the ${build.dir} tree and doc outputs" >
<delete dir="${build.dir}"/>
<delete dir="${site.root}"/>
<delete>
<fileset dir="${xdocs.style}" excludes="${xalanonly-styledocs}"/>
</delete>
<delete file="${xdocs.DONE.file}"/>
</target>
<target name="xsltc.clean"
description="Clean miscellaneous generated sources from xsltc.compile" >
<delete file="${src.dir}/${xsltc.reldir}/compiler/XPathParser.java" />
<delete file="${src.dir}/${xsltc.reldir}/compiler/sym.java" />
<delete file="${src.dir}/${xsltc.reldir}/compiler/XPathLexer.java" />
</target>
<!-- =================================================================== -->
<!-- Install/Uninstall targets - not currently applicable -->
<!-- =================================================================== -->
<target name="install"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
<echo message="install target currently not supported in ${Name}; try jar or dist instead"/>
</target>
<target name="uninstall"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
<echo message="uninstall target currently not supported in ${Name}; try distclean instead"/>
</target>
<!-- =================================================================== -->
<!-- Creates the distribution -->
<!-- =================================================================== -->
<target name="dist" depends="jar,docs,javadocs,samples,servlet,compat.jar,compat.javadocs,xsltc.jar,xsltc.docs,autodist,todo"
description="Create a .zip/.tar.gz distribution module" >
<echo message="dist is human-useable target for distribution, with all dependencies"/>
</target>
<target name="autodist">
<echo message="autodist is for automated build processes, without dependencies"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.dir}/bin"/>
<mkdir dir="${dist.dir}/src"/>
<mkdir dir="${dist.dir}/compat_src"/>
<mkdir dir="${dist.dir}/xdocs"/>
<mkdir dir="${dist.dir}/docs"/>
<mkdir dir="${dist.dir}/docs/apidocs"/>
<mkdir dir="${dist.dir}/docs/compat_apidocs"/>
<mkdir dir="${dist.dir}/samples"/>
<!-- Copy bin directory -->
<copy todir="${dist.dir}/bin">
<fileset dir="${bin.dir}"/>
</copy>
<!-- Copy sources and source documentation -->
<copy todir="${dist.dir}/src">
<fileset dir="${src.dir}"/>
</copy>
<copy todir="${dist.dir}/compat_src">
<fileset dir="${compat.src.dir}"/>
</copy>
<copy todir="${dist.dir}/xdocs">
<fileset dir="${xdocs.dir}"/>
</copy>
<!-- Copy built documentation and javadoc, and samples src and jars -->
<copy todir="${dist.dir}/docs">
<fileset dir="${build.docs}"/>
</copy>
<copy todir="${dist.dir}/samples">
<fileset dir="${samples.dir}"/>
</copy>
<copy file="${build.dir}/xalansamples.jar" todir="${dist.dir}/bin"/>
<copy file="${build.dir}/xalanservlet.jar" todir="${dist.dir}/bin"/>
<!-- Copy various built .jar files into the bin directory (subject to change) -->
<copy file="${build.xalan.jar}" todir="${dist.dir}/bin"/>
<copy file="${build.compat.jar}" todir="${dist.dir}/bin"/>
<copy file="${build.xsltc.jar}" todir="${dist.dir}/bin"/>
<copy todir="${dist.dir}">
<fileset dir="." includes="readme.html,KEYS,License,build.xml,build.sh,build.bat,todo.xml,xsltc_todo.xml,todo.xsl,commits.xml"/>
</copy>
<zip zipfile="${build.dir}/${dist.file}.zip" basedir="${build.dir}" includes="${dist.file}/**"/>
<tar tarfile="${build.dir}/${dist.file}.tar" basedir="${build.dir}" includes="${dist.file}/**"/>
<gzip src="${build.dir}/${dist.file}.tar" zipfile="${build.dir}/${dist.file}.tar.gz"/>
</target>
<!-- =================================================================== -->
<!-- Creates the documentation tree for the org.apache.xml website -->
<!-- =================================================================== -->
<target name="site" depends="prepare.docs"
description="Build documentation for posting to the website" >
<mkdir dir="${site.dir}/apidocs"/>
<mkdir dir="${site.dir}/compat_apidocs"/>
<mkdir dir="${site.dir}/design"/>
<java fork="yes"
classname="${doc.generator}"
classpathref="docs.class.path" >
<arg line="targetDirectory=${site.dir} ${site.book} ${xdocs.style}"/>
</java>
<!-- put todo.html in the site directory -->
<copy file="${build.docs}/todo.html" todir="${site.dir}"/>
<!-- put xalan design doc in the site design subdir -->
<copy todir="${site.dir}/design">
<fileset dir="${build.docs}/design"/>
</copy>
<!-- put xsltc design doc in the site xsltc subdir -->
<copy todir="${site.dir}/xsltc">
<fileset dir="${build.docs}/xsltc"/>
</copy>
<!-- put in the javadoc -->
<copy todir="${site.dir}/apidocs">
<fileset dir="${build.apidocs}"/>
</copy>
<copy todir="${site.dir}/compat_apidocs">
<fileset dir="${build.compat.apidocs}"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Compiles and runs mini/smoketest from xml-xalan\test, if present -->
<!-- =================================================================== -->
<property name="test.relpath" value="../test"/>
<target name="minitest" depends="prepare,minitest-run,tests-not-available"
description="Run the Minitest from xml-xalan/test" >
<!-- This target simply asks the minitest-run worker target to
actually have the Minitest run (by the test/build.xml file);
we then also call the tests-not-available target in case
the user never checked out the tests.
-->
</target>
<target name="minitest-run" if="tests-available" depends="jar" >
<echo message=" [minitest] Calling ${test.relpath}/build.xml to run the Minitest" />
<ant dir="${test.relpath}" antfile="build.xml" target="minitest.gump" >
</ant>
</target>
<target name="smoketest" depends="prepare,smoketest-run,tests-not-available"
description="Run Smoketests (Minitest, conf, harness) from xml-xalan/test" >
</target>
<target name="smoketest-run" if="tests-available" depends="jar" >
<echo message=" [minitest] Calling ${test.relpath}/build.xml to run the Smoketest" />
<ant dir="${test.relpath}" antfile="build.xml" target="smoketest.dev" >
</ant>
</target>
<target name="check" depends="smoketest"><!-- 'Standardizing build.xml files' <bloritsch@apache.org> -->
<echo message="Redirect to smoketest target"/>
</target>
<!-- Called from various testing targets if the test dir doesn't exist. -->
<target name="tests-not-available" unless="tests-available" >
<echo message=" [tests] The tests do not seem to be present in ${test.relpath}" />
<echo message=" [tests] You must have checked out from CVS to run the tests," />
<echo message=" [tests] it is not included in binary distributions." />
<echo message=" [tests] See http://xml.apache.org/xalan-j/test/ for more info." />
</target>
<!-- =================================================================== -->
<!-- Creates the todo list for the org.apache.xml website -->
<!-- =================================================================== -->
<target name="todo">
<java fork="yes"
classname="${xalan.cmdline.class}"
classpathref="docs.class.path" >
<arg line="-in todo.xml -xsl todo.xsl -out todo.html"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Creates the xalan design document -->
<!-- =================================================================== -->
<target name="xalan-j2-design">
<java fork="yes"
classname="${doc.generator}"
classpathref="docs.class.path" >
<arg line="loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=${build.dir}/docs/design/
${xdocs.dir}/sources/xalandesign.xml ${xdocs.style}"/>
</java>
</target>
<!-- =================================================================== -->
<!-- Use FOP to create preliminary print (pdf) doc -->
<!-- Note: fop.jar and xml.jar (from xml-fop) must be on classpath -->
<!-- This is VERY preliminary, not yet for inclusion in distribution -->
<!-- =================================================================== -->
<!--Collate the xml sources into a single xml source with a litle extra structure -->
<target name="printerdocs" depends="prepare.docs">
<echo message="NOTICE: requires fop.jar and xml.jar on the classpath"/>
<java fork="yes"
classname="${xalan.cmdline.class}"
classpathref="docs.class.path" >
<arg line="-xsl ${xdocs.dir}/sources/xalan-collate.xsl
-out xdocs/sources/xalan/xalan-collate.xml"/>
</java>
<!-- Transform collation into Formatting Objects
(with a little work on links along the way) -->
<java fork="yes"
classname="${xalan.cmdline.class}"
classpathref="docs.class.path" >
<arg line="-in ${xdocs.dir}/sources/xalan/xalan-collate.xml
-param resourceFile '../../sources/xalan/resources.xml'
-param project ${Name}
-xsl ${xdocs.style}/stylesheets/xml2fo.xsl
-out build/docs/xalan-collate.fo"/>
</java>
<!-- Use FOP to generate a pdf file (classpath may need updating! -sc 18-Apr-01)-->
<java fork="yes"
classname="org.apache.fop.apps.CommandLine"
classpath="${java.class.path}:${build.xalan.jar}:${bin.dir}/fop.jar:${bin.dir}/w3c.jar">
<arg line="${build.docs}/xalan-collate.fo build/docs/xalan.pdf"/>
</java>
</target>
<!-- =================================================================== -->
<!-- for developers only; compiles xalan-j1 samples with compat jar and xalan-j2 xalan.jar-->
<target name="compat.samples" depends="jar,compat.jar"
description="Compile and jar Xalan-J 1.x backwards compat samples" >
<property name="exclude" value="*.xml,*.xsl,*.txt,*.html.*.properties"/>
<property name="samplesj1.dir" value="/xml-xalan/samples"/>
<property name="build.compat.samples" value="./build/compat_samples"/>
<mkdir dir="${build.compat.samples}"/>
<!--need to use the XalanJ2 XPathAPI, so cannot compile ApplyXPath as is -->
<javac srcdir="${samplesj1.dir}/Pipe" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}"
destdir="${build.compat.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samplesj1.dir}/SimpleTransform" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}"
destdir="${build.compat.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samplesj1.dir}/TransformToDom" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}"
destdir="${build.compat.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samplesj1.dir}/PureSAX" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}"
destdir="${build.compat.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samplesj1.dir}/UseStylesheetParam" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}"
destdir="${build.compat.samples}" excludes="${exclude}"
debug="${debug}"/>
<javac srcdir="${samplesj1.dir}/Servlet" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}"
destdir="${build.compat.samples}" excludes="${exclude}"
debug="${debug}"/>
<jar jarfile="${build.compat.samples}/xalanjcompatsamples.jar" basedir="${build.compat.samples}"
includes="*.class"/>
<!--put the servlet in a separate jar -->
<javac srcdir="${samplesj1.dir}/Servlet" classpath="${build.compat.jar}:${build.xalan.jar}:${java.class.path}"
destdir="${build.compat.samples}"
debug="${debug}"/>
<copy todir="${build.compat.samples}/servlet">
<fileset dir="${samplesj1.dir}/Servlet"
includes="media.properties,default.xsl,default2.xsl"/>
</copy>
<jar jarfile="${build.compat.samples}/xalancompatservlet.jar" basedir="${build.compat.samples}"
includes="servlet/**"/>
</target>
<!-- =================================================================== -->
<!-- Build XSLTC design documentation. Eventually intend to incorporate -->
<!-- XSLTC into the Xalan book. -->
<!-- =================================================================== -->
<target name="xsltc.prepare.docs" depends="prepare.docs">
<echo message="Transform xsltc_todo.xml and put the result in ${build.docs}/xsltc"/>
<mkdir dir="${build.docs}/xsltc"/>
<java fork="yes" classname="${xalan.cmdline.class}">
<classpath refid="docs.class.path" />
<arg line="-in xsltc_todo.xml -xsl todo.xsl -out build/docs/xsltc/todo.html"/>
</java>
</target>
<target name="xsltc.docs" depends="xsltc.prepare.docs">
<echo message="Build the XSLTC Architectural documentation"/>
<java fork="yes"
classname="${doc.generator}"
classpathref="docs.class.path" >
<arg line="targetDirectory=${build.docs}/xsltc ${xdocs.dir}/sources/xsltc.xml ${xdocs.style}"/>
</java>
</target>
<!-- pack all doc for transfer to website -->
<target name="pack.docs">
<!--tar tarfile="./build/xalan-j-docs.tar" basedir="./xml-site/target/xalan-j" includes="**"/>
<gzip src="./build/xalan-j-docs.tar" zipfile="./build/xalan-j-docs.tar.gz"/-->
<zip zipfile="./build/xalan-j-docs.zip" basedir="./xml-site/target/xalan-j" includes="**"/>
</target>
</project>