<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one | |
or more contributor license agreements. See the NOTICE file | |
distributed with this work for additional information | |
regarding copyright ownership. The ASF licenses this file | |
to you under the Apache License, Version 2.0 (the | |
"License"); you may not use this file except in compliance | |
with the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, | |
software distributed under the License is distributed on an | |
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
KIND, either express or implied. See the License for the | |
specific language governing permissions and limitations | |
under the License. | |
--> | |
<!-- This file is <imported...> into other files, so the | |
properties it sets can be referenced there | |
--> | |
<project name="common-properties-per-build"> | |
<target name="all" depends="prepare, copy-docbook-images"> | |
<ant antfile="${docbook.tool.project}/build/process-one-book.xml"> | |
<reference refid="saxon_and_fop.classpath"/> | |
</ant> | |
</target> | |
<target name="setup-common-properties-per-build"> | |
<available property="isJava5orHigher" classname="java.util.concurrent.atomic.AtomicBoolean"/> | |
<fail message="This script requires Java level 5 or better, and won't run on earlier JVM versions" | |
unless="isJava5orHigher"/> | |
<path id="docbook.tool.project" location="${ant.file.common-properties-per-build}/../.."/> | |
<pathconvert dirsep="/" property="docbook.tool.project" refid="docbook.tool.project"/> | |
<property name="jai.version" value="1.1.3"/> | |
<!-- only this version supported in the auto download script --> | |
<!-- Load local properties --> | |
<!-- if the file is not there, it is not an error - it is just skipped --> | |
<!-- earlier files override later ones --> | |
<property file="local.docbook.properties"/> | |
<!-- load from caller project --> | |
<property file="${docbook.tool.project}/properties/default.docbook.properties"/> | |
<!-- clumsy ant if statements --> | |
<condition property="docbook.fop.extensions" value="fop.extensions"> | |
<equals arg1="0.20.5" arg2="${fop.version}"/> | |
</condition> | |
<condition property="fop.main.class" value="org.apache.fop.apps.Fop"> | |
<equals arg1="0.20.5" arg2="${fop.version}"/> | |
</condition> | |
<condition property="docbook.fop.extensions" value="fop1.extensions"> | |
<equals arg1="0.93" arg2="${fop.version}"/> | |
</condition> | |
<condition property="fop.main.class" value="org.apache.fop.cli.Main"> | |
<equals arg1="0.93" arg2="${fop.version}"/> | |
</condition> | |
<condition property="saxon.main.class" value="com.icl.saxon.StyleSheet"> | |
<equals arg1="6.5.5" arg2="${saxon.version}"/> | |
</condition> | |
<condition property="saxon.main.class" value="net.sf.saxon.Transform"> | |
<equals arg1="8.9" arg2="${saxon.version}"/> | |
</condition> | |
<!-- computed defaults --> | |
<property name="src.dir" value="${basedir}/src" /> | |
<property name="styles.dir" value="${src.dir}/styles" /> | |
<property name="docbook.src.dir" value="${src.dir}/docbook" /> | |
<property name="olink.dir" value="${src.dir}/olink" /> | |
<property name="css.dir" value="${docbook.tool.project}/styles/uima-style/css" /> | |
<property name="local.titlepage.dir" value="${styles.dir}/titlepage"/> | |
<property name="docbook.tools.lib.dir" value="${docbook.tool.project}/tools/common-lib"/> | |
<property name="docbook.ref.dir" value="${docbook.tool.project}/tools/docbook-versions"/> | |
<property name="docbook.xsl.dir" value="${docbook.ref.dir}/docbook-xsl-${docbook.xsl.version}"/> | |
<property name="docbook.xml.dir" value="${docbook.ref.dir}/docbook-xml-${docbook.xml.version}"/> | |
<property name="saxon.dir" | |
value="${docbook.tool.project}/tools/saxon-versions/saxon-${saxon.version}"/> | |
<property name="jai.dir" value="${docbook.tool.project}/tools/jai-versions/jai-${jai.version}"/> | |
<property name="fop.config" | |
value="${docbook.tool.project}/tools/fop-versions/fop-${fop.version}/fop-config.xml"/> | |
<path id="olink.dir.path" location="${olink.dir}" /> | |
<pathconvert dirsep="/" property="olink.dir.path" refid="olink.dir.path" /> | |
<property name="target.dir" value="${basedir}/target" /> | |
<!-- ======================================================================== --> | |
<!-- == == --> | |
<!-- == Set up the classpath for the XSLT conversion == --> | |
<!-- == and for running FOP == --> | |
<!-- == == --> | |
<!-- ======================================================================== --> | |
<path id="saxon_and_fop.classpath"> | |
<!-- xercesImpl.jar comes first to allow using XInclude --> | |
<pathelement location="${docbook.tools.lib.dir}/xercesImpl-2.7.1.jar"/> | |
<pathelement location="${docbook.tools.lib.dir}/xml-apis-1.3.02.jar"/> | |
<fileset dir="${docbook.tool.project}/tools/fop-versions/fop-${fop.version}" includes="*.jar"/> | |
<fileset dir="${saxon.dir}" includes="*.jar"/> | |
<fileset dir="${docbook.tools.lib.dir}" includes="*.jar"/> | |
<fileset dir="${docbook.xsl.dir}/extensions"> | |
<include name="${xslt-db.jar}"/> | |
</fileset> | |
<fileset dir="${jai.dir}" includes="*.jar"/> | |
<!-- Needed to find CatalogManager.properties --> | |
<pathelement | |
location="${docbook.tool.project}/catalog/docbook.version_${docbook.xml.version}"/> | |
</path> | |
<uptodate property="title-pdf-uptodate" srcfile="${local.titlepage.dir}/titlepage-pdf.xml" | |
targetfile="${local.titlepage.dir}/titlepage-pdf.xsl"/> | |
<uptodate property="title-html-uptodate" srcfile="${local.titlepage.dir}/titlepage-html.xml" | |
targetfile="${local.titlepage.dir}/titlepage-html.xsl"/> | |
<property name="target.dir" value="${basedir}/target"/> | |
<path id="target.dir.path" location="${target.dir}"/> | |
<pathconvert dirsep="/" property="target.dir.path" refid="target.dir.path"/> | |
<property name="tmp.dir" value="${target.dir.path}/temp"/> | |
<!-- in caller's project --> | |
</target> | |
<!-- =========================================================================== --> | |
<!-- == == --> | |
<!-- == prepare temporary directories and get components == --> | |
<!-- == == --> | |
<!-- =========================================================================== --> | |
<target name="prepare" depends="setup-common-properties-per-build, setup-availables, | |
make-temp-dir, test-saxon-available, test-docbook-available, test-jai-available"> | |
</target> | |
<target name="make-temp-dir"> | |
<mkdir dir="${tmp.dir}"/> | |
</target> | |
<target name="setup-availables"> | |
<available file="${saxon.dir}/saxon.jar" property="saxon.available"/> | |
<available file="${docbook.xml.dir}/catalog.xml" property="docbook.available"/> | |
<available file="${jai.dir}/jai_core.jar" property="jai.available"/> | |
</target> | |
<target name="test-saxon-available" unless="saxon.available"> | |
<ant antfile="${docbook.tool.project}/build/get-components.xml" target="get-saxon"/> | |
</target> | |
<target name="test-docbook-available" unless="docbook.available"> | |
<ant antfile="${docbook.tool.project}/build/get-components.xml" target="get-docbook"/> | |
</target> | |
<target name="test-jai-available" unless="jai.available"> | |
<ant antfile="${docbook.tool.project}/build/get-components.xml" target="get-jai"/> | |
</target> | |
<!-- ======================================================================== --> | |
<!-- == == --> | |
<!-- == Clean up the target directory == --> | |
<!-- == == --> | |
<!-- ======================================================================== --> | |
<target name="clean" depends="setup-common-properties-per-build" | |
description="--> Delete temporary and distribution directories for docs"> | |
<delete quiet="true" dir="${target.dir.path}"/> | |
</target> | |
<!-- ======================================================================== --> | |
<!-- == Subroutine: Copy the docbook system images == --> | |
<!-- ======================================================================== --> | |
<target name="copy-docbook-images"> | |
<copy todir="${target.dir.path}/images"> | |
<fileset dir="${docbook.xsl.dir}/images/"/> | |
</copy> | |
</target> | |
</project> |