| <?xml version="1.0"?> |
| |
| <!-- =========================================================================== |
| |
| |
| * ================= * |
| | How to build Fop | |
| * ================= * |
| |
| Adaption from the Cocoon build.xml written by Stefano Mazzocchi |
| by Giacomo Pati with some addition by Fotis Jannidis |
| |
| |
| Introduction |
| ============ |
| |
| FOP is the world's first print formatter driven by XSL formatting objects. It |
| is a Java 1.2 application that reads a formatting object tree and then turns |
| it into a PDF document. The formatting object tree, can be in the form of an |
| XML document (output by an XSLT engine like XT or Xalan) or can be passed in |
| memory as a DOM Document or (in the case of XT) SAX events. |
| |
| FOP is part of Apache's XML project. The homepage of FOP is |
| http:/xml.apache.org/fop |
| |
| HTML-Documentation can be found in the subdirectory ./docs. |
| |
| |
| Installing the build tools |
| ========================== |
| |
| The Fop build system is based on Jakarta Ant, which is a Java building tool |
| originally developed for the Jakarta Tomcat project but now used in many other |
| Apache projects and extended by many developers. |
| |
| Ant is a little but very handy tool that uses a build file written in XML |
| (this file) as building instructions. For more information refer to |
| "http://jakarta.apache.org/ant/". |
| |
| To make things easier for you, the Fop distribution contains a |
| precompiled version of Ant and the build scripts take care of all the |
| classpath issues except the following: "JAVA_HOME" environment |
| property should be set to match the JVM you want to use. That's it. |
| |
| |
| Building instructions |
| ===================== |
| |
| First, make sure your current working directory is where this very file is |
| located. Then type |
| |
| ./build.sh (unix) |
| .\build.bat (win32) |
| |
| if everything is right and all the required packages are visible, this action |
| will generate a file called "fop.jar" in the "./build" directory. Note, that |
| if you do further development, compilation time is reduced since Ant is able |
| to detect which files have changed an to recompile them at need. |
| |
| If something went wrong, go to the FAQ section below. |
| |
| Also, you'll note that reusing a single JVM instance for each task, increases |
| tremendously the performance of the whole build system, compared to other |
| tools (i.e. make or shell scripts) where a new JVM is started for each task. |
| |
| |
| |
| Build targets |
| ============= |
| |
| The build system is not only responsible of compiling Fop into a jar file, |
| but is also responsible for creating the HTML documentation, javadocs, |
| distributions and web site. In fact, the file you have here is _exactly_ what |
| is used by fop maintainers to take care of everything in the Fop |
| project, no less and no more. (only partially implemented) |
| |
| These are the meaningful targets for this build file: |
| |
| - package [default] -> creates ./build/fop.jar |
| - usage -> shows a help screen |
| - codegen -> generates needed java sources from xml resources |
| - docs -> generates the HTML documentation in ./build/docs |
| - javadocs -> generates the API documentation in ./build/javadocs |
| - dist -> generates the Fop distribution |
| - clean -> restores the distribution to its original and clean state |
| (excepting dist files) |
| - distclean -> restores the distribution to its original and clean state |
| - site -> generates the web site in ../xml-site/targets/fop (not yet impl.) |
| |
| ====================================== FAQ ===================================== |
| |
| 1) Why some of the classes present in the original jar are not built anymore? |
| |
| The fop build system is very flexible: if a module requires a package that |
| is not present in the classpath at build time, the module is skipped but |
| the built process is not stopped. |
| |
| Here is a list of such modules and what you have to download to build them: |
| |
| - Jimi |
| - JAI |
| |
| 2) I see a lot of warnings starting like this: "Warning: file modified in the future:" |
| Sometimes ant gives out this warnings, but the build is finished without any problems |
| |
| |
| ============================================================================ --> |
| |
| <project default="package" basedir="."> |
| |
| <fileset dir="${basedir}" id="dist.bin"> |
| <include name="build/site/**"/> |
| <include name="conf/**"/> |
| <include name="docs/xslfoRef.pdf"/> |
| <include name="docs/foschema/**"/> |
| <include name="examples/**"/> |
| <exclude name="examples/build.xml"/> |
| <exclude name="examples/fo/runtests.*"/> |
| <exclude name="examples/fo/results.html"/> |
| <exclude name="examples/tests/**"/> |
| <include name="CHANGES"/> |
| <include name="LICENSE"/> |
| <include name="KEYS"/> |
| <include name="README"/> |
| <include name="STATUS"/> |
| <include name="ReleaseNotes.html"/> |
| <include name="fop.bat"/> |
| <include name="fop.sh"/> |
| <include name="xalan.bat"/> |
| <include name="xalan.sh"/> |
| <exclude name="src/**"/> |
| <exclude name="dist/**"/> |
| <exclude name="lib/**"/> |
| </fileset> |
| |
| <fileset dir="${basedir}" id="dist.bin.lib"> |
| <include name="lib/xerces*.jar"/> |
| <include name="lib/xerces.LICENSE.txt"/> |
| <include name="lib/xml-apis.jar"/> |
| <include name="lib/xml-apis.README.txt"/> |
| <include name="lib/xalan*.jar"/> |
| <include name="lib/xalan.LICENSE.txt"/> |
| <include name="lib/batik.jar"/> |
| <include name="lib/batik.LICENSE.txt"/> |
| <include name="lib/avalon-framework*.jar"/> |
| <include name="lib/avalon.LICENSE.txt"/> |
| <include name="lib/readme"/> |
| </fileset> |
| |
| <fileset dir="${basedir}" id="dist.src"> |
| <exclude name="lib/jimi*"/> |
| <exclude name="lib/jai*"/> |
| <exclude name="lib/jce*"/> |
| <include name="src/**"/> |
| <include name="build/site/**"/> |
| <include name="conf/**"/> |
| <include name="build/site/**"/> |
| <include name="docs/**"/> |
| <include name="examples/**"/> |
| <include name="hyph/**"/> |
| <include name="lib/**"/> |
| <include name="CHANGES"/> |
| <include name="LICENSE"/> |
| <include name="README"/> |
| <include name="STATUS"/> |
| <include name="ReleaseNotes.html"/> |
| <include name="build*"/> |
| <include name="fop.bat"/> |
| <include name="fop.sh"/> |
| <include name="xalan.bat"/> |
| <include name="xalan.sh"/> |
| </fileset> |
| |
| <path id="libs-build-classpath"> |
| <fileset dir="lib"> |
| <include name="xalan*.jar"/> |
| <include name="xerces*.jar"/> |
| <include name="xml-apis.jar"/> |
| <include name="avalon-framework*.jar"/> |
| <include name="batik*.jar"/> |
| <include name="jimi*.jar"/> |
| <include name="jai*.jar"/> |
| <include name="jce*.jar"/> |
| </fileset> |
| </path> |
| |
| <!-- =================================================================== --> |
| <!-- Initialization target --> |
| <!-- =================================================================== --> |
| <target name="init" depends="init-avail, init-filters-jdk14, init-filters-jdk13"> |
| <tstamp/> |
| <property name="Name" value="Fop"/> |
| <property name="name" value="fop"/> |
| <property name="version" value="0.20.5"/> |
| <filter token="version" value="${version}"/> |
| <property name="year" value="1999-2003"/> |
| |
| <echo message="------------------- ${Name} ${version} [${year}] ----------------"/> |
| |
| <property name="build.compiler" value="classic"/> |
| <property name="debug" value="on"/> |
| <property name="optimize" value="off"/> |
| <property name="deprecation" value="off"/> |
| |
| <property name="textfontencoding" value="WinAnsiEncoding"/> |
| |
| <property name="src.dir" value="./src"/> |
| <property name="src.codegen" value="./src/codegen"/> |
| <property name="lib.dir" value="./lib"/> |
| <property name="hyph.dir" value="./src/hyph"/> |
| <property name="conf.dir" value="./conf"/> |
| <property name="packages" value="org.apache.fop.*"/> |
| |
| <property name="viewer.resources.src.dir" value="./src/org/apache/fop/viewer/resources"/> |
| <property name="viewer.images.src.dir" value="./src/org/apache/fop/viewer/Images"/> |
| |
| <property name="build.dir" value="./build"/> |
| <property name="build.src" value="./build/src"/> |
| <property name="build.codegen" value="./build/src/codegen"/> |
| <property name="build.dest" value="./build/classes"/> |
| <property name="build.docs" value="./build/docs"/> |
| <property name="build.javadocs" value="./build/javadocs"/> |
| |
| <property name="viewer.resources.dest.dir" value="${build.dest}/org/apache/fop/viewer/resources"/> |
| <property name="viewer.images.dest.dir" value="${build.dest}/org/apache/fop/viewer/Images"/> |
| |
| <property name="dist.bin.dir" value="./dist-bin"/> |
| <property name="dist.src.dir" value="./dist-src"/> |
| <property name="dist.bin.result.dir" value="${dist.bin.dir}/${name}-${version}"/> |
| <property name="dist.src.result.dir" value="${dist.src.dir}/${name}-${version}"/> |
| |
| <property name="properties.dir" value="org/apache/fop/fo/properties"/> |
| <property name="fonts.dir" value="org/apache/fop/render/pdf/fonts"/> |
| <property name="svg.dir" value="org/apache/fop/svg"/> |
| <property name="ignore_this" value="ignore_this.java"/> |
| <property name="jimi" value="JimiImage.java"/> |
| <property name="jai" value="JAIImage.java"/> |
| <property name="tiff" value="TiffImage.java"/> |
| |
| <property name="src.properties.xsl" value="${src.codegen}/properties.xsl"/> |
| <property name="src.propmaker.xsl" value="${src.codegen}/propmaker.xsl"/> |
| <property name="foproperties.xml" value="${build.codegen}/foproperties.xml"/> |
| <property name="colorkw.xml" value="${build.codegen}/colorkw.xml"/> |
| <property name="extproperties.xml" value="${build.codegen}/extproperties.xml"/> |
| <property name="allprops.xml" value="${build.codegen}/allprops.xml"/> |
| |
| <property name="properties.xsl" value="${build.codegen}/properties.xsl"/> |
| <property name="propmap.xsl" value="${build.codegen}/propmap.xsl"/> |
| <property name="enumgen.xsl" value="${build.codegen}/enumgen.xsl"/> |
| <property name="propinc.xsl" value="${build.codegen}/propinc.xsl"/> |
| <property name="genconst.xsl" value="${build.codegen}/genconst.xsl"/> |
| <property name="src.charlist.xsl" value="${src.codegen}/code-point-mapping.xsl"/> |
| <property name="encodings.xml" value="${build.codegen}/encodings.xml"/> |
| <property name="charlist.xsl" value="${build.codegen}/code-point-mapping.xsl"/> |
| <property name="fontfile.xsl" value="${build.codegen}/font-file.xsl"/> |
| <property name="t1fontfile.xsl" value="${build.codegen}/t1font-file.xsl"/> |
| <property name="ttffontfile.xsl" value="${build.codegen}/ttffontfile.xsl"/> |
| <property name="Courier.xml" value="${build.codegen}/Courier.xml"/> |
| <property name="Courier-Oblique.xml" value="${build.codegen}/Courier-Oblique.xml"/> |
| <property name="Courier-Bold.xml" value="${build.codegen}/Courier-Bold.xml"/> |
| <property name="Courier-BoldOblique.xml" value="${build.codegen}/Courier-BoldOblique.xml"/> |
| <property name="Helvetica.xml" value="${build.codegen}/Helvetica.xml"/> |
| <property name="Helvetica-Oblique.xml" value="${build.codegen}/Helvetica-Oblique.xml"/> |
| <property name="Helvetica-Bold.xml" value="${build.codegen}/Helvetica-Bold.xml"/> |
| <property name="Helvetica-BoldOblique.xml" value="${build.codegen}/Helvetica-BoldOblique.xml"/> |
| <property name="Times-Roman.xml" value="${build.codegen}/Times-Roman.xml"/> |
| <property name="Times-Italic.xml" value="${build.codegen}/Times-Italic.xml"/> |
| <property name="Times-Bold.xml" value="${build.codegen}/Times-Bold.xml"/> |
| <property name="Times-BoldItalic.xml" value="${build.codegen}/Times-BoldItalic.xml"/> |
| <property name="ZapfDingbats.xml" value="${build.codegen}/ZapfDingbats.xml"/> |
| <property name="Symbol.xml" value="${build.codegen}/Symbol.xml"/> |
| |
| <property name="trax" value="TraxTransform.java"/> |
| <property name="xsltransform" value="XSLTransform.java"/> |
| |
| <property name="tools.pkg" value="org/apache/fop/tools"/> |
| |
| <property name="xslfo.std" |
| value="http://www.w3.org/TR/2001/REC-xsl-20011015/xslspec.html"/> |
| <property name="xslfo.std.id" |
| value="XSL-FO 1.0"/> |
| |
| |
| <!-- insert custom font information here (step 1 of 2) --> |
| <!-- use this as a template |
| <property name="myfont.xml" value="${build.codegen}/myfont.xml"/> |
| --> |
| |
| <property name="main.class" value="org.apache.fop.apps.Fop"/> |
| <property name="runtime.classpath" value="xercesImpl-2.2.1.jar xml-apis.jar xalan-2.4.1.jar batik.jar jimi-1.0.jar avalon-framework-cvs-20020806.jar"/> |
| |
| <filter filtersfile="${build.codegen}/filter"/> |
| </target> |
| |
| <target name="init-avail"> |
| <available property="jimi.present" classname="com.sun.jimi.core.Jimi" classpathref="libs-build-classpath"/> |
| <available property="jai.present" classname="javax.media.jai.JAI" classpathref="libs-build-classpath"/> |
| <available property="trax.present" classname="javax.xml.transform.Transformer" classpathref="libs-build-classpath"/> |
| <available property="jdk14.present" classname="java.lang.CharSequence"/> |
| <available property="jce.present" classname="javax.crypto.Cipher" classpathref="libs-build-classpath"/> |
| </target> |
| |
| <target name="init-filters-jdk13" depends="init-avail" unless="jdk14.present"> |
| <echo message="JDK 1.3 or earlier present."/> |
| <copy file="src/codegen/jdk13.filter" toFile="build/src/codegen/filter"/> |
| </target> |
| |
| <target name="init-filters-jdk14" depends="init-avail" if="jdk14.present"> |
| <echo message="JDK 1.4 present."/> |
| <copy file="src/codegen/jdk14.filter" toFile="build/src/codegen/filter"/> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Help on usage --> |
| <!-- =================================================================== --> |
| <target name="usage"> |
| <echo message="Use the -projecthelp option instead"/> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Prepares the build directory --> |
| <!-- =================================================================== --> |
| <target name="prepare" depends="init"> |
| <!-- create directories --> |
| <echo message="Preparing the build directories"/> |
| <mkdir dir="${build.dir}"/> |
| <mkdir dir="${build.src}"/> |
| <mkdir dir="${build.src}/${properties.dir}"/> |
| <mkdir dir="${build.src}/${fonts.dir}"/> |
| <mkdir dir="${build.src}/${svg.dir}"/> |
| <mkdir dir="${build.dest}/conf"/> |
| <mkdir dir="${build.dest}/hyph"/> |
| <copy todir="${build.dest}/conf" filtering="yes"> |
| <fileset dir="./conf"/> |
| </copy> |
| </target> |
| |
| |
| <!-- =================================================================== --> |
| <!-- copies special image class only if Jimi library is present --> |
| <!-- =================================================================== --> |
| <target name="prepare-jimi" depends="prepare" if="jimi.present"> |
| <echo message="Jimi library is present. Installing Jimi support."/> |
| <copy todir="${build.src}"> |
| <fileset dir="${src.dir}" includes="**/${jimi}"/> |
| </copy> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- copies special image class only if JAI library is present --> |
| <!-- =================================================================== --> |
| <target name="prepare-jai" depends="prepare" if="jai.present"> |
| <echo message="JAI library is present. Installing JAI support."/> |
| <copy todir="${build.src}"> |
| <fileset dir="${src.dir}" includes="**/${jai}"/> |
| <fileset dir="${src.dir}" includes="**/${tiff}"/> |
| </copy> |
| </target> |
| |
| <target name="prepare-trax" if="trax.present"> |
| <echo message="JAXP1.1 transforms is present. Installing TRaX support"/> |
| <copy todir="${build.src}"> |
| <fileset dir="${src.dir}" includes="**/${xsltransform},**/${trax},**/apps/TraxInputHandler.java"/> |
| </copy> |
| </target> |
| |
| <target name="prepare-jce" depends="prepare" if="jce.present"> |
| <echo message="JCE is present. Installing PDF encryption support."/> |
| <copy todir="build/src"> |
| <fileset dir="src/java-1.4"/> |
| </copy> |
| </target> |
| |
| <target name="prepare-jce-stub" depends="prepare" unless="jce.present"> |
| <echo message="JCE not present. Installing stub."/> |
| <copy todir="build/src"> |
| <fileset dir="src/java-1.3"/> |
| </copy> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Prepares the source code --> |
| <!-- =================================================================== --> |
| <target name="prepare-src" depends="prepare, prepare-jimi, prepare-jai, prepare-trax, prepare-jce, prepare-jce-stub"> |
| <!-- copy src files --> |
| <copy todir="${build.src}" filtering="yes"> |
| <fileset dir="${src.dir}" |
| includes="**/*.java,*.html" |
| excludes="java-*/**,**/${jimi},**/${jai},**/${tiff},**/${xsltransform},**/${trax},**/apps/TraxInputHandler.java"/> |
| <filterset> |
| <filter token="XSLFO-STD" value="${xslfo.std}"/> |
| <filter token="XSLFO-STDID" value="${xslfo.std.id}"/> |
| </filterset> |
| </copy> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Generate the source code --> |
| <!-- =================================================================== --> |
| <target name="codegen" depends="prepare" description="Generates the java files from the xml resources"> |
| <!-- resetting codegen directory --> |
| <echo message="Resetting codegen directory"/> |
| |
| <!-- copy codegen directory --> |
| <copy todir="${build.codegen}" filtering="yes"> |
| <fileset dir="${src.codegen}"/> |
| </copy> |
| |
| <!-- generate the java files from xml resources --> |
| <echo message="Generating the java files from xml resources"/> |
| |
| <dependset> |
| <srcfilelist dir="./" files="${foproperties.xml},${colorkw.xml}"/> |
| <targetfilelist dir="./" files="${build.src}/org/apache/fop/fo/properties/Constants.java,${build.src}/fo_${ignore_this}"/> |
| </dependset> |
| <dependset> |
| <srcfilelist dir="./" files="${propinc.xsl}"/> |
| <targetfilelist dir="./" files="${build.src}/fo_${ignore_this},${build.src}/org/apache/fop/fo/properties/FOPropertyMapping.java,${build.src}/foenums_${ignore_this}"/> |
| </dependset> |
| |
| <dependset> |
| <srcfilelist dir="./" files="${encodings.xml},${charlist.xsl},${fontfile.xsl}, |
| ${Courier.xml},${Courier-Oblique.xml},${Courier-Bold.xml}, |
| ${Courier-BoldOblique.xml}, |
| ${Helvetica.xml},${Helvetica-Bold.xml},${Helvetica-Oblique.xml}, |
| ${Helvetica-BoldOblique.xml}, |
| ${Times-Roman.xml},${Times-Italic.xml},${Times-Bold.xml}, |
| ${Times-BoldItalic.xml}, |
| ${Symbol.xml},${ZapfDingbats.xml}"/> |
| <targetfilelist dir="./" files="${build.src}/org/apache/fop/render/pdf/fonts/Courier*, |
| ${build.src}/org/apache/fop/render/pdf/fonts/Times*, |
| ${build.src}/org/apache/fop/render/pdf/fonts/Helvetica*, |
| ${build.src}/org/apache/fop/render/pdf/fonts/Symbol*, |
| ${build.src}/org/apache/fop/render/pdf/fonts/ZapfDingbats*"/> |
| </dependset> |
| |
| <style in="${allprops.xml}" style="${genconst.xsl}" |
| out="${build.src}/${properties.dir}/Constants.java"/> |
| <style in="${foproperties.xml}" style="${properties.xsl}" |
| out="${build.src}/fo_${ignore_this}"> |
| <param name="reldir" expression="${properties.dir}"/> |
| </style> |
| <style in="${foproperties.xml}" style="${propmap.xsl}" |
| out="${build.src}/${properties.dir}/FOPropertyMapping.java"/> |
| <style in="${foproperties.xml}" style="${enumgen.xsl}" |
| out="${build.src}/foenums_${ignore_this}"> |
| <param name="reldir" expression="${properties.dir}"/> |
| </style> |
| <style in="${extproperties.xml}" style="${propmap.xsl}" |
| out="${build.src}/${properties.dir}/ExtensionPropertyMapping.java"/> |
| <style in="${encodings.xml}" style="${charlist.xsl}" |
| out="${build.src}/org/apache/fop/render/pdf/CodePointMapping.java"/> |
| |
| <style |
| in="${Courier.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/Courier.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Courier-Oblique.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/CourierOblique.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Courier-Bold.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/CourierBold.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Courier-BoldOblique.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/CourierBoldOblique.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Helvetica.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/Helvetica.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Helvetica-Bold.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/HelveticaBold.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Helvetica-Oblique.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/HelveticaOblique.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Helvetica-BoldOblique.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/HelveticaBoldOblique.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Times-Roman.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/TimesRoman.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Times-Italic.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/TimesItalic.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Times-Bold.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/TimesBold.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Times-BoldItalic.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/TimesBoldItalic.java"> |
| <param name="encoding" expression="${textfontencoding}"/> |
| </style> |
| <style |
| in="${Symbol.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/Symbol.java"/> |
| <style |
| in="${ZapfDingbats.xml}" style="${fontfile.xsl}" |
| out="${build.src}/${fonts.dir}/ZapfDingbats.java"/> |
| |
| <!-- custom fonts (Use t1fontfile.xsl instead of fontfile.xsl for Type 1 fonts!) step 2/2 --> |
| <!-- use this as a template for type 1 fonts: |
| <xslt infile="${myfont.xml}" xsltfile="${t1fontfile.xsl}" |
| outfile="${build.src}/${fonts.dir}/myfont.java" smart="yes"/> |
| --> |
| <!-- use this as a template for truetype fonts |
| <xslt infile="${myfont.xml}" xsltfile="${ttffontfile.xsl}" |
| outfile="${build.src}/${fonts.dir}/myfont.java" smart="yes"/> |
| --> |
| |
| |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Compiles the source directory --> |
| <!-- =================================================================== --> |
| <target name="compile" depends="codegen, prepare-src"> |
| <echo message="Compiling the sources "/> |
| <!-- create directories --> |
| <mkdir dir="${build.dest}"/> |
| |
| <mkdir dir="${viewer.resources.dest.dir}"/> |
| <copy todir="${viewer.resources.dest.dir}"> |
| <fileset dir="${viewer.resources.src.dir}"/> |
| </copy> |
| <mkdir dir="${viewer.images.dest.dir}"/> |
| <copy todir="${viewer.images.dest.dir}"> |
| <fileset dir="${viewer.images.src.dir}"/> |
| </copy> |
| |
| <javac srcdir="${build.src}" |
| destdir="${build.dest}" |
| debug="${debug}" |
| deprecation="${deprecation}" |
| optimize="${optimize}" |
| excludes="**/*${ignore_this},${jimi}"> |
| <classpath refid="libs-build-classpath"/> |
| </javac> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- compiles hyphenation patterns --> |
| <!-- =================================================================== --> |
| |
| <target name="hyphenation" depends="compile" > |
| <path id="hyph-classpath"> |
| <path refid="libs-build-classpath"/> |
| <pathelement location="${build.dir}/classes"/> |
| </path> |
| <taskdef name="serHyph" classname="org.apache.fop.tools.anttasks.SerializeHyphPattern" classpathref="hyph-classpath"/> |
| <serHyph includes="*.xml" |
| sourceDir="${hyph.dir}" |
| targetDir="${build.dest}/hyph" /> |
| </target> |
| |
| |
| <!-- =================================================================== --> |
| <!-- Creates the class package --> |
| <!-- =================================================================== --> |
| <target name="package" depends="compile,hyphenation" description="Generates the jar files (default target)"> |
| <echo message="Creating the jar file ${build.dir}/${name}.jar"/> |
| |
| <tstamp> |
| <format property="ts" pattern="yyyyMMdd-HHmmss-z"/> |
| </tstamp> |
| <jar jarfile="${build.dir}/${name}.jar" |
| basedir="${build.dest}" |
| includes="org/**,conf/**,hyph/**"> |
| <manifest> |
| <attribute name="Main-Class" value="${main.class}"/> |
| <attribute name="Class-Path" value="${runtime.classpath}"/> |
| <attribute name="Implementation-Title" value="${Name}"/> |
| <attribute name="Implementation-Version" value="${version}"/> |
| <attribute name="Implementation-Vendor" value="Apache Software Foundation (http://xml.apache.org/fop/)"/> |
| <attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}])"/> |
| </manifest> |
| </jar> |
| |
| </target> |
| |
| <target name="test" depends="package" description="Runs the test suite"> |
| <echo message="Testing build in jar file ${build.dir}/${name}.jar against reference"/> |
| <path id="testtask-classpath"> |
| <path refid="libs-build-classpath"/> |
| <pathelement location="${build.dir}/classes"/> |
| </path> |
| <taskdef name="runTest" classname="org.apache.fop.tools.anttasks.RunTest" classpathref="testtask-classpath"/> |
| <runTest testSuite="basictests.xml" basedir="test/" reference="test/reference/fop.jar" |
| refVersion="FOP 0.20.4"/> |
| <runTest testSuite="bugtests.xml" basedir="test/" reference="test/reference/fop.jar" |
| refVersion="FOP 0.20.4"/> |
| <!-- |
| <runTest testSuite="testsuite.xml" basedir="TestSuite/NIST/" reference="test/reference/fop.jar" |
| refVersion="FOP 0.19.0-CVS"/> |
| <runTest testSuite="testsuite.xml" basedir="TestSuite/contrib/IBM/" reference="test/reference/fop.jar" |
| refVersion="FOP 0.19.0-CVS"/> |
| <runTest testSuite="testsuite.xml" basedir="TestSuite/contrib/FOP/" reference="test/reference/fop.jar" |
| refVersion="FOP 0.19.0-CVS"/> |
| <runTest testSuite="testsuite.xml" basedir="TestSuite/contrib/XEP/" reference="test/reference/fop.jar" |
| refVersion="FOP 0.19.0-CVS"/> |
| <runTest testSuite="testsuite.xml" basedir="TestSuite/contrib/XSLFormatter/" reference="test/reference/fop.jar" |
| refVersion="FOP 0.19.0-CVS"/> |
| --> |
| </target> |
| |
| <target name="all" depends="package"/> <!-- "all" target for us Makefile converts ;-) --> |
| |
| <!-- =================================================================== --> |
| <!-- Prepares the docs --> |
| <!-- =================================================================== --> |
| <target name="prepare-docs" depends="init"> |
| <mkdir dir="${build.docs}"/> |
| </target> |
| |
| |
| <!-- =================================================================== --> |
| <!-- Creates the API documentation --> |
| <!-- =================================================================== --> |
| <target name="javadocs" depends="codegen,prepare-src" description="Generates javadocs"> |
| <echo message="Producing the javadoc files "/> |
| <mkdir dir="${build.javadocs}"/> |
| <javadoc packagenames="${packages}" |
| sourcepath="${build.src}" |
| destdir="${build.javadocs}" |
| author="true" |
| version="true" |
| windowtitle="${Name} API" |
| doctitle="${Name}" |
| bottom="Copyright © ${year} Apache Software Foundation. All Rights Reserved." |
| overview="${build.src}/overview.html" |
| use="true" |
| failonerror="true"> |
| <group title="Control and Startup"> |
| <package name="org.apache.fop.apps"/> |
| <package name="org.apache.fop.configuration"/> |
| <package name="org.apache.fop.messaging"/> |
| </group> |
| <group title="XSL-FO Document (Input)"> |
| <package name="org.apache.fop.fo"/> |
| <package name="org.apache.fop.fo.*"/> |
| <package name="org.apache.fop.datatypes"/> |
| </group> |
| <group title="Area Tree Document (Intermediate)"> |
| <package name="org.apache.fop.layout"/> |
| <package name="org.apache.fop.layout.*"/> |
| </group> |
| <group title="Rendered Document (Output)"> |
| <package name="org.apache.fop.render"/> |
| <package name="org.apache.fop.render.*"/> |
| <package name="org.apache.fop.viewer"/> |
| </group> |
| <group title="Utility"> |
| <package name="org.apache.fop.pdf"/> |
| <package name="org.apache.fop.mif"/> |
| <package name="org.apache.fop.tools"/> |
| <package name="org.apache.fop.tools.*"/> |
| <package name="org.apache.fop.svg"/> |
| <package name="org.apache.fop.image"/> |
| <package name="org.apache.fop.image.*"/> |
| <package name="org.apache.fop.fonts"/> |
| <package name="org.apache.fop.fonts.*"/> |
| </group> |
| <classpath refid="libs-build-classpath"/> |
| <classpath> |
| <fileset dir="${lib.dir}"> |
| <include name="ant*.jar"/> |
| </fileset> |
| </classpath> |
| </javadoc> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Creates the documentation --> |
| <!-- =================================================================== --> |
| <target name="docs" depends="prepare" description="Generates documentation"> |
| <echo message="Building documentation with Forrest..."/> |
| <echo message="Make sure you have a propper Forrest installation (see http://xml.apache.org/forrest)"/> |
| <exec executable="forrest"> |
| </exec> |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Creates the distribution --> |
| <!-- =================================================================== --> |
| <target name="dist" depends="dist-src,dist-bin" description="Generates the distribution package"/> |
| |
| <target name="dist-bin" depends="package, docs"> |
| <echo message="Building the binary distribution files (zip,tar)"/> |
| <mkdir dir="${dist.bin.result.dir}"/> |
| <copy todir="${dist.bin.result.dir}"> |
| <fileset refid="dist.bin"/> |
| <fileset refid="dist.bin.lib"/> |
| </copy> |
| <mkdir dir="${dist.bin.result.dir}/build"/> |
| <copy todir="${dist.bin.result.dir}/build" file="build/fop.jar"/> |
| <chmod file="${dist.bin.result.dir}/fop.sh" perm="ugo+rx" /> |
| |
| <zip zipfile="${name}-${version}-bin.zip" basedir="${dist.bin.dir}" includes="**"/> |
| |
| <tar destfile="${name}-${version}-bin.tar.gz" compression="gzip"> |
| <tarfileset dir="${dist.bin.dir}" mode="755"> |
| <include name="**/*.sh"/> |
| </tarfileset> |
| <tarfileset dir="${dist.bin.dir}"> |
| <exclude name="**/*.sh"/> |
| </tarfileset> |
| </tar> |
| </target> |
| |
| <target name="dist-src" depends="package, docs"> |
| <echo message="Building the source distribution files (zip,tar)"/> |
| <mkdir dir="${dist.src.result.dir}"/> |
| <copy todir="${dist.src.result.dir}"> |
| <fileset refid="dist.src"/> |
| </copy> |
| |
| <mkdir dir="${dist.src.result.dir}/build"/> |
| <copy todir="${dist.src.result.dir}/build" file="build/fop.jar"/> |
| <chmod file="${dist.src.result.dir}/build.sh" perm="ugo+rx" /> |
| <chmod file="${dist.src.result.dir}/fop.sh" perm="ugo+rx" /> |
| <chmod file="${dist.src.result.dir}/examples/fo/runtests.sh" perm="ugo+rx" /> |
| |
| <zip zipfile="${name}-${version}-src.zip" basedir="${dist.src.dir}" includes="**"/> |
| |
| <tar destfile="${name}-${version}-src.tar.gz" compression="gzip"> |
| <tarfileset dir="${dist.src.dir}" mode="755"> |
| <include name="**/*.sh"/> |
| </tarfileset> |
| <tarfileset dir="${dist.src.dir}"> |
| <exclude name="**/*.sh"/> |
| </tarfileset> |
| </tar> |
| |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Optional targets for Eclipse --> |
| <!-- =================================================================== --> |
| <target name="src-jar" depends="prepare-src" description="Generates a source zip for Eclipse"> |
| <jar jarfile="${build.dir}/${name}-src.jar"> |
| <fileset dir="${build.src}"> |
| <include name="**/*.java"/> |
| </fileset> |
| </jar> |
| |
| </target> |
| |
| <!-- =================================================================== --> |
| <!-- Clean targets --> |
| <!-- =================================================================== --> |
| <target name="clean" depends="init" description="Cleans the build directory"> |
| <delete dir="${build.dir}"/> |
| </target> |
| |
| <target name="distclean" depends="clean" description="Cleans the distribution target directories"> |
| <delete dir="${dist.src.dir}"/> |
| <delete dir="${dist.bin.dir}"/> |
| <delete> |
| <fileset dir="${basedir}" includes="${name}-*.tar.gz"/> |
| <fileset dir="${basedir}" includes="${name}-*.zip"/> |
| </delete> |
| </target> |
| <!-- =================================================================== --> |
| <!-- Special target for Gump --> |
| <!-- =================================================================== --> |
| <target name="gump" depends="all, javadocs"/> |
| |
| </project> |
| |