You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ka...@apache.org on 2003/01/31 19:25:28 UTC

cvs commit: jakarta-turbine-maven/src/plugins-build/xdoc/src/plugin-resources/templates maven-reports.xml

kaz         2003/01/31 10:25:28

  Modified:    src/plugins-build/changelog plugin.jelly
               src/plugins-build/checkstyle plugin.jelly
               src/plugins-build/developer-activity plugin.jelly
               src/plugins-build/file-activity plugin.jelly
               src/plugins-build/javadoc plugin.jelly
               src/plugins-build/jdepend plugin.jelly
               src/plugins-build/junit-report plugin.jelly
               src/plugins-build/jxr plugin.jelly
               src/plugins-build/site plugin.jelly
               src/plugins-build/tasklist plugin.jelly
               src/plugins-build/xdoc plugin.jelly
               src/plugins-build/xdoc/src/plugin-resources site.jsl
               src/plugins-build/xdoc/src/plugin-resources/templates
                        maven-reports.xml
  Log:
  Here is a first pass to enable users to specify what reports should
  appear in their published site's "Project Reports" section of the
  navbar.  Users can now specify a <reports/> section in the POM that
  specifies exactly which reports should be included in one's site.  For
  example:
  
    <reports>
      <report>maven-changelog-plugin</report>
      <report>maven-junit-report-plugin</report>
      <report>maven-javadoc-plugin</report>
      <report>maven-jxr-plugin</report>
    </reports>
  
  This would only run the above four plugins when 'maven site' is invoked.
  In addition, the navbar and the maven-reports document that is generated
  will only contain links to the above specified reports.  Please note,
  that the order the reports are specified is the order in which they will
  appear.  Note: if you do not have a <reports/> section in the POM, you
  will fallback to the standard behavior (which is predefined reports).
  
  Lets talk about how this all works now.  Previously, site.jsl in the
  xdoc plugin contained a static set of reports that were included in the
  navbar.  This could not be changed by end users.  In addition, we also
  had a separate xdoc to maintain which contained a description of all of
  the reports (this page is displayed when you click on 'Project Reports'
  to expand that section of the navbar).  Again, this was a static page.
  Finally, a developer writing their own plugin which generated a report,
  would have to submit patches for both of these files for their report to
  be included when a 'maven site' was executed.
  
  All of the above deficiencies have been corrected when using the new
  <reports/> mechansim.  There is a new protocol which plugin developers
  should follow if their plugin generates a report.  Their plugin's
  plugin.jelly file should contain a gool like this (don't forget to
  include the 'xmlns:doc="doc"' declaration as well):
  
    <goal name="maven-changelog-plugin:register">
      <doc:registerReport
        name="Change Log"
        link="changelog-report"
        description="Report on the source control changelog."/>
    </goal>
  
  The above should be pretty self explanatory.  The plugin developer
  simply defines a 'name'.  The 'name' is used in the navbar and in the
  first column of the table in the auto-generated maven-reports file.
  'link' is the relative link from the doc directory to the generated
  report (without the extension).  Finally, a 'description' should be used
  to create a one line summary of the report's contents.  This is used
  when auto-generating the maven-reports document.
  
  A plugin may define multiple reports if needed.  For example, here is
  the javadoc plugin example:
  
    <goal name="maven-javadoc-plugin:register">
      <j:if test="${sourcesPresent}">
        <doc:registerReport
          name="JavaDocs"
          link="apidocs/index"
          description="JavaDoc API documentation."/>
        <doc:registerReport
          name="JavaDoc Report"
          link="javadoc"
          description="Report on the generation of JavaDoc."/>
      </j:if>
    </goal>
  
  Another important difference you'll notice above is that the conditional
  tests of whether or not a report should appear is no longer part of
  site.jsl.  The logic of determining whether the report appears now lies
  within the plugin that generates the report.  Thus, in the above
  example, only if sources are present, will the reports actually appear
  in the navbar and maven-reports document.
  
  So what happens when one types 'maven site'?  Basically, for each
  <report/> defined, maven will try to <attainGoal> on that report.  The
  goal runs as it normally does.  The magic kicks in when the 'xdoc'
  plugin is run (after all of the <reports/> have been run).  The first
  thing the xdoc plugin does is determine what reports should be included
  in all of the documentation it generates.  The report list (its really a
  set) is generated when xdoc calls its own 'xdoc:register-reports' goal.
  This goal looks at each <report/> defined in the POM and then calls
  <attainGoal name="xyz:register"/> where "xyz" corresponds to the name
  defined in the <report/>.  This is where the new protocol is required.
  If that goal does not exist, you will get an error from Jelly.
  
  As each of the xyz:register goals are called, they invoke the
  <doc:registerReport> tag (which is defined in the xdoc plugin), this tag
  basically builds a set of hashtables.  Each hashtable corresponds to a
  report and contains a 'name', 'link', and 'description' entry.  After
  the completion of 'xdoc:register-reports' we now have a set in the xdoc
  context called 'reports' which contains our descriptions of each report.
  Site.jsl uses this to dynamically build up the navbar, and the
  maven-reports document uses it to build the content of itself.
  
  Phew!  That was a long one.  In summary, if you don't use <reports/>
  nothing changes (at least it shouldn't), but in the future, if this
  <reports/> thing works out, we will migrate users in this direction.
  
  Revision  Changes    Path
  1.3       +7 -0      jakarta-turbine-maven/src/plugins-build/changelog/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/changelog/plugin.jelly,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.jelly	25 Jan 2003 17:25:24 -0000	1.2
  +++ plugin.jelly	31 Jan 2003 18:25:27 -0000	1.3
  @@ -6,6 +6,13 @@
     xmlns:changelog="changelog"
     xmlns:doc="doc">
   
  +  <goal name="maven-changelog-plugin:register">
  +    <doc:registerReport 
  +      name="Change Log" 
  +      link="changelog-report"
  +      description="Report on the source control changelog."/>
  +  </goal>
  +
     <define:taglib uri="changelog">
       <define:jellybean
         name="changelog"
  
  
  
  1.3       +7 -0      jakarta-turbine-maven/src/plugins-build/checkstyle/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/checkstyle/plugin.jelly,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.jelly	25 Jan 2003 17:03:48 -0000	1.2
  +++ plugin.jelly	31 Jan 2003 18:25:27 -0000	1.3
  @@ -5,6 +5,13 @@
     xmlns:util="jelly:util"
     xmlns:doc="doc">
   
  +  <goal name="maven-checkstyle-plugin:register">
  +    <doc:registerReport 
  +      name="Checkstyle" 
  +      link="checkstyle-report"
  +      description="Report on coding style conventions."/>
  +  </goal>
  +
     <!-- ================================================================== -->
     <!-- C H E C K S T Y L E                                                -->
     <!-- ================================================================== -->
  
  
  
  1.4       +7 -0      jakarta-turbine-maven/src/plugins-build/developer-activity/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/developer-activity/plugin.jelly,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- plugin.jelly	28 Jan 2003 03:54:15 -0000	1.3
  +++ plugin.jelly	31 Jan 2003 18:25:27 -0000	1.4
  @@ -6,6 +6,13 @@
     xmlns:changelog="changelog"
     xmlns:doc="doc">
   
  +  <goal name="maven-developer-activity-plugin:register">
  +    <doc:registerReport 
  +      name="Developer Activity" 
  +      link="developer-activity-report"
  +      description="Report on the amount of developer activity."/>
  +  </goal>
  +
     <!-- ================================================================== -->
     <!-- D E V E L O P E R  A C T I V I T Y  R E P O R T                    -->
     <!-- ================================================================== -->
  
  
  
  1.4       +7 -0      jakarta-turbine-maven/src/plugins-build/file-activity/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/file-activity/plugin.jelly,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- plugin.jelly	28 Jan 2003 04:54:59 -0000	1.3
  +++ plugin.jelly	31 Jan 2003 18:25:27 -0000	1.4
  @@ -6,6 +6,13 @@
     xmlns:changelog="changelog"
     xmlns:doc="doc">
   
  +  <goal name="maven-file-activity-plugin:register">
  +    <doc:registerReport 
  +      name="File Activity" 
  +      link="file-activity-report"
  +      description="Report on file activity."/>
  +  </goal>
  +
     <!-- ================================================================== -->
     <!-- F I L E  A C T I V I T Y  R E P O R T                              -->
     <!-- ================================================================== -->
  
  
  
  1.6       +15 -1     jakarta-turbine-maven/src/plugins-build/javadoc/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/javadoc/plugin.jelly,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- plugin.jelly	31 Jan 2003 12:53:00 -0000	1.5
  +++ plugin.jelly	31 Jan 2003 18:25:27 -0000	1.6
  @@ -3,12 +3,26 @@
   <project xmlns:j="jelly:core" 
     xmlns:util="jelly:util"
     xmlns:define="jelly:define"
  +  xmlns:doc="doc"
     xmlns:license="license">
   
  +  <goal name="maven-javadoc-plugin:register">
  +    <j:if test="${sourcesPresent}">
  +      <doc:registerReport 
  +        name="JavaDocs" 
  +        link="apidocs/index"
  +        description="JavaDoc API documentation."/>
  +      <doc:registerReport 
  +        name="JavaDoc Report" 
  +        link="javadoc"
  +        description="Report on the generation of JavaDoc."/>
  +    </j:if>
  +  </goal>
  +
     <!-- ================================================================== -->
     <!-- J A V A D O C S                                                    -->
     <!-- ================================================================== -->
  -  
  +
     <!-- Some aliases for ease of use and backward compat. -->
     <goal name="javadoc:generate" prereqs="maven-javadoc-plugin:report"/>
     <goal name="javadoc" prereqs="maven-javadoc-plugin:report"/>
  
  
  
  1.2       +7 -0      jakarta-turbine-maven/src/plugins-build/jdepend/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/jdepend/plugin.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- plugin.jelly	24 Jan 2003 03:45:34 -0000	1.1
  +++ plugin.jelly	31 Jan 2003 18:25:28 -0000	1.2
  @@ -2,6 +2,13 @@
   
   <project xmlns:j="jelly:core" xmlns:doc="doc">
   
  +  <goal name="maven-jdepend-plugin:register">
  +    <doc:registerReport 
  +      name="Metrics" 
  +      link="jdepend-report"
  +      description="Report on source code metrics."/>
  +  </goal>
  +
     <!-- ================================================================== -->
     <!-- J D E P E N D  X M L  T A R G E T                                  -->
     <!-- ================================================================== -->
  
  
  
  1.3       +7 -0      jakarta-turbine-maven/src/plugins-build/junit-report/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/junit-report/plugin.jelly,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.jelly	28 Jan 2003 05:53:52 -0000	1.2
  +++ plugin.jelly	31 Jan 2003 18:25:28 -0000	1.3
  @@ -4,6 +4,13 @@
     xmlns:j="jelly:core" 
     xmlns:doc="doc">
     
  +  <goal name="maven-junit-report-plugin:register">
  +    <doc:registerReport 
  +      name="Unit Tests" 
  +      link="junit-report"
  +      description="Report on the results of the unit tests."/>
  +  </goal>
  +
     <!-- ================================================================== -->
     <!-- C R E A T E  J U N I T  X M L  R E P O R T                         -->
     <!-- ================================================================== -->
  
  
  
  1.3       +10 -0     jakarta-turbine-maven/src/plugins-build/jxr/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/jxr/plugin.jelly,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.jelly	28 Jan 2003 06:36:34 -0000	1.2
  +++ plugin.jelly	31 Jan 2003 18:25:28 -0000	1.3
  @@ -3,7 +3,17 @@
   <project 
     xmlns:j="jelly:core"  
     xmlns:define="jelly:define"
  +  xmlns:doc="doc"
     xmlns:jxr="jxr">
  +
  +  <goal name="maven-jxr-plugin:register">
  +    <j:if test="${sourcesPresent}">
  +      <doc:registerReport 
  +        name="Source Xref" 
  +        link="xref/index"
  +        description="A set of browsable cross-referenced sources."/>
  +    </j:if>
  +  </goal>
   
       <define:taglib uri="jxr">
         <define:jellybean
  
  
  
  1.3       +21 -10    jakarta-turbine-maven/src/plugins-build/site/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/site/plugin.jelly,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.jelly	25 Jan 2003 18:19:55 -0000	1.2
  +++ plugin.jelly	31 Jan 2003 18:25:28 -0000	1.3
  @@ -20,16 +20,27 @@
       name="site"
       description="Generate the web site">
   
  -      <attainGoal name="maven-jdepend-plugin:report"/>
  -      <attainGoal name="maven-checkstyle-plugin:report"/>
  -      <attainGoal name="maven-changelog-plugin:report"/>
  -      <attainGoal name="maven-developer-activity-plugin:report"/>
  -      <attainGoal name="maven-file-activity-plugin:report"/>
  -      <attainGoal name="maven-javadoc-plugin:report"/>
  -      <attainGoal name="maven-jxr-plugin:report"/>
  -      <attainGoal name="maven-junit-report-plugin:report"/>
  -      <attainGoal name="maven-tasklist-plugin:report"/>
  -      <attainGoal name="xdoc"/>
  +    <j:choose>
  +      <j:when test="${!pom.reports.isEmpty()}">
  +        <j:forEach var="report" items="${pom.reports}">
  +          <j:set var="reportGoal" value="${report}:report"/>
  +          <echo>Generating the ${report} ... </echo>
  +          <attainGoal name="${reportGoal}"/>
  +        </j:forEach>
  +      </j:when>
  +      <j:otherwise>
  +        <attainGoal name="maven-jdepend-plugin:report"/>
  +        <attainGoal name="maven-checkstyle-plugin:report"/>
  +        <attainGoal name="maven-changelog-plugin:report"/>
  +        <attainGoal name="maven-developer-activity-plugin:report"/>
  +        <attainGoal name="maven-file-activity-plugin:report"/>
  +        <attainGoal name="maven-javadoc-plugin:report"/>
  +        <attainGoal name="maven-jxr-plugin:report"/>
  +        <attainGoal name="maven-junit-report-plugin:report"/>
  +        <attainGoal name="maven-tasklist-plugin:report"/>
  +      </j:otherwise>
  +    </j:choose>
  +    <attainGoal name="xdoc"/>
   
     </goal>
   
  
  
  
  1.3       +8 -0      jakarta-turbine-maven/src/plugins-build/tasklist/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/tasklist/plugin.jelly,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- plugin.jelly	25 Jan 2003 17:25:24 -0000	1.2
  +++ plugin.jelly	31 Jan 2003 18:25:28 -0000	1.3
  @@ -2,7 +2,15 @@
   
   <project 
     xmlns:j="jelly:core"
  +  xmlns:doc="doc"
     xmlns:vdoclet="vdoclet">
  +
  +  <goal name="maven-tasklist-plugin:register">
  +    <doc:registerReport 
  +      name="Task List" 
  +      link="task-list"
  +      description="Report on tasks specified in the source code."/>
  +  </goal>
   
     <!-- ================================================================== -->
     <!-- T A S K   C R E A T I O N                                          -->
  
  
  
  1.4       +39 -2     jakarta-turbine-maven/src/plugins-build/xdoc/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/xdoc/plugin.jelly,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- plugin.jelly	30 Jan 2003 10:58:35 -0000	1.3
  +++ plugin.jelly	31 Jan 2003 18:25:28 -0000	1.4
  @@ -13,6 +13,20 @@
   
     <define:taglib uri="doc">
       
  +    <define:tag name="registerReport">
  +
  +      <j:set 
  +        var="reports" 
  +        value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('reports')}"/>
  +
  +      <j:new var="report" className="java.util.HashMap"/>
  +      <j:set var="dummy" value="${report.put('name', name)}"/>
  +      <j:set var="dummy" value="${report.put('link', link)}"/>
  +      <j:set var="dummy" value="${report.put('description', description)}"/>
  +      <j:set var="dummy" value="${reports.add(report)}"/>
  +
  +    </define:tag>
  +
       <define:tag name="formatAsNumber">
         <!--
          | @string
  @@ -170,6 +184,9 @@
             <util:file var="navFile" name="${file.parentFile.absoluteFile}/navigation.xml"/>
           </util:available>
   
  +        <j:set 
  +          var="reports"
  +          value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('reports')}"/>
   
           <!-- parse nav and make it available to the stylesheet -->
           <x:parse var="navXML" xml="${navFile}"/>
  @@ -205,7 +222,7 @@
   
     <goal
       name="xdoc:generate-from-pom"
  -    prereqs="xdoc:init"
  +    prereqs="xdoc:init, xdoc:register-reports"
       description="Generates xdocs for site based on project descriptor">
       
       <echo>Generating xdocs from POM ... </echo>
  @@ -214,6 +231,9 @@
       
       <!-- All the templates use $project for now. -->
       <j:set var="project" value="${pom}"/>
  +    <j:set 
  +      var="reports"
  +      value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('reports')}"/>
       
       <!-- Need the escaper to html output. -->
       <j:useBean var="escape" class="org.apache.velocity.anakia.Escape"/>
  @@ -409,8 +429,25 @@
       </tstamp>
     </goal>
   
  +  <goal name="xdoc:register-reports">
  +
  +    <j:new var="reports" className="java.util.HashSet"/>
  +    <j:set var="dummy" value="${pom.getPluginContext('maven-xdoc-plugin').setVariable('reports', reports)}"/>
  +
  +    <!--
  +     | We need to have each <report> register itself with us so we can
  +     | build up our navbar.  To do this, we call the plugin:register
  +     | goal on each report plugin.
  +     |-->
  +    <j:forEach var="report" items="${pom.reports}">
  +      <j:set var="reportGoal" value="${report}:register"/>
  +      <echo>${report} is registering with the xdoc plugin ... </echo>
  +      <attainGoal name="${reportGoal}"/>
  +    </j:forEach>
  +  </goal>
  +
     <goal name="xdoc:jelly-transform" 
  -    prereqs="xdoc:init, xdoc:jelly-init"
  +    prereqs="xdoc:init, xdoc:jelly-init, xdoc:register-reports"
       description="transform xdocs using jelly/jsl rather than dvsl">
   
       <j:set var="destdir" value="${maven.docs.dest}"/>
  
  
  
  1.2       +133 -91   jakarta-turbine-maven/src/plugins-build/xdoc/src/plugin-resources/site.jsl
  
  Index: site.jsl
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/xdoc/src/plugin-resources/site.jsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- site.jsl	24 Jan 2003 03:45:01 -0000	1.1
  +++ site.jsl	31 Jan 2003 18:25:28 -0000	1.2
  @@ -193,99 +193,141 @@
                       <small>
                         <a href="${relativePath}/maven-reports.html">Project Reports</a>
                       </small>
  -                    <util:tokenize var="projectReportFiles" delim=",">${maven.xdoc.projectReports}</util:tokenize>
  -                    <j:forEach var="reportFile" items="${projectReportFiles}">
  -                      <j:if test="${relativePath == '.' and fileName.endsWith(reportFile.trim())}">
  -                        <util:available file="${maven.docs.src}/tasks.xml">
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/tasks.html">Tasks</a>
  -                            </small>
  -                          </div>
  -                        </util:available>
  -                        <util:available file="${maven.gen.docs}/task-list.xml">
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/task-list.html">Task List</a>
  -                            </small>
  -                          </div>
  -                        </util:available>
  -                        <util:available file="${maven.docs.src}/changes.xml">
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/changes.html">Changes</a>
  -                            </small>
  -                          </div>
  -                        </util:available>
  -                        <j:if test="${!empty(pom.repository.connection)}">
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/changelog-report.html">Change Log</a>
  -                            </small>
  -                          </div>
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/developer-activity-report.html">Developer Activity</a>
  -                            </small>
  -                          </div>
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/file-activity-report.html">File Activity</a>
  -                            </small>
  -                          </div>
  +                    <j:choose>
  +                      <j:when test="${!pom.reports.isEmpty()}">
  +                        <!--
  +                         | Check to see if we need to include the report
  +                         | links in this document.  The only time we
  +                         | need to do this is when the current document
  +                         | either the maven-reports.xml doc (the page
  +                         | is displayed when clicking on Project
  +                         | Reports) or when the current document is one
  +                         | of the actual reports (in which case we want
  +                         | to leave the project report links expanded.
  +                         |-->
  +                         <j:set var="includeReportLinks" value="false"/>
  +                         <j:forEach var="report" items="${reports}">
  +                           <j:set var="linkWithXmlExt" value="${report.link}.xml"/>
  +                           <j:if test="${relativePath == '.' and (fileName.endsWith('maven-reports.xml') or fileName.endsWith(linkWithXmlExt))}">
  +                            <j:set var="includeReportLinks" value="true"/>
  +                          </j:if>
  +                        </j:forEach>
  +                        <!--
  +                         | If we need to include the report links, then
  +                         | do so.  This is determined by the above
  +                         | block.
  +                         |-->
  +                        <j:if test="${includeReportLinks == 'true'}">
  +                          <j:forEach var="report" items="${reports}">
  +                            <div>
  +                              <small>
  +                                <a href="${relativePath}/${report.link}.html">
  +                                  ${report.name}
  +                                </a>
  +                              </small>
  +                            </div>
  +                          </j:forEach>
                           </j:if>
  -                        <j:if test="${unitTestSourcesPresent}">
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/junit-report.html">Unit Tests</a>
  -                            </small>
  -                          </div>
  -                        </j:if>
  -                        <j:if test="${sourcesPresent}">
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/jdepend-report.html">Metric Results</a>
  -                            </small>
  -                          </div>
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/checkstyle-report.html">Checkstyle Report</a>
  -                            </small>
  -                          </div>
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/javadoc.html">Javadoc Report</a>
  -                            </small>
  -                          </div>
  -                        </j:if>
  -                        <util:available file="${maven.docs.dest}/clover">
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/clover/index.html">Clover Test Coverage</a>
  -                            </small>
  -                          </div>
  -                        </util:available>
  -                        <util:available file="${maven.gen.docs}/cactus-report.xml">
  -                          <div>
  -                            <small>
  -                              <a href="${relativePath}/cactus-report.html">Cactus Tests</a>
  -                            </small>
  -                          </div>
  -                        </util:available>
  -                      </j:if>
  -                    </j:forEach>
  +                      </j:when>
  +                      <j:otherwise>
  +                        <!-- The old static method -->
  +                        <util:tokenize var="projectReportFiles" delim=",">${maven.xdoc.projectReports}</util:tokenize>
  +                        <j:forEach var="reportFile" items="${projectReportFiles}">
  +                          <j:if test="${relativePath == '.' and fileName.endsWith(reportFile.trim())}">
  +                            <util:available file="${maven.docs.src}/tasks.xml">
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/tasks.html">Tasks</a>
  +                                </small>
  +                              </div>
  +                            </util:available>
  +                            <util:available file="${maven.gen.docs}/task-list.xml">
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/task-list.html">Task List</a>
  +                                </small>
  +                              </div>
  +                            </util:available>
  +                            <util:available file="${maven.docs.src}/changes.xml">
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/changes.html">Changes</a>
  +                                </small>
  +                              </div>
  +                            </util:available>
  +                            <j:if test="${!empty(pom.repository.connection)}">
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/changelog-report.html">Change Log</a>
  +                                </small>
  +                              </div>
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/developer-activity-report.html">Developer Activity</a>
  +                                </small>
  +                              </div>
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/file-activity-report.html">File Activity</a>
  +                                </small>
  +                              </div>
  +                            </j:if>
  +                            <j:if test="${unitTestSourcesPresent}">
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/junit-report.html">Unit Tests</a>
  +                                </small>
  +                              </div>
  +                            </j:if>
  +                            <j:if test="${sourcesPresent}">
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/jdepend-report.html">Metric Results</a>
  +                                </small>
  +                              </div>
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/checkstyle-report.html">Checkstyle Report</a>
  +                                </small>
  +                              </div>
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/javadoc.html">Javadoc Report</a>
  +                                </small>
  +                              </div>
  +                            </j:if>
  +                            <util:available file="${maven.docs.dest}/clover">
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/clover/index.html">Clover Test Coverage</a>
  +                                </small>
  +                              </div>
  +                            </util:available>
  +                            <util:available file="${maven.gen.docs}/cactus-report.xml">
  +                              <div>
  +                                <small>
  +                                  <a href="${relativePath}/cactus-report.html">Cactus Tests</a>
  +                                </small>
  +                              </div>
  +                            </util:available>
  +                          </j:if>
  +                        </j:forEach>
  +                      </j:otherwise>
  +                    </j:choose>
                     </div>
  -                  <j:if test="${sourcesPresent}">
  -                    <div>
  -                      <small>
  -                        <a href="${relativePath}/apidocs/index.html">JavaDocs</a>
  -                      </small>
  -                    </div>
  -                    <div>
  -                      <small>
  -                        <a href="${relativePath}/xref/index.html">Source XReference</a>
  -                      </small>
  -                    </div>
  +                  <j:if test="${pom.reports.isEmpty()}">
  +                    <j:if test="${sourcesPresent}">
  +                      <div>
  +                        <small>
  +                          <a href="${relativePath}/apidocs/index.html">JavaDocs</a>
  +                        </small>
  +                      </div>
  +                      <div>
  +                        <small>
  +                          <a href="${relativePath}/xref/index.html">Source XReference</a>
  +                        </small>
  +                      </div>
  +                    </j:if>
                     </j:if>
                     <j:set var="devProcess" value="false"/>
                     <util:available file="${maven.docs.src}/development-process.xml">
  
  
  
  1.2       +103 -94   jakarta-turbine-maven/src/plugins-build/xdoc/src/plugin-resources/templates/maven-reports.xml
  
  Index: maven-reports.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/xdoc/src/plugin-resources/templates/maven-reports.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- maven-reports.xml	24 Jan 2003 03:45:03 -0000	1.1
  +++ maven-reports.xml	31 Jan 2003 18:25:28 -0000	1.2
  @@ -18,100 +18,109 @@
         <subsection name="Overview">
           <table>
             <tr><th>Document</th><th>Description</th></tr>
  -          <tr><td><a href="changes.html">Changes</a></td>
  -            <td>
  -              This document provides a history of the changes made to the
  -              project, in a user friendly format, generated from the
  -              xdocs/changes.xml file.
  -            </td>
  -          </tr>
  -          #if ($project.repository)
  -          <tr><td><a href="changelog-report.html">Change Log</a></td>
  -            <td>
  -              This document provides a history of the most recent
  -              changes made to the project taken directly from the
  -              source code repository.
  -            </td>
  -          </tr>
  -          <tr><td><a href="developer-activity-log.html">Developer Activity</a></td>
  -            <td>
  -              This document provides a report of activity in terms of
  -              CVS commits and breaks it out by developer.
  -            </td>
  -          </tr>
  -          <tr><td><a href="file-activity-report.html">File Activity</a></td>
  -            <td>
  -              This document provides a report of activity in terms of
  -              CVS commits and breaks it out by file.
  -            </td>
  -          </tr>
  -          #end
  -          <tr><td><a href="tasks.html">Tasks</a></td>
  -            <td>
  -              This document provides a list of tasks that need to
  -              be completed for the project, generated from the
  -              xdocs/tasks.xml file.
  -            </td>
  -          </tr>
  -          <tr><td><a href="task-list.html">Task List</a></td>
  -            <td>
  -              This document provides a list of tasks that need to
  -              be completed for the project, generated from the
  -              @task javadoc tag in java source code.
  -            </td>
  -          </tr>
  -          #if ($files.file($project.build.unitTestSourceDirectory).exists())
  -          <tr><td><a href="junit-report.html">Unit Tests</a></td>
  -            <td>
  -              This document provides the results of the unit tests that
  -              are part of this project.  Successes and failures are
  -              noted.
  -            </td>
  -          </tr>
  -          #end
  -          
  -          #if ($files.file($project.build.sourceDirectory).exists())
  -          <tr><td><a href="jdepend-report.html">Metric Results</a></td>
  -            <td>
  -              This document provides information on various source code
  -              metrics that have been computed.  These metrics can
  -              provide useful information regarding the abstractness and
  -              total number of classes.
  -            </td>
  -          </tr>
  -          <tr><td><a href="checkstyle-report.html">Checkstyle Report</a></td>
  -            <td>
  -              This document provides the results of the Checkstyle
  -              report.  This report provides an indication of how well
  -              this project complies with its coding conventions.
  -            </td>
  -          </tr>
  -          <tr><td><a href="javadoc.html">Javadoc Report</a></td>
  -            <td>
  -              This document the details of javadoc execution against
  -              the project. This encourages the reduction of javadoc
  -              errors.
  -            </td>
  -          </tr>
  -          #end
  -          
  -          #if ($files.file("$maven-docs-dest/clover").exists())
  -          <tr><td><a href="clover/index.html">Clover Test Coverage</a></td>
  -            <td>
  -              This document provides the results of the Clover report. This
  -              reports show what portion on your code has been executed by
  -              your test suite and generates statistics. It gives a very good
  -              idea of how good your test suite is.
  -            </td>
  -          </tr>
  -          #end
  -          #if ($files.file("$gen-xdocs/cactus-report.xml").exists())
  -          <tr><td><a href="cactus-report.html">Cactus Tests</a></td>
  -            <td>
  -              This document provides the results of the Cactus unit tests that
  -              are part of this project.  Successes and failures are noted.
  -            </td>
  -          </tr>
  +          #if (! $project.reports.isEmpty())
  +            #foreach ($report in $reports)
  +            <tr>
  +              <td><a href="${report.link}.html">$report.name</a></td>
  +              <td>$report.description</td>
  +            </tr>
  +            #end
  +          #else
  +            <tr><td><a href="changes.html">Changes</a></td>
  +              <td>
  +                This document provides a history of the changes made to the
  +                project, in a user friendly format, generated from the
  +                xdocs/changes.xml file.
  +              </td>
  +            </tr>
  +            #if ($project.repository)
  +            <tr><td><a href="changelog-report.html">Change Log</a></td>
  +              <td>
  +                This document provides a history of the most recent
  +                changes made to the project taken directly from the
  +                source code repository.
  +              </td>
  +            </tr>
  +            <tr><td><a href="developer-activity-log.html">Developer Activity</a></td>
  +              <td>
  +                This document provides a report of activity in terms of
  +                CVS commits and breaks it out by developer.
  +              </td>
  +            </tr>
  +            <tr><td><a href="file-activity-report.html">File Activity</a></td>
  +              <td>
  +                This document provides a report of activity in terms of
  +                CVS commits and breaks it out by file.
  +              </td>
  +            </tr>
  +            #end
  +            <tr><td><a href="tasks.html">Tasks</a></td>
  +              <td>
  +                This document provides a list of tasks that need to
  +                be completed for the project, generated from the
  +                xdocs/tasks.xml file.
  +              </td>
  +            </tr>
  +            <tr><td><a href="task-list.html">Task List</a></td>
  +              <td>
  +                This document provides a list of tasks that need to
  +                be completed for the project, generated from the
  +                @task javadoc tag in java source code.
  +              </td>
  +            </tr>
  +            #if ($files.file($project.build.unitTestSourceDirectory).exists())
  +            <tr><td><a href="junit-report.html">Unit Tests</a></td>
  +              <td>
  +                This document provides the results of the unit tests that
  +                are part of this project.  Successes and failures are
  +                noted.
  +              </td>
  +            </tr>
  +            #end
  +            
  +            #if ($files.file($project.build.sourceDirectory).exists())
  +            <tr><td><a href="jdepend-report.html">Metric Results</a></td>
  +              <td>
  +                This document provides information on various source code
  +                metrics that have been computed.  These metrics can
  +                provide useful information regarding the abstractness and
  +                total number of classes.
  +              </td>
  +            </tr>
  +            <tr><td><a href="checkstyle-report.html">Checkstyle Report</a></td>
  +              <td>
  +                This document provides the results of the Checkstyle
  +                report.  This report provides an indication of how well
  +                this project complies with its coding conventions.
  +              </td>
  +            </tr>
  +            <tr><td><a href="javadoc.html">Javadoc Report</a></td>
  +              <td>
  +                This document the details of javadoc execution against
  +                the project. This encourages the reduction of javadoc
  +                errors.
  +              </td>
  +            </tr>
  +            #end
  +            
  +            #if ($files.file("$maven-docs-dest/clover").exists())
  +            <tr><td><a href="clover/index.html">Clover Test Coverage</a></td>
  +              <td>
  +                This document provides the results of the Clover report. This
  +                reports show what portion on your code has been executed by
  +                your test suite and generates statistics. It gives a very good
  +                idea of how good your test suite is.
  +              </td>
  +            </tr>
  +            #end
  +            #if ($files.file("$gen-xdocs/cactus-report.xml").exists())
  +            <tr><td><a href="cactus-report.html">Cactus Tests</a></td>
  +              <td>
  +                This document provides the results of the Cactus unit tests that
  +                are part of this project.  Successes and failures are noted.
  +              </td>
  +            </tr>
  +            #end
             #end
           </table>
         </subsection>
  
  
  

Re: cvs commit: jakarta-turbine-maven/src/plugins-build/xdoc/src/plugin-resources/templates maven-reports.xml

Posted by Peter Donald <pe...@realityforge.org>.
On Sat, 1 Feb 2003 05:25, kaz@apache.org wrote:
> kaz         2003/01/31 10:25:28

>   Log:
>   Here is a first pass to enable users to specify what reports should
>   appear in their published site's "Project Reports" section of the
>   navbar.  Users can now specify a <reports/> section in the POM that
>   specifies exactly which reports should be included in one's site.  For
>   example:

You rock!

-- 
Cheers,

Peter Donald
*------------------------------------------------*
| Those who know how to think need no teachers.  |
|                                      - Gandhi  |     
*------------------------------------------------*