| <?xml version="1.0" encoding="UTF-8"?> | |
| <!-- ====================================================================== | |
| Jan 13, 2008 10:38:52 AM | |
| DocumentPublisher | |
| This takes a docbook document and publishes it in HTML and PDF formats | |
| dcarver | |
| ====================================================================== --> | |
| <project name="DIGPublisher" default="Publish"> | |
| <description> | |
| This publishes the DIG document in HTML and PDF formats | |
| </description> | |
| <!-- Set file URL --> | |
| <condition property="star.fileurl" value="file:///" else="file://"> | |
| <and> | |
| <not> | |
| <os family="unix" /> | |
| </not> | |
| </and> | |
| </condition> | |
| <!-- set global properties for this build --> | |
| <property name="luntbuild" value="false" /> | |
| <!-- Search and Replace variables --> | |
| <property name="star.currentlocation" location="" /> | |
| <property name="workspace" location=".." /> | |
| <property name="star.parsers.xerces" value="org.apache.xerces.parsers.SAXParser" /> | |
| <property name="commonutilities" value="${workspace}/DocBookXSL" /> | |
| <property name="docbookhtmldir" value="${commonutilities}/starhtml" /> | |
| <property name="docbookpdfdir" value="${commonutilities}/starfo" /> | |
| <property name="docbookrtdir" value="${commonutilities}/roundtrip"/> | |
| <property name="docbookfodir" value="${commonutilities}/starfo" /> | |
| <property name="fo-converterdir" value="${workspace}/fo-converter"/> | |
| <property name="chunk-html" value="chunk.xsl" /> | |
| <property name="default-docbook" value="docbook.xsl" /> | |
| <property name="outputdir" value="${star.currentlocation}/Output" /> | |
| <property name="inputfile" value="${star.currentlocation}/DIGMasterDocument.xml" /> | |
| <property name="mergedfile" value="${outputdir}/DIGMerged.xml"/> | |
| <property name="xalan" value="org.apache.xalan.processor.TransformerFactoryImpl" /> | |
| <property name="saxon9" value="net.sf.saxon.TransformerFactoryImpl" /> | |
| <property name="saxon6" value="com.icl.saxon.TransformerFactoryImpl" /> | |
| <property name="draft.mode" value="yes"/> | |
| <property name="analytics" value="0"/> | |
| <!-- HTML Generation --> | |
| <property name="chunck.toc.and.lots" value="0" /> | |
| <!-- PDF Generation --> | |
| <property name="paper.type" value="B4"/> | |
| <property name="page.orientation" value="landscape"/> | |
| <property name="double.sided" value="1"/> | |
| <property name="section.numbering" value="1"/> | |
| <property name="section.numbers.include.chapter" value="1"/> | |
| <property name="page.height" value="8.5in"/> | |
| <property name="page.width" value="17.0in"/> | |
| <!-- flag for odf/rtf build currently only in draft mode --> | |
| <condition property="fo.convert"> | |
| <equals arg1="${draft.mode}" arg2="yes"/> | |
| </condition> | |
| <taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop"> | |
| <classpath> | |
| <fileset dir="${star.currentlocation}/lib/FOP"> | |
| <include name="*.jar" /> | |
| </fileset> | |
| <fileset dir="${star.currentlocation}/lib/batik"> | |
| <include name="*.jar" /> | |
| </fileset> | |
| </classpath> | |
| </taskdef> | |
| <taskdef name="xinclude" classname="org.znerd.xincludetask.XIncludeTask"> | |
| <classpath> | |
| <fileset dir="${star.currentlocation}/lib/xinclude"> | |
| <include name="*.jar" /> | |
| </fileset> | |
| </classpath> | |
| </taskdef> | |
| <!-- ================================= | |
| target: default | |
| ================================= --> | |
| <target name="Publish" depends="clean, merge, HTML, HTML-Chunked, PDF, ODF, RTF, diff" description="--> This takes a docbook document and publishes it in HTML and PDF formats"> | |
| </target> | |
| <!-- - - - - - - - - - - - - - - - - - | |
| target: clean | |
| - - - - - - - - - - - - - - - - - --> | |
| <target name="clean"> | |
| <delete dir="${outputdir}" /> | |
| <mkdir dir="${outputdir}"/> | |
| <copy todir="${outputdir}/docbook"> | |
| <fileset dir="docbook"/> | |
| </copy> | |
| </target> | |
| <target name="merge"> | |
| <xinclude in="${inputfile}" out="${mergedfile}" /> | |
| </target> | |
| <!-- ================================= | |
| target: HTML-Chunked | |
| ================================= --> | |
| <target name="HTML-Chunked" depends="merge" description="--> Generates a Chuncked version of the HTML documentation"> | |
| <mkdir dir="${outputdir}"/> | |
| <mkdir dir="${outputdir}/HTML-Chunked"/> | |
| <copy todir="${outputdir}/HTML-Chunked/Images"> | |
| <fileset dir="${star.currentlocation}/Chapters/Images" includes="*.*" /> | |
| </copy> | |
| <xslt style="${docbookhtmldir}/starchunk.xsl" in="${mergedfile}" out="${outputdir}/HTML-Chunked/deleteme.html"> | |
| <factory name="${saxon6}" /> | |
| <param name="base.dir" expression="${outputdir}/HTML-Chunked/" /> | |
| <param name="generate.toc" expression="book toc,title,figure | |
| chapter toc,title" /> | |
| <param name="section.autolabel" expression="1"/> | |
| <param name="section.label.includes.component.label" expression="1"/> | |
| <param name="preface.autolabel" expression="I"/> | |
| <param name="tablecolumns.extension" expression="1"/> | |
| <param name="use.extensions" expression="1"/> | |
| <param name="glossentry.show.acronym" expression="yes"/> | |
| <param name="linenumbering.everyNth" expression="1"/> | |
| <param name="linenumbering.separator" expression="."/> | |
| <param name="draft.mode" expression="${draft.mode}"/> | |
| <param name="analytics" expression="${analytics}"/> | |
| <param name="admon.graphics" expression="1"/> | |
| <param name="glossary.sort" expression="1"/> | |
| </xslt> | |
| </target> | |
| <target name="HTML" depends="merge" description="--> Generates HTML documentation"> | |
| <mkdir dir="${outputdir}"/> | |
| <mkdir dir="${outputdir}/HTML"/> | |
| <copy todir="${outputdir}/HTML/Images"> | |
| <fileset dir="${star.currentlocation}/Chapters/Images" includes="*.*" /> | |
| </copy> | |
| <xslt style="${docbookhtmldir}/stardocbook.xsl" in="${mergedfile}" out="${outputdir}/HTML/DIG.html"> | |
| <factory name="${saxon6}" /> | |
| <param name="generate.toc" expression="book toc,title,figure,table,example | |
| chapter toc,title" /> | |
| <param name="section.autolabel" expression="1"/> | |
| <param name="section.label.includes.component.label" expression="1"/> | |
| <param name="preface.autolabel" expression="I"/> | |
| <param name="tablecolumns.extension" expression="1"/> | |
| <param name="use.extensions" expression="1"/> | |
| <param name="glossentry.show.acronym" expression="yes"/> | |
| <param name="linenumbering.everyNth" expression="1"/> | |
| <param name="linenumbering.separator" expression="."/> | |
| <param name="draft.mode" expression="${draft.mode}"/> | |
| <param name="admon.graphics" expression="1"/> | |
| <param name="glossary.sort" expression="1"/> | |
| </xslt> | |
| </target> | |
| <target name="PDF" depends="merge" description="Generate a PDF"> | |
| <mkdir dir="${outputdir}"/> | |
| <mkdir dir="${outputdir}/PDF"/> | |
| <mkdir dir="${outputdir}/PDF/Images"/> | |
| <copy todir="${outputdir}/PDF/Images"> | |
| <fileset dir="${star.currentlocation}/Chapters/Images" includes="*.*" /> | |
| </copy> | |
| <xslt basedir="${outputdir}/PDF" style="${docbookpdfdir}/stardocbook_fo.xsl" in="${mergedfile}" out="${outputdir}/PDF/DIG.fo"> | |
| <factory name="${saxon6}" /> | |
| <param name="fop1.extensions" expression="1"/> | |
| <param name="page.height" expression="11.0in"/> | |
| <param name="page.width" expression="8.5in"/> | |
| <param name="page.orientation" expression="portrait"/> | |
| <param name="keep.row.together" expression="0"/> | |
| <param name="double.sided" expression="${double.sided}"/> | |
| <param name="section.autolabel" expression="${section.numbering}"/> | |
| <param name="toc.max.depth" expression="5"/> | |
| <param name="body.font.master" expression="11"/> | |
| <param name="body.start.indent" expression="0pt"/> | |
| <param name="use.extensions" expression="1"/> | |
| <param name="tablecolumns.extension" expression="1"/> | |
| <param name="alignment" expression="left"/> | |
| <param name="draft.mode" expression="${draft.mode}"/> | |
| <param name="section.label.includes.component.label" expression="${section.numbers.include.chapter}"/> | |
| <param name="generate.toc" expression="book toc,title,figure,table,example | |
| chapter toc,title" /> | |
| <param name="preface.autolabel" expression="I"/> | |
| <param name="shade.verbatim" expression="1"/> | |
| <param name="header.column.widths" expression="1 3 1"/> | |
| <param name="glossentry.show.acronym" expression="yes"/> | |
| <param name="linenumbering.everyNth" expression="1"/> | |
| <param name="linenumbering.separator" expression="."/> | |
| <param name="admon.graphics" expression="1"/> | |
| <param name="admon.graphics.path" expression="${star.fileurl}${outputdir}/PDF/Images/"/> | |
| <param name="admon.graphics.extension" expression=".png"/> | |
| <param name="glossary.sort" expression="1"/> | |
| </xslt> | |
| <fop basedir="${outputdir}" format="application/pdf" outdir="${outputdir}/PDF"> | |
| <fileset dir="${outputdir}/PDF"> | |
| <include name="*.fo" /> | |
| </fileset> | |
| </fop> | |
| </target> | |
| <target name="zip"> | |
| <zip destfile="${outputdir}/DIGHTMLChunked.zip"> | |
| <zipfileset dir="${outputdir}/HTML-Chunked" prefix="HTML" includes="**/*"/> | |
| </zip> | |
| </target> | |
| <target name="diff" > | |
| <java classname="net.sf.diffmk.DiffMk"> | |
| <arg value='Archived/DIGMerged.xml'/> | |
| <arg value='${outputdir}/DIGMerged.xml'/> | |
| <arg value='${outputdir}/diff.xml'/> | |
| <classpath> | |
| <pathelement location="${star.currentlocation}/lib/diffmk/diffmk.jar"/> | |
| <pathelement location="${star.currentlocation}/lib/xercesImpl.jar"/> | |
| <pathelement location="${star.currentlocation}/lib/resolver.jar"/> | |
| <pathelement location="${star.currentlocation}/lib/serializer.jar"/> | |
| </classpath> | |
| </java> | |
| <xslt style="${star.currentlocation}/lib/diffmk/docbook.xsl" in="${outputdir}/diff.xml" out="${outputdir}/DIGMerged2.xml"> | |
| <factory name="${saxon6}" /> | |
| </xslt> | |
| <mkdir dir="${outputdir}/HTML-ChunkedChange"/> | |
| <copy todir="${outputdir}/HTML-ChunkedChange/Images"> | |
| <fileset dir="${star.currentlocation}/Chapters/Images" includes="*.*" /> | |
| </copy> | |
| <xslt style="${docbookhtmldir}/starchangebars.xsl" in="${outputdir}/DIGMerged2.xml" out="${outputdir}/HTML-ChunkedChange/deleteme.html"> | |
| <factory name="${saxon6}" /> | |
| <param name="base.dir" expression="${outputdir}/HTML-ChunkedChange/" /> | |
| <param name="generate.toc" expression="book toc,title,figure | |
| chapter toc,title" /> | |
| <param name="section.autolabel" expression="1"/> | |
| <param name="section.label.includes.component.label" expression="1"/> | |
| <param name="preface.autolabel" expression="I"/> | |
| <param name="tablecolumns.extension" expression="1"/> | |
| <param name="use.extensions" expression="1"/> | |
| <param name="glossentry.show.acronym" expression="yes"/> | |
| <param name="linenumbering.everyNth" expression="1"/> | |
| <param name="linenumbering.separator" expression="."/> | |
| <param name="draft.mode" expression="${draft.mode}"/> | |
| <param name="part.autolabel" expression="0"/> | |
| <param name="admon.graphics" expression="1"/> | |
| <param name="phrase.propogates.style" expression="1"/> | |
| <param name="glossary.sort" expression="1"/> | |
| </xslt> | |
| </target> | |
| <target name="Word" depends="merge" description="--> Generates HTML documentation"> | |
| <mkdir dir="${outputdir}"/> | |
| <mkdir dir="${outputdir}/Word"/> | |
| <copy todir="${outputdir}/Word/Images"> | |
| <fileset dir="${star.currentlocation}/Chapters/Images" includes="*.*" /> | |
| </copy> | |
| <xslt style="${docbookrtdir}/dbk2wordml.xsl" in="${mergedfile}" out="${outputdir}/Word/DIG.xml"> | |
| <factory name="${saxon6}" /> | |
| <param name="wordml.template" expression="${star.fileurl}${docbookrtdir}/template.xml"/> | |
| <param name="draft.mode" expression="${draft.mode}"/> | |
| <param name="admon.graphics" expression="1"/> | |
| </xslt> | |
| </target> | |
| <target name="ODF" | |
| depends="merge" | |
| if="fo.convert" | |
| description="--> Generates ODF documentation"> | |
| <mkdir dir="${outputdir}"/> | |
| <mkdir dir="${outputdir}/ODF"/> | |
| <mkdir dir="${outputdir}/ODF/Images"/> | |
| <copy todir="${outputdir}/ODF/Images"> | |
| <fileset dir="${star.currentlocation}/Chapters/Images" includes="*.*" /> | |
| </copy> | |
| <xslt basedir="${outputdir}/ODF" | |
| style="${docbookfodir}/stardocbook_fo.xsl" | |
| in="${mergedfile}" | |
| out="${outputdir}/ODF/DIG.fo"> | |
| <factory name="${saxon6}" /> | |
| <!-- fo converter doesn't support fop1.extensions --> | |
| <param name="fop.extensions" expression="1"/> | |
| <param name="page.height" expression="11.0in"/> | |
| <param name="page.width" expression="8.5in"/> | |
| <param name="page.orientation" expression="portrait"/> | |
| <param name="keep.row.together" expression="0"/> | |
| <param name="double.sided" expression="${double.sided}"/> | |
| <param name="section.autolabel" expression="${section.numbering}"/> | |
| <param name="toc.max.depth" expression="0"/> | |
| <param name="body.font.master" expression="11"/> | |
| <param name="body.start.indent" expression="0pt"/> | |
| <param name="use.extensions" expression="1"/> | |
| <param name="tablecolumns.extension" expression="1"/> | |
| <param name="alignment" expression="left"/> | |
| <param name="draft.mode" expression="${draft.mode}"/> | |
| <param name="section.label.includes.component.label" expression="${section.numbers.include.chapter}"/> | |
| <param name="generate.toc" expression=""/> | |
| <param name="preface.autolabel" expression="I"/> | |
| <param name="shade.verbatim" expression="1"/> | |
| <param name="header.column.widths" expression="1 3 1"/> | |
| <param name="glossentry.show.acronym" expression="yes"/> | |
| <param name="linenumbering.everyNth" expression="1"/> | |
| <param name="linenumbering.separator" expression="."/> | |
| <param name="admon.graphics" expression="1"/> | |
| <param name="admon.graphics.path" expression="${star.fileurl}${outputdir}/ODF/Images/"/> | |
| <param name="admon.graphics.extension" expression=".png"/> | |
| <param name="glossary.sort" expression="1"/> | |
| </xslt> | |
| <java | |
| fork="true" | |
| failonerror="true" | |
| maxmemory="512m" | |
| classname="com.xmlmind.fo.converter.Driver"> | |
| <classpath> | |
| <pathelement location="${fo-converterdir}/ext/lib/xfc_ext.jar"/> | |
| <pathelement location="${fo-converterdir}/bin/xfc.jar"/> | |
| <pathelement location="${star.currentlocation}/lib/saxon.jar"/> | |
| </classpath> | |
| <arg value="-outputFormat=odt"/> | |
| <arg value="${outputdir}/ODF/DIG.fo"/> | |
| <arg value="${outputdir}/ODF/DIG.odt"/> | |
| </java> | |
| </target> | |
| <target name="RTF" | |
| depends="merge" | |
| if="fo.convert" | |
| description="--> Generates RTF documentation"> | |
| <mkdir dir="${outputdir}"/> | |
| <mkdir dir="${outputdir}/RTF"/> | |
| <mkdir dir="${outputdir}/RTF/Images"/> | |
| <copy todir="${outputdir}/RTF/Images"> | |
| <fileset dir="${star.currentlocation}/Chapters/Images" includes="*.*" /> | |
| </copy> | |
| <xslt basedir="${outputdir}/RTF" | |
| style="${docbookfodir}/stardocbook_fo.xsl" | |
| in="${mergedfile}" | |
| out="${outputdir}/RTF/DIG.fo"> | |
| <factory name="${saxon6}" /> | |
| <!-- fo converter doesn't support fop1.extensions --> | |
| <param name="fop.extensions" expression="1"/> | |
| <param name="page.height" expression="11.0in"/> | |
| <param name="page.width" expression="8.5in"/> | |
| <param name="page.orientation" expression="portrait"/> | |
| <param name="keep.row.together" expression="0"/> | |
| <param name="double.sided" expression="${double.sided}"/> | |
| <param name="section.autolabel" expression="${section.numbering}"/> | |
| <param name="toc.max.depth" expression="0"/> | |
| <param name="body.font.master" expression="11"/> | |
| <param name="body.start.indent" expression="0pt"/> | |
| <param name="use.extensions" expression="1"/> | |
| <param name="tablecolumns.extension" expression="1"/> | |
| <param name="alignment" expression="left"/> | |
| <param name="draft.mode" expression="${draft.mode}"/> | |
| <param name="section.label.includes.component.label" expression="${section.numbers.include.chapter}"/> | |
| <param name="generate.toc" expression=""/> | |
| <param name="preface.autolabel" expression="I"/> | |
| <param name="shade.verbatim" expression="1"/> | |
| <param name="header.column.widths" expression="1 3 1"/> | |
| <param name="glossentry.show.acronym" expression="yes"/> | |
| <param name="linenumbering.everyNth" expression="1"/> | |
| <param name="linenumbering.separator" expression="."/> | |
| <param name="admon.graphics" expression="1"/> | |
| <param name="admon.graphics.path" expression="${star.fileurl}${outputdir}/RTF/Images/"/> | |
| <param name="admon.graphics.extension" expression=".png"/> | |
| <param name="glossary.sort" expression="1"/> | |
| </xslt> | |
| <java | |
| fork="true" | |
| failonerror="true" | |
| maxmemory="512m" | |
| classname="com.xmlmind.fo.converter.Driver"> | |
| <classpath> | |
| <pathelement location="${fo-converterdir}/ext/lib/xfc_ext.jar"/> | |
| <pathelement location="${fo-converterdir}/bin/xfc.jar"/> | |
| <pathelement location="${star.currentlocation}/lib/saxon.jar"/> | |
| </classpath> | |
| <arg value="-outputFormat=rtf"/> | |
| <arg value="${outputdir}/RTF/DIG.fo"/> | |
| <arg value="${outputdir}/RTF/DIG.rtf"/> | |
| </java> | |
| </target> | |
| </project> |