Files
maven-plugins/pdf/plugin.jelly
evenisse afc1323fe1 From Arnaud Heritier :
plugin.jelly :
            code reformating,
            + debug mode corrected : uses correctly the project property �maven.pdf.debug� for the style task and the FO transformation,
            + uses a new property �maven.pdf.navigationFile� to specify a navigation file specific to the pdf doc.
plugin.properties :
            New property : �maven.pdf.navigationFile�
project.xml :
            code reformating,
fo-body.xslt :
            code reformating,
            + corrects some problem with external and internal links
            + write the link on the page when the navigation file points to an external link.
fo-table-column-widths.xslt, fo-tables.xslt :
            code reformating,
            + add the generation of tables with only tr/td and th.
project2fo.xslt :
            code reformating,
            + remove the generation of pages which are not hosted in the project.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114603 13f79535-47bb-0310-9956-ffa450edef68
2004-01-21 09:14:44 +00:00

94 lines
6.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:j="jelly:core">
<goal name="pdf:init" prereqs="xdoc:init">
<j:set var="docsXdocSrc" value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.src')}"/>
<j:set var="docsGenSrc" value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.gen.docs')}"/>
<j:set var="docsPdf" value="${maven.build.dir}/pdf"/>
<j:set var="docsToc" value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.src')}/${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.navigationFile')}"/>
<j:set var="confidential" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.confidential')}"/>
<j:set var="paperType" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.paperType')}"/>
<j:set var="companyName" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.companyName')}"/>
<j:set var="companyIncName" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.companyIncName')}"/>
<j:set var="publicationYear" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.copyrightYear')}"/>
<j:set var="coverProjectCompany" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.projectCompany')}"/>
<j:set var="coverProjectName" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.projectName')}"/>
<j:set var="coverType" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.type')}"/>
<j:set var="coverVersion" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.version')}"/>
<j:set var="coverDate" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.date')}"/>
<j:set var="projectLogo" value="${docsPdf}/images/${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.projectLogo')}"/>
<j:set var="companyLogo" value="${docsPdf}/images/${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.companyLogo')}"/>
<j:set var="imageDpi" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.imageDpi')}"/>
<j:set var="debug" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.debug')}"/>
<mkdir dir="${docsPdf}"/>
</goal>
<goal name="fo" prereqs="fo:fo" description="Generate XSL:FO project documentation"/>
<goal name="fo:fo" prereqs="pdf:prepare" description="Generate XSL:FO project documentation">
<echo>Generating ${docsDest}/project.fo ...</echo>
<available file="${docsToc}" property="maven.fo.navigation.available"/>
<fail message="PDF generation cannot complete as ${docsToc} is missing" unless="maven.fo.navigation.available"/>
<!-- 'Major hack.' Stolen from the Latka plugin.jelly. All of this could be avoided by putting
xalan into $MAVEN_HOME/lib/endorsed directory in the distribution, but never mind -->
${systemScope.setProperty('javax.xml.transform.TransformerFactory','org.apache.xalan.processor.TransformerFactoryImpl')}
<style in="${docsToc}" out="${docsPdf}/project.fo" style="${plugin.resources}/project2fo.xslt" force="true">
<param name="basePath" expression="${docsPdf}"/>
<param name="confidential" expression="${confidential}"/>
<param name="paperType" expression="${paperType}"/>
<param name="companyName" expression="${companyName}"/>
<param name="companyIncName" expression="${companyIncName}"/>
<param name="publicationYear" expression="${publicationYear}"/>
<param name="coverProjectCompany" expression="${coverProjectCompany}"/>
<param name="coverProjectName" expression="${coverProjectName}"/>
<param name="coverType" expression="${coverType}"/>
<param name="coverVersion" expression="${coverVersion}"/>
<param name="coverDate" expression="${coverDate}"/>
<param name="companyLogo" expression="${companyLogo}"/>
<param name="projectLogo" expression="${projectLogo}"/>
<param name="imageDpi" expression="${imageDpi}"/>
<param name="debug" expression="${debug}"/>
</style>
</goal>
<goal name="pdf" prereqs="fo:fo,pdf:prepare,pdf:pdf" description="Generate PDF project documentation"/>
<goal name="pdf:prepare" prereqs="pdf:init" description="Stages all files needed to generate the PDF">
<!-- First, copy all of the generated xdocs -->
<copy todir="${docsPdf}">
<fileset dir="${docsGenSrc}" force="true">
<include name="**/*.*"/>
</fileset>
</copy>
<!-- Then, copy all of the user-supplied xdocs -->
<copy todir="${docsPdf}" force="true">
<fileset dir="${docsXdocSrc}">
<include name="**/*.*"/>
</fileset>
</copy>
<!-- Finally, copy the FOP config file and all of the fonts -->
<copy todir="${docsPdf}" force="true">
<fileset dir="${plugin.resources}">
<include name="userconfig.xml"/>
<include name="fonts/*.*"/>
</fileset>
</copy>
</goal>
<goal name="pdf:pdf" description="Generate PDF project documentation" prereqs="pdf:prepare">
<echo>Generating ${docsPdf}/project.pdf ...</echo>
<echo>Config file: ${docsPdf}/userconfig.xml</echo>
<java classname="org.apache.fop.apps.Fop" fork="yes" failonerror="true" maxmemory="500m">
<classpath>
<pathelement location="${plugin.getDependencyPath('fop')}"/>
<pathelement location="${plugin.getDependencyPath('batik')}"/>
<pathelement location="${plugin.getDependencyPath('logkit')}"/>
<pathelement location="${plugin.getDependencyPath('avalon-framework')}"/>
<pathelement location="${plugin.getDependencyPath('xerces')}"/>
</classpath>
<arg value="-c"/>
<arg value="${docsPdf}/userconfig.xml"/>
<j:if test="${debug}"><arg value="-d"/></j:if>
<arg value="-fo"/>
<arg value="${docsPdf}/project.fo"/>
<arg value="-pdf"/>
<arg value="${docsPdf}/project.pdf"/>
<sysproperty key="javax.xml.transform.TransformerFactory" value="org.apache.xalan.processor.TransformerFactoryImpl"/>
</java>
</goal>
</project>