xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Xmlgraphics-fop Wiki] Update of "HowTo/BuildFOPAlternatively" by SimonPepping
Date Mon, 29 Aug 2011 19:26:17 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wiki" for change notification.

The "HowTo/BuildFOPAlternatively" page has been changed by SimonPepping:

Document building FOP using libraries in the system

New page:
= HowTo build FOP alternatively =
This page is meant for distribution builders who want to build FOP using the java libraries
in the system instead of the java libraries in FOP's `lib` and `lib/build` directories.

== Libraries ==
The jar files in FOP's `lib` directory are both build-time and run-time dependencies. The
jar files in FOP's `lib/build` directory are build-time dependencies. Most of those are used
in special tasks. Only the `qdox` library is used in building fop.jar.

== With ant ==
FOP's build system is based on `ant`. Due to the complexity of FOP's build process, it is
advisable to use `ant` and FOP's ant build script in some or other way.

=== Using the CLASSPATH variable ===
Most efforts to build FOP using libraries in the system set the `CLASSPATH` variable for the
invocation of `ant`. Example:

ant package

This works generally, but the `qdox` library is an exception. When the `qdox` library is inserted
in the class path in this way, it causes a `NullPointerException`, and the build fails. When
this `NPE` is avoided by patching the relevant piece of code, the resulting jar file will
lack many files called `event-model.xml`. The workaround is to copy the system's `qdox` library
into FOP's `lib/build` directory.

=== Patching the build script ===
FOP's build script defines its class paths in three path variables at the start of the build
script: `libs-build-classpath`, `libs-tools-build-classpath`, `libs-run-classpath`. These
paths can be patched to refer to the required libraries in the system. The following is a
working example on a Debian system:

 <property name="java-share" value="/usr/share/java"/>
 <path id="libs-build-classpath">
   <pathelement location="${java-share}/avalon-framework.jar"/>
   <pathelement location="${java-share}/batik-all.jar"/>
   <pathelement location="${java-share}/commons-io.jar"/>
   <pathelement location="${java-share}/commons-logging.jar"/>
   <pathelement location="${java-share}/serializer.jar"/>
   <pathelement location="${java-share}/servlet-api.jar"/>
   <pathelement location="${java-share}/xalan2.jar"/>
   <pathelement location="${java-share}/xercesImpl.jar"/>
   <pathelement location="${java-share}/xml-apis.jar"/>
   <pathelement location="${java-share}/xml-apis-ext.jar"/>
   <pathelement location="${java-share}/xmlgraphics-commons.jar"/>
 <property name="lib-tools" value="${basedir}/lib/build"/>
 <path id="libs-tools-build-classpath">
   <path refid="libs-build-classpath"/>
   <!-- <pathelement location="${lib-tools}/asm-3.1.jar.jar"/> -->
   <!-- <pathelement location="${lib-tools}/asm-commons-3.1.jar"/> -->
   <!-- <pathelement location="${lib-tools}/backport-util-concurrent-3.1.jar"/> -->
   <!-- <pathelement location="${lib-tools}/jaxen-1.1.1.jar"/> -->
   <!-- <pathelement location="${lib-tools}/pmd-4.2.5.jar"/> -->
   <pathelement location="${java-share}/qdox.jar"/>
   <!-- <pathelement location="${lib-tools}/retroweaver-2.0.6-patched.jar"/> -->
   <!-- <pathelement location="${lib-tools}/retroweaver-rt-2.0.6-patched.jar"/> -->
   <!-- <pathelement location="${lib-tools}/xmlunit.jar"/> -->
 <path id="libs-run-classpath">
   <path refid="libs-build-classpath"/>
   <pathelement location="${java-share}/fop.jar"/>

Here may libraries in the `lib/build` directory were commented out, since they are not needed
for building the package.

= HowTo test the newly built fop.jar file =
FOP's layoutengine junit tests can be used to test the newly built `fop.jar` file. The following
bash script gives an example:



ant junit-compile
echo java -Dfop.layoutengine.testset=$FOP_TEST_SET -Dfop.layoutengine.disabled=$FOP_DISABLED
java -Dfop.layoutengine.testset=$FOP_TEST_SET -Dfop.layoutengine.disabled=$FOP_DISABLED -classpath
echo Tested $FOP_JAR, test suite $TESTCLASS

These tests compile and use the test classes in FOP's source directory, and use  the newly
built `fop.jar` file in the `FOP_JAR` variable and the libraries in the system. Note that
these tests only test FOP's layout engine. They do not test FOP's backends, which write the
laid-out pages to PDF, !PostScript, etc.

To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org

View raw message