Return-Path: X-Original-To: apmail-xmlgraphics-fop-commits-archive@www.apache.org Delivered-To: apmail-xmlgraphics-fop-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C96737FA4 for ; Mon, 29 Aug 2011 19:26:39 +0000 (UTC) Received: (qmail 25258 invoked by uid 500); 29 Aug 2011 19:26:39 -0000 Delivered-To: apmail-xmlgraphics-fop-commits-archive@xmlgraphics.apache.org Received: (qmail 25209 invoked by uid 500); 29 Aug 2011 19:26:39 -0000 Mailing-List: contact fop-commits-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: fop-dev@xmlgraphics.apache.org Delivered-To: mailing list fop-commits@xmlgraphics.apache.org Received: (qmail 25202 invoked by uid 99); 29 Aug 2011 19:26:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Aug 2011 19:26:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.131] (HELO eos.apache.org) (140.211.11.131) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Aug 2011 19:26:37 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 0CBF5E9A for ; Mon, 29 Aug 2011 19:26:17 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Mon, 29 Aug 2011 19:26:17 -0000 Message-ID: <20110829192617.607.81462@eos.apache.org> Subject: =?utf-8?q?=5BXmlgraphics-fop_Wiki=5D_Update_of_=22HowTo/BuildFOPAlternati?= =?utf-8?q?vely=22_by_SimonPepping?= Auto-Submitted: auto-generated Dear Wiki user, You have subscribed to a wiki page or wiki category on "Xmlgraphics-fop Wik= i" for change notification. The "HowTo/BuildFOPAlternatively" page has been changed by SimonPepping: http://wiki.apache.org/xmlgraphics-fop/HowTo/BuildFOPAlternatively Comment: Document building FOP using libraries in the system New page: =3D HowTo build FOP alternatively =3D This page is meant for distribution builders who want to build FOP using th= e java libraries in the system instead of the java libraries in FOP's `lib`= and `lib/build` directories. =3D=3D Libraries =3D=3D The jar files in FOP's `lib` directory are both build-time and run-time dep= endencies. The jar files in FOP's `lib/build` directory are build-time depe= ndencies. Most of those are used in special tasks. Only the `qdox` library = is used in building fop.jar. =3D=3D With ant =3D=3D 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. =3D=3D=3D Using the CLASSPATH variable =3D=3D=3D Most efforts to build FOP using libraries in the system set the `CLASSPATH`= variable for the invocation of `ant`. Example: {{{ CLASSPATH=3D:$JAVA_SHARE/avalon-framework.jar:$JAVA_SHARE/batik-all.jar:... export CLASSPATH ant package }}} This works generally, but the `qdox` library is an exception. When the `qdo= x` library is inserted in the class path in this way, it causes a `NullPoin= terException`, and the build fails. When this `NPE` is avoided by patching = the relevant piece of code, the resulting jar file will lack many files cal= led `event-model.xml`. The workaround is to copy the system's `qdox` librar= y into FOP's `lib/build` directory. =3D=3D=3D Patching the build script =3D=3D=3D FOP's build script defines its class paths in three path variables at the s= tart of the build script: `libs-build-classpath`, `libs-tools-build-classpa= th`, `libs-run-classpath`. These paths can be patched to refer to the requi= red libraries in the system. The following is a working example on a Debian= system: {{{ }}} Here may libraries in the `lib/build` directory were commented out, since t= hey are not needed for building the package. =3D HowTo test the newly built fop.jar file =3D FOP's layoutengine junit tests can be used to test the newly built `fop.jar= ` file. The following bash script gives an example: {{{ FOP_SOURCE=3D/source/xml-fop-stable JAVA_SHARE=3D/usr/share/java FOP_JAR=3D$JAVA_SHARE/fop.jar JAVA_CP=3D"$FOP_SOURCE/build/test-classes:$FOP_JAR:$JAVA_SHARE/junit.jar:$J= AVA_SHARE/xmlunit.jar:$JAVA_SHARE/avalon-framework.jar:$JAVA_SHARE/batik-al= l.jar:$JAVA_SHARE/commons-io.jar:$JAVA_SHARE/commons-logging.jar:$JAVA_SHAR= E/serializer.jar:$JAVA_SHARE/servlet-api.jar:$JAVA_SHARE/xalan2.jar:$JAVA_S= HARE/xercesImpl.jar:$JAVA_SHARE/xml-apis.jar:$JAVA_SHARE/xml-apis-ext.jar:$= JAVA_SHARE/xmlgraphics-commons.jar" TESTRUNNER=3Djunit.textui.TestRunner FOP_TEST_SET=3Dstandard FOP_DISABLED=3D$FOP_SOURCE/test/layoutengine/disabled-testcases.xml TESTCLASS=3Dorg.apache.fop.layoutengine.LayoutEngineTestSuite cd $FOP_SOURCE ant junit-compile echo java -Dfop.layoutengine.testset=3D$FOP_TEST_SET -Dfop.layoutengine.dis= abled=3D$FOP_DISABLED -classpath $JAVA_CP $TESTRUNNER $TESTCLASS java -Dfop.layoutengine.testset=3D$FOP_TEST_SET -Dfop.layoutengine.disabled= =3D$FOP_DISABLED -classpath $JAVA_CP $TESTRUNNER $TESTCLASS 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 libr= aries in the system. Note that these tests only test FOP's layout engine. T= hey do not test FOP's backends, which write the laid-out pages to PDF, !Pos= tScript, etc. --------------------------------------------------------------------- To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org