Find file
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (98 sloc) 4.96 KB
<?xml version="1.0" encoding="UTF-8"?>
<!-- build file for phing -->
<project default="help" basedir=".">
<!-- Human-readable info about our component -->
<property file="" />
<property name="project.version" value="${project.majorVersion}.${project.minorVersion}.${project.patchLevel}" />
<!-- Paths to the directories that we work with -->
<property name="project.srcdir" value="${project.basedir}/src" override="true" />
<property name="project.toolsdir" value="${project.basedir}/tools" override="true" />
<property name="project.builddir" value="${project.basedir}/build" override="true" />
<property name="project.distdir" value="${project.basedir}/dist" override="true" />
<!-- Tell the user what this build file supports -->
<target name="help">
<echo message="${} ${project.version}: build.xml targets:" />
<echo message="" />
<echo message="lint" />
<echo message=" Run the validation tools to catch Docbook errors" />
<echo message="compile" />
<echo message=" Turn the Docbook sources into the publishable books" />
<echo message="clean" />
<echo message=" Remove all temporary folders created by this build file" />
<!-- Test the Docbook sources for validation errors -->
<target name="lint">
<!-- START: lint-loop -->
<phingcall target="lint-src">
<property name="lint.edition" value="1.0-en" />
<!-- END: lint-loop -->
<target name="lint-src">
<property name="lint.srcdir" value="${project.srcdir}/${lint.edition}" />
<foreach param="xmlfile" absparam="absxmlfile" target="lint-xml">
<fileset dir="${lint.srcdir}">
<include name="*.xml"/>
<!-- Check for XML errors -->
<target name="lint-xml">
<exec command="xmllint --noout ${absxmlfile}" checkreturn="true" logoutput="true" />
<!-- Compile the Docbook into the published formats -->
<target name="compile">
<delete dir="${project.builddir}"/>
<mkdir dir="${project.builddir}"/>
<delete dir="${project.distdir}"/>
<mkdir dir="${project.distdir}"/>
<!-- START: compile-loop -->
<phingcall target="compile-src">
<property name="compile.edition" value="1.0-en" />
<property name="compile.lang" value="en" />
<!-- END: compile-loop -->
<!-- Compile a single version, single language of Docbook sources -->
<target name="compile-src">
<property name="compile.srcdir" value="${project.srcdir}/${compile.edition}" />
<property name="compile.builddir" value="${project.builddir}/${compile.edition}" />
<property name="compile.distdir" value="${project.distdir}/${compile.edition}" />
<delete dir="${compile.builddir}" />
<mkdir dir="${compile.builddir}" />
<delete dir="${compile.distdir}" />
<mkdir dir="${compile.distdir}" />
<mkdir dir="figures" />
<copy todir="figures">
<fileset dir="${compile.srcdir}/figures">
<include name="*.png" />
<copy file="${project.toolsdir}/docbook.css" todir="${compile.distdir}" />
<!-- Create the HTML version of the docs -->
<exec command="xsltproc --stringparam base.dir ${compile.distdir}/ --stringparam l10n.gentext.language ${compile.lang} ${project.toolsdir}/html-chunked.xsl ${compile.srcdir}/book.xml" logoutput="true" />
<exec command="${project.toolsdir}/scripts/highlight.php ${compile.distdir}/" />
<exec command="${project.toolsdir}/scripts/webify.php ${compile.distdir} ${compile.edition}" logoutput="true" />
<!-- Create the PDF version of the docs -->
<exec command="xsltproc --stringparam fop1.extensions 1 --stringparam l10n.gentext.language ${compile.lang} --output ${compile.builddir}/${} ${project.toolsdir}/fo.xsl ${compile.srcdir}/book.xml" logoutput="true" />
<exec command="${project.toolsdir}/scripts/HighlightPDF.php ${compile.builddir}/${}" logoutput="true" />
<exec command="${project.toolsdir}/fop/fop -fo ${compile.builddir}/${} -pdf ${compile.distdir}/${}-book-${compile.edition}.pdf" logoutput="true" />
<!-- Create the EPUB version of the docs -->
<exec command="${project.toolsdir}/docbook-xsl/epub/bin/dbtoepub -o ${compile.distdir}/${}-book-${compile.edition}.epub ${compile.srcdir}/book.xml" logoutput="true" />
<!-- Tidy up after ourselves -->
<delete file="${compile.builddir}/${}"/>
<move file="figures" todir="${compile.distdir}" />
<!-- Install a copy of the website locally for testing -->
<target name="install.local" depends="compile">
<copy todir="${prefix}">
<fileset refid="srcfiles" />
<!-- Clean up our mess -->
<target name="clean">
<delete dir="${project.builddir}" />
<delete dir="${project.distdir}" />
<!-- vim: set tabstop=2 shiftwidth=2 expandtab: -->