dion 2003/07/03 22:06:40
Modified: src/plugins-build/multiproject plugin.jelly
Log:
Add ability to auto-generate multi-project navigation based on the processed
projects.
Sites can be aggregated under one filesystem, or independent, with absolute
references in the navigation
Revision Changes Path
1.3 +70 -2 maven/src/plugins-build/multiproject/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/multiproject/plugin.jelly,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- plugin.jelly 3 Jul 2003 20:41:36 -0000 1.2
+++ plugin.jelly 4 Jul 2003 05:06:40 -0000 1.3
@@ -3,7 +3,15 @@
<project
xmlns:j="jelly:core"
xmlns:maven="jelly:maven"
- xmlns:ant="jelly:ant">
+ xmlns:ant="jelly:ant"
+ xmlns:doc="doc"
+ xmlns:util="jelly:util"
+ xmlns:velocity="jelly:velocity">
+
+ <j:set var="maven.gen.docs"
+
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.gen.docs')}"/>
+ <j:set var="maven.docs.dest"
+
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}"/>
<goal name="multiproject"
description="Run the site goal of all subprojects"
@@ -13,17 +21,77 @@
<goal name="multiproject:site"
description="Run the site goal of all subprojects">
+ <attainGoal name="multiproject:create-nav"/>
+
+ <!-- generate site docs -->
<maven:reactor
basedir="${maven.multiproject.basedir}"
includes="${maven.multiproject.includes}"
excludes="${maven.multiproject.excludes}"
- postProcessing="false"
+ postProcessing="true"
goals="clean,site"
ignoreFailures="${maven.multiproject.ignoreFailures}"
/>
+
+ <attainGoal name="site" />
+
+ <!-- copy or not? -->
+ <j:set var="navType" value="${maven.multiproject.navigation}"/>
+ <j:if test="${navType == 'aggregate'}">
+ <!-- copy each project over into ${maven.docs.dest} -->
+ <j:forEach var="reactorProject" items="${reactorProjects}">
+ <!-- note this is the same name as is generated in the
navigation-aggregate.xml -->
+ <j:set var="directory"
value="${maven.docs.dest}/multiproject/${reactorProject.name}"/>
+ <mkdir dir="${directory}"/>
+ <!--
+ ${reactorProject.name} has docs directory
+
${reactorProject.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}
+ needing to be copied
+ -->
+ <j:set var="fromDir"
+
value="${reactorProject.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}"/>
+ <copy toDir="${directory}">
+ <fileset dir="${fromDir}"/>
+ </copy>
+ </j:forEach>
+ </j:if>
</goal>
+ <goal name="multiproject:create-nav">
+ <echo>gen docs is ${maven.gen.docs}</echo>
+ <mkdir dir="${maven.gen.docs}"/>
+ <!-- get all projects for template processing -->
+ <maven:reactor
+ basedir="${maven.multiproject.basedir}"
+ includes="${maven.multiproject.includes}"
+ excludes="${maven.multiproject.excludes}"
+ postProcessing="true"
+ ignoreFailures="true"
+ />
+
+ <!-- generate navbar for project based on aggregate or independent -->
+ <j:set var="navType" value="${maven.multiproject.navigation}"/>
+ <j:if test="${navType != ''}">
+ <echo>Producing ${navType} navigation...</echo>
+ <velocity:merge
+ name="${maven.gen.docs}/navigation.xml"
+ basedir="${plugin.resources}/templates"
+ template="navigation-${navType}.xml"/>
+ </j:if>
+
+ <util:file var="userNavTemplate" name="${basedir}/multiproject/navigation.xml"/>
+ <j:if test="${userNavTemplate.exists()}">
+ <echo>Producing user supplied navigation...</echo>
+
+ <velocity:merge
+ name="${maven.gen.docs}/navigation.xml"
+ basedir="${basedir}/multiproject"
+ template="navigation.xml"/>
+ </j:if>
+
+ </goal>
+
<goal name="multiproject:goal" description="Run a given goal on all projects">
<!-- FIXME: This should be a tag somewhere else as it's common to do tag
param checking -->
<j:if test="${empty(goal)}">
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]