| <?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: use JDK 1.2.x or higher |
| |
| |
| Build Instructions: |
| To build, run |
| build.bat (win32) or build.sh (unix) - optionally with a target arg as indicated below - |
| in the directory where this file is located. |
| |
| The batch/shell file sets up your classpath and calls java org.apache.tools.ant.Main |
| |
| Build targets |
| This build file supports the following targets: |
| - compile compiles Xalan-J in ./build/classes. |
| - jar creates ./build/xalan.jar [the default target] |
| - samples compiles samples and puts classes in ./build/xalanxamples.jar |
| - servlet compiles sample servlets and puts classes in ./build/xalanservlet.jar |
| - docs generates the human-written documentation in ./build/docs |
| - javadocs [or apidocs] generates the API documentation in ./build/docs/apidocs |
| - compat.jar compiles compatibility tree and creates ./build/xalanj1compat.jar |
| - compat.apidocs generates javadoc for the compatibility jar |
| - clean purges the build tree. |
| - dist creates a complete distribution in ./xalan-j_x_x_x |
| - auto* targets used by automated build programs, without dependencies |
| - minitest compile and run the minitest in xml-xalan\test |
| - conftest compile and run the conftest in xml-xalan\test |
| - smoketest run a pre-checkin smoketest (5 to 10 minutes). |
| - print.docs create PDF documentation (requires fop.jar and w3c.jar). |
| |
| If you build a target that depends on other targets, those other targets are created in |
| the correct order. |
| |
| Authors: |
| Shane Curcuru <shane_curcuru@lotus.com> |
| Don Leslie <donald_leslie@lotus.com> |
| |
| Copyright: |
| Copyright (c) 1999-2000 The Apache Software Foundation. |
| |
| - Much of this file stolen from Stefano's xml-xerces build.xml |
| |
| $Id$ |
| |
| ==================================================================== --> |
| |
| <project name="Xalan" default="jar" basedir="."> |
| <!-- =================================================================== --> |
| <!-- Defines variables used by the other targets --> |
| <!-- =================================================================== --> |
| <property name="version" value="2_0_1"/> |
| <property name="name" value="xalan"/> |
| <property name="Name" value="Xalan-Java"/> |
| <property name="year" value="2000"/> |
| |
| |
| <property name="build.compiler" value="classic"/> |
| <property name="debug" value="off"/> |
| |
| <property name="mfinf.dir" value="./src/META-INF"/> |
| <property name="src.dir" value="./src"/> |
| <property name="xpath.reldir" value="org/apache/xpath"/> |
| <property name="xalan.reldir" value="org/apache/xalan"/> |
| <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"/> |
| <property name="build.dir" value="./build"/> |
| <!-- Where we put the xalan.jar we compile by default --> |
| <property name="build.xalan.jar" value="${build.dir}/xalan.jar"/> |
| <property name="build.classes" value="${build.dir}/classes"/> |
| <property name="build.docs" value="${build.dir}/docs"/> |
| <property name="build.samples" value="${build.dir}/samples"/> |
| <property name="build.apidocs" value="${build.docs}/apidocs"/> |
| |
| <!-- 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"/> |
| |
| <!-- Reference to the top level of the test source code area. --> |
| <property name="tests.dir" value="../test/java/"/> |
| <property name="samples.dir" value="./samples"/> |
| <property name="bin.dir" value="./bin"/> |
| <property name="xerces.jar" value="${bin.dir}/xerces.jar"/> |
| <property name="bsf.jar" value="${bin.dir}/bsf.jar"/> |
| |
| <property name="dist.file" value="${name}-j_${version}"/> |
| <property name="dist.dir" value="${build.dir}/${dist.file}"/> |
| |
| <property name="xdocs.dir" value="./xdocs"/> |
| <property name="version.file" value="org/apache/xalan/processor/XSLProcessorVersion.java"/> |
| <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="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="test.loggingLevel" value="5"/> |
| <!-- The excluded lre tests are at issue or are new bugs, and should be |
| included as soon as they are resolved. --> |
| <property name="test.excludes" value="impincl12.xsl;lre02.xsl;lre03.xsl;lre07.xsl;lre10.xsl;lre12.xsl;lre21.xsl"/> |
| <property name="test.embedded" value="embed01.xsl;embed02.xsl;embed07.xsl"/> |
| |
| <!-- =================================================================== --> |
| <!-- Prepares the xdocs/style and the build directories --> |
| <!-- =================================================================== --> |
| <target name="prepare"> |
| <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="${tests.dir}" property="tests-available" /> |
| </target> |
| <target name="prepare.docs" depends="prepare"> |
| <gunzip src="${doc.generator.styletargz}"/> |
| <untar src="${doc.generator.styletar}" dest="${xdocs.dir}"/> |
| <delete file="${doc.generator.styletar}"/> |
| <mkdir dir="${build.docs}"/> <!-- transform todo.xml and put the result in build/docs --> |
| <java fork="yes" classname="org.apache.xalan.xslt.Process" classpath="${java.class.path}:${build.dir}/$xalan.jar"> |
| <arg line="-in todo.xml -xsl todo.xsl -out ${build.docs}/todo.html"/> |
| </java> |
| <!-- We use a Notes agent to 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 --> |
| <java fork="yes" classname="org.apache.xalan.xslt.Process" classpath="${java.class.path}:${build.dir}/$xalan.jar"> |
| <arg line="-in commits.xml -xsl ${xdocs.style}/stylesheets/done.xsl -out ${xdocs.dir}/sources/xalan/DONE"/> |
| </java> |
| <!-- Generate the Xalan-J2 design document --> |
| <java fork="yes" classname="${doc.generator}" |
| classpath="${java.class.path}:${build.dir}/xalan.jar"> |
| <arg line="loaderConfig=sbk:/style/loaderdesign.xml targetDirectory=./build/docs/design/ |
| ./xdocs/sources/xalandesign.xml ./xdocs/style"/> |
| </java> |
| |
| <mkdir dir="${build.apidocs}"/> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Copy over the source code --> |
| <!-- We're currently skipping this step, since it seems extraneous if |
| you're not going to be using the filtering stuff. --> |
| <!-- =================================================================== --> |
| |
| <!-- =================================================================== --> |
| <!-- Compiles the source tree - xpath (independent xpath engine) --> |
| <!-- =================================================================== --> |
| <!-- Note: Still too many cross-dependencies to do this separately --> |
| <target name="compile.xpath" depends="prepare"> |
| <javac srcdir="${src.dir}/${xpath.reldir}" |
| destdir="${build.classes}" |
| debug="${debug}" /> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Compiles the source tree - xalan (the processor) --> |
| <!-- =================================================================== --> |
| <!-- Note: Still too many cross-dependencies to do this separately --> |
| <target name="compile.xalan" depends="compile.xpath"> |
| <javac srcdir="${src.dir}/${xalan.reldir}" |
| destdir="${build.classes}" |
| debug="${debug}"/> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Compile entire source tree - except Xalan-J 1 compatability classes --> |
| <!-- =================================================================== --> |
| <target name="compile" depends="prepare" |
| description="Compile Xalan the normal way" > |
| <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. |
| --> |
| <javac srcdir="${src.dir}" |
| destdir="${build.classes}" |
| includes="javax/**/*.java" |
| debug="${debug}"/> |
| <javac srcdir="${src.dir}" |
| destdir="${build.classes}" |
| includes="org/w3c/**/*.java,org/w3c/**/*.java" |
| debug="${debug}"/> |
| <javac srcdir="${src.dir}" |
| destdir="${build.classes}" |
| includes="org/apache/xml/**/*.java,org/apache/xpath/**/*.java" |
| debug="${debug}"/> |
| <javac srcdir="${src.dir}" |
| destdir="${build.classes}" |
| includes="org/apache/xalan/**/*.java" |
| debug="${debug}"/> |
| <copy todir="${build.classes}"> |
| <fileset dir="${src.dir}" includes="**/*.properties,**/*.res,**/javax.xml.parsers.*,**/javax.xml.transform.*"/> |
| </copy> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Compiles other source trees --> |
| <!-- =================================================================== --> |
| <target name="compile.trax" depends="prepare"> |
| <javac srcdir="${src.dir}" |
| destdir="${build.classes}" |
| includes="${trax.reldir}/**" |
| debug="${debug}"/> |
| </target> |
| <target name="compile.serialize" depends="prepare"> |
| <javac srcdir="${src.dir}" |
| destdir="${build.classes}" |
| includes="${serialize.reldir}/**" |
| debug="${debug}"/> |
| </target> |
| <target name="compile.sax" depends="prepare"> |
| <javac srcdir="${src.dir}/${sax.reldir}" |
| destdir="${build.classes}" |
| debug="${debug}"/> |
| </target> |
| <target name="compile.w3c" depends="prepare"> |
| <javac srcdir="${src.dir}/${w3c.reldir}" |
| destdir="${build.classes}" |
| debug="${debug}"/> |
| </target> |
| <target name="compile.jaxp" depends="prepare"> |
| <javac srcdir="${src.dir}/${jaxp.reldir}" |
| destdir="${build.classes}" |
| debug="${debug}"/> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Creates the xalan JAR --> |
| <!-- =================================================================== --> |
| <target name="jar" depends="compile" |
| description="Jar up xalan.jar" > |
| <jar jarfile="${build.xalan.jar}" manifest="src\MANIFEST.MF" basedir="${build.classes}"/> |
| </target> |
| <target name="package" depends="jar"> |
| <!-- OK, what are the 'Apache-standard' names for various targets? --> |
| <echo message="package is an alias for jar"/> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Creates the Xalan-J1 compatability JAR --> |
| <!-- =================================================================== --> |
| <target name="compat.jar" depends="jar"> |
| <echo message="compile and JAR Xalan-J 1 compability API."/> |
| <mkdir dir="${build.compat.classes}"/> |
| <javac srcdir="${compat.src.dir}" classpath="${java.class.path}:${build.xalan.jar}" |
| 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> |
| <target name="compat.package" depends="compat.jar"> |
| <echo message="compat.package is an alias for compat.jar"/> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Creates the Xalan-J1 compatability javadoc --> |
| <!-- =================================================================== --> |
| <target name="compat.javadocs" depends="jar"> |
| <mkdir dir="${build.compat.apidocs}"/> |
| <javadoc |
| classpath="${java.class.path}" |
| 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="Xalan-Java 1 Compatability" |
| doctitle="Xalan-Java 1 Compatability" |
| bottom="Copyright © ${year} Apache XML Project. All Rights Reserved."> |
| </javadoc> |
| </target> |
| <target name="compat.apidocs" depends="compat.javadocs"> |
| <echo message="compat.apidocs is an alias for compat.javadocs"/> |
| </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}"/> |
| <jar jarfile="${build.dir}/xalansamples.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.dir}/xalanservlet.jar" |
| basedir="${build.samples}" |
| includes="servlet/**"/> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Generate HTML docs --> |
| <!-- =================================================================== --> |
| <target name="docs" depends="jar,prepare.docs,autodocs" |
| description="Build the framework 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}" classpath="${java.class.path}:${build.xalan.jar}"> |
| <arg line="targetDirectory=${build.docs} ${xdocs.book} ${xdocs.style}"/> |
| </java> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Creates the API documentation --> |
| <!-- =================================================================== --> |
| <target name="javadocs" depends="prepare.docs,autojavadocs" |
| description="Build the Javadocs for Xalan sources" > |
| <echo message="javadocs is human-usable target with dependencies"/> |
| </target> |
| |
| <target name="autojavadocs"> |
| <echo message="autojavadocs is for automated build process, without dependencies"/> |
| |
| <!-- generate trax.html, a TRaX overview document, and a package.html for each trax package |
| (the latter are generated with the the Redirect extension --> |
| <mkdir dir="${build.apidocs}/javax/xml/transform"/> |
| <java fork="yes" classname="org.apache.xalan.xslt.Process" classpath="${java.class.path}:${build.xalan.jar}"> |
| <arg line="-in ${xdocs.dir}/sources/trax/trax.xml |
| -param package-root '../../../src/' |
| -xsl ${xdocs.style}/stylesheets/spec.xsl |
| -out ${build.apidocs}/javax/xml/transform/trax.html"/> |
| </java> |
| |
| <!-- Ant 1.2 ignores destdir arg if doclet is set, so must send to doclet in doclet subelement--> |
| <javadoc |
| classpath="${java.class.path}" |
| 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 © ${year} Apache XML Project. All Rights Reserved."> |
| <doclet name="xalanjdoc.Standard" path="${bin.dir}/xalan2jdoc.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="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*"/> |
| </javadoc> |
| |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Cleans everything: build tree, site tree, style docs in --> |
| <!-- - build tree --> |
| <!-- - distribution tree --> |
| <!-- - site tree --> |
| <!-- - style docs expanded from xml-site-style.tar.gz. --> |
| <!-- (MUST update contents of ${xalanonly-styledocs} --> |
| <!-- if change contents of xml-site-style.tar.gz) --> |
| <!-- - Javadoc overview and packqage-level html docs placed --> |
| <!-- in the source tree --> |
| <!-- =================================================================== --> |
| <target name="clean" |
| description="Clean up the build" > |
| <delete dir="${build.dir}"/> |
| <delete dir="${site.root}"/> |
| <delete> |
| <fileset dir="${xdocs.style}" excludes="${xalanonly-styledocs}"/> |
| </delete> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Creates the distribution --> |
| <!-- =================================================================== --> |
| <target name="dist" depends="jar,docs,javadocs,samples,servlet,compat.jar,compat.javadocs,autodist" |
| 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 xalan jar and compability 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 todir="${dist.dir}"> |
| <fileset dir="." includes="readme.html,KEYS,License,build.xml,build.sh,build.bat,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"> |
| |
| <mkdir dir="${site.dir}/apidocs"/> |
| <mkdir dir="${site.dir}/compat_apidocs"/> |
| <mkdir dir="${site.dir}/design"/> |
| <java fork="yes" classname="${doc.generator}" classpath="${java.class.path}:${build.dir}/$xalan.jar"> |
| <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 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 the minitest from xml-xalan\test, if present --> |
| <!-- =================================================================== --> |
| <path id="minitest.class.path"> |
| <pathelement location="${xerces.jar}" /> |
| <pathelement location="${build.xalan.jar}" /> |
| <pathelement location="${bsf.jar}" /> |
| <pathelement path="${java.class.path}" /> |
| </path> |
| |
| <!-- Reference from the testing directory back to our directory, |
| used when calling testing targets to set the classpath for |
| the tests to include jars we just compiled. |
| --> |
| <property name="tests.backref" value="../../java/"/> |
| |
| <target name="minitest" depends="prepare,jar,minitest-run,tests-not-available" |
| description="Run the Minitest from xml-xalan/test/java" > |
| <!-- This target explicitly depends on the jar target, since |
| without xalan.jar the tests won't compile/run. |
| We then call the worker target minitest-run to do |
| the work of running the minitest. |
| We finally call a helper target tests-not-available |
| to notify users that they need to checkout the tests |
| explicitly from CVS - but this only runs if needed. |
| --> |
| </target> |
| <target name="minitest-run" if="tests-available" depends="prepare" > |
| <echo message=" [minitest] Calling ${tests.dir}build.xml now to run minitest.xalan2" /> |
| <ant dir="${tests.dir}" antfile="build.xml" target="minitest.xalan2" > |
| <!-- Set the below testxsl.jar.name so that it will create |
| minitest.jar instead of testxsl.jar; we only do this here |
| since this is a commonly-called developer target, and it's |
| good to differentiate this jar from the regular testing jar |
| (which has many more test classes in it). |
| --> |
| <property name="testxsl.jar.name" value="minitest.jar" /> |
| <property name="prepend.class.path" |
| value="${tests.backref}${xerces.jar}:${tests.backref}${build.xalan.jar}:${tests.backref}${bsf.jar}" /> |
| <!-- Why doesn't the following refid work? I get an error referencing it. |
| <property name="prepend.class.path" refid="minitest.class.path" /> |
| --> |
| </ant> |
| </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!" /> |
| <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> |
| |
| <!-- =================================================================== --> |
| <!-- Compiles and runs the conformance test from xml-xalan\test, if present --> |
| <!-- =================================================================== --> |
| <!-- We should have a duplicate of minitest.class.path that |
| in the future this may need to include references to dirs |
| where Java-based extension tests keep their .classes. |
| --> |
| |
| <target name="conftest" depends="prepare,jar,conftest-run,tests-not-available" |
| description="Run the ConformanceTest from xml-xalan/test/java" > |
| </target> |
| <target name="conftest-run" if="tests-available" depends="prepare" > |
| <echo message=" [conftest] Calling ${tests.dir}build.xml now to run conftest.xalan2" /> |
| <ant dir="${tests.dir}" antfile="build.xml" target="conftest.xalan2" > |
| <property name="testxsl.jar.name" value="conftest.jar" /> |
| <!-- Set name above so that it will create conftest.jar instead |
| of testxsl.jar - but, since the "ConformanceTest" depends |
| on so many testing classes, it may not be worth calling |
| this a different name from the default 'testxsl.jar'. It |
| does reduce confusion, however, for people who build and |
| run the tests directly from the testing directory, instead |
| of doing it from this directory. |
| --> |
| <property name="prepend.class.path" |
| value="${tests.backref}${xerces.jar}:${tests.backref}${build.xalan.jar}:${tests.backref}${bsf.jar}" /> |
| </ant> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Compiles and runs the smoke test from xml-xalan\test, if present --> |
| <!-- =================================================================== --> |
| <target name="smoketest" depends="prepare,jar,smoketest-run,tests-not-available" |
| description="Run the smoke test - to be defined." > |
| </target> |
| <target name="smoketest-run" if="tests-available" depends="prepare" > |
| <ant dir="${tests.dir}" antfile="build.xml" target="smoketest-xalan2" > |
| <property name="prepend.class.path" |
| value="${tests.backref}${xerces.jar}:${tests.backref}${build.xalan.jar}:${tests.backref}${bsf.jar}" /> |
| </ant> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Creates the todo list for the org.apache.xml website --> |
| <!-- =================================================================== --> |
| <target name="todo"> |
| <java fork="yes" classname="org.apache.xalan.xslt.Process" classpath="${java.class.path}:${build.dir}/$xalan.jar"> |
| <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}" classpath="${java.class.path}:${build.dir}/xalan.jar"> |
| <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="print.docs" depends="prepare.docs"> |
| <echo message="fop.jar and xml.jar must be on the classpath"/> |
| <java fork="yes" classname="org.apache.xalan.xslt.Process" |
| classpath="${java.class.path}:${build.dir}/xalan.jar"> |
| <arg line="-xsl ${xdocs.dir}/sources/xalan-collate.xsl |
| -out ${xdocs.dir}/sources/xalan/xalan-collate.xml"/> |
| </java> |
| |
| <!-- Transform collation into Formatting Objects |
| (with a little work on links along the way) --> |
| <java fork="yes" classname="org.apache.xalan.xslt.Process" |
| classpath="${java.class.path}:${build.dir}/xalan.jar"> |
| <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 --> |
| <java fork="yes" classname="org.apache.fop.apps.CommandLine" |
| classpath="${java.class.path}:${build.dir}/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" description="Compile XalanJ1 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> |
| |
| </project> |