You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by vm...@apache.org on 2003/11/05 20:26:59 UTC

cvs commit: maven-plugins/dashboard/sample project.properties

vmassol     2003/11/05 11:26:59

  Modified:    dashboard/sample/subproject1/src/java/org/apache/maven/dashboard/sample/subproject1
                        Sample.java
               dashboard/xdocs navigation.xml index.xml properties.xml
               dashboard/sample/subproject1 .cvsignore project.xml
               dashboard plugin.properties plugin.jelly
               dashboard/src/plugin-resources/templates dashboard.jsl
               dashboard/sample project.properties
  Added:       dashboard/sample/subproject1/src/test/org/apache/maven/dashboard/sample/subproject1
                        TestSample.java
               dashboard/src/plugin-resources/reports cloverloc.jelly
                        clovertpc.jelly csall.jelly cswarnings.jelly
                        cserrors.jelly cloverncloc.jelly
               dashboard/xdocs aggregators.xml
               dashboard/src/main/org/apache/maven/dashboard/aggregator/clover
                        CloverTPC.java
  Removed:     dashboard/src/plugin-resources/reports checkstyle.jelly
  Log:
  - Renamed probes/reports into aggregators
  - Added several other aggregators
  - Do not run report artifact goal if it has already been run by a previous aggregator
  
  Revision  Changes    Path
  1.2       +5 -1      maven-plugins/dashboard/sample/subproject1/src/java/org/apache/maven/dashboard/sample/subproject1/Sample.java
  
  Index: Sample.java
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/sample/subproject1/src/java/org/apache/maven/dashboard/sample/subproject1/Sample.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Sample.java	4 Nov 2003 21:11:31 -0000	1.1
  +++ Sample.java	5 Nov 2003 19:26:58 -0000	1.2
  @@ -65,6 +65,10 @@
    */
   public class Sample
   {
  +    public void unusedMethod()
  +    {
  +    }
  +    
       public void someMethod()
       {
           new Boolean(true);
  
  
  
  1.1                  maven-plugins/dashboard/sample/subproject1/src/test/org/apache/maven/dashboard/sample/subproject1/TestSample.java
  
  Index: TestSample.java
  ===================================================================
  package org.apache.maven.dashboard.sample.subproject1;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Maven" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Maven", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  import junit.framework.TestCase;
  
  /**
   * Sample test for {@link Sample} to test the Clover aggregator.
   *
   * @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
   *
   * @version $Id: TestSample.java,v 1.1 2003/11/05 19:26:58 vmassol Exp $
   */
  public class TestSample extends TestCase
  {
      public void testSomeMethod()
      {
          Sample sample = new Sample();
          sample.someMethod();
      }   
  }
  
  
  1.1                  maven-plugins/dashboard/src/plugin-resources/reports/cloverloc.jelly
  
  Index: cloverloc.jelly
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
     ========================================================================
       Clover aggregator. Extracts total line of code (LOC) from Clover 
       raw file.
     ========================================================================
  -->
  <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
  
    <!-- Extract LOC -->
  
    <u:file var="artifactAsFile" 
        name="${maven.dashboard.aggregator.cloverloc.artifact}"/>
    <j:choose>
      <j:when test="${artifactAsFile.exists()}">
  
        <x:parse var="doc" xml="${artifactAsFile}"/>
        <x:expr select="string($doc/coverage/project/metrics/@loc)"/>
  
      </j:when>
      <j:otherwise>
        <j:expr value="-"/>
      </j:otherwise>
    </j:choose>
  
  </j:jelly>
  
  
  1.1                  maven-plugins/dashboard/src/plugin-resources/reports/clovertpc.jelly
  
  Index: clovertpc.jelly
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
     ========================================================================
       Clover aggregator. Extracts total coverage percentage from Clover 
       raw file.
     ========================================================================
  -->
  <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
  
    <!-- Extract total coverage percentage -->
  
    <u:file var="artifactAsFile" 
        name="${maven.dashboard.aggregator.clovertpc.artifact}"/>
    <j:choose>
      <j:when test="${artifactAsFile.exists()}">
  
        <x:parse var="doc" xml="${artifactAsFile}"/>
  
        <x:set var="coveredelements" 
            select="string($doc/coverage/project/metrics/@coveredelements)"/>
        <x:set var="elements" 
            select="string($doc/coverage/project/metrics/@elements)"/>
  
        <j:useBean var="tpc"
            class="org.apache.maven.dashboard.aggregator.clover.CloverTPC"/>
        <j:expr value="${tpc.computeTPC(elements, coveredelements)}"/>
  
      </j:when>
      <j:otherwise>
        <j:expr value="-"/>
      </j:otherwise>
    </j:choose>
  
  </j:jelly>
  
  
  1.1                  maven-plugins/dashboard/src/plugin-resources/reports/csall.jelly
  
  Index: csall.jelly
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
     ========================================================================
       Checkstyle aggregator. Extracts error count from Checkstyle raw XML 
       file.
     ========================================================================
  -->
  <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
  
    <u:file var="artifactAsFile" 
        name="${maven.dashboard.aggregator.csall.artifact}"/>
    <j:choose>
      <j:when test="${artifactAsFile.exists()}">
        <x:parse var="doc" xml="${artifactAsFile}"/>
        <x:expr select="count($doc//error)"/>
      </j:when>
      <j:otherwise>
        <j:expr value="-"/>
      </j:otherwise>
    </j:choose>
  
  </j:jelly>
  
  
  1.1                  maven-plugins/dashboard/src/plugin-resources/reports/cswarnings.jelly
  
  Index: cswarnings.jelly
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
     ========================================================================
       Checkstyle error aggregator. Extracts warning count from Checkstyle 
       raw XML file (does not count errors).
     ========================================================================
  -->
  <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
  
    <u:file var="artifactAsFile" 
        name="${maven.dashboard.aggregator.cserrors.artifact}"/>
    <j:choose>
      <j:when test="${artifactAsFile.exists()}">
        <x:parse var="doc" xml="${artifactAsFile}"/>
        <x:expr select="count($doc//error[@severity = 'warning'])"/>
      </j:when>
      <j:otherwise>
        <j:expr value="-"/>
      </j:otherwise>
    </j:choose>
  
  </j:jelly>
  
  
  1.1                  maven-plugins/dashboard/src/plugin-resources/reports/cserrors.jelly
  
  Index: cserrors.jelly
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
     ========================================================================
       Checkstyle error aggregator. Extracts error count from Checkstyle raw 
       XML file (does not count warnings).
     ========================================================================
  -->
  <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
  
    <u:file var="artifactAsFile" 
        name="${maven.dashboard.aggregator.cserrors.artifact}"/>
    <j:choose>
      <j:when test="${artifactAsFile.exists()}">
        <x:parse var="doc" xml="${artifactAsFile}"/>
        <x:expr select="count($doc//error[@severity = 'error'])"/>
      </j:when>
      <j:otherwise>
        <j:expr value="-"/>
      </j:otherwise>
    </j:choose>
  
  </j:jelly>
  
  
  1.1                  maven-plugins/dashboard/src/plugin-resources/reports/cloverncloc.jelly
  
  Index: cloverncloc.jelly
  ===================================================================
  <?xml version="1.0"?>
  
  <!--
     ========================================================================
       Clover aggregator. Extracts total non-commented lines of code (NCLOC) 
       from Clover raw file.
     ========================================================================
  -->
  <j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:u="jelly:util">
  
    <!-- Extract NCLOC -->
  
    <u:file var="artifactAsFile" 
        name="${maven.dashboard.aggregator.cloverncloc.artifact}"/>
    <j:choose>
      <j:when test="${artifactAsFile.exists()}">
  
        <x:parse var="doc" xml="${artifactAsFile}"/>
        <x:expr select="string($doc/coverage/project/metrics/@ncloc)"/>
  
      </j:when>
      <j:otherwise>
        <j:expr value="-"/>
      </j:otherwise>
    </j:choose>
  
  </j:jelly>
  
  
  1.2       +1 -0      maven-plugins/dashboard/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/xdocs/navigation.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- navigation.xml	4 Nov 2003 21:11:31 -0000	1.1
  +++ navigation.xml	5 Nov 2003 19:26:58 -0000	1.2
  @@ -10,6 +10,7 @@
       <menu name="Overview">
         <item name="Goals" href="/goals.html"/>
         <item name="Properties" href="/properties.html"/>
  +      <item name="Aggregators" href="/aggregators.html"/>
       </menu>
     </body>
   </project>
  
  
  
  1.2       +10 -7     maven-plugins/dashboard/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/xdocs/index.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.xml	4 Nov 2003 21:11:31 -0000	1.1
  +++ index.xml	5 Nov 2003 19:26:59 -0000	1.2
  @@ -19,14 +19,17 @@
         </p>
         <ul>
           <li>
  -          Pluggable architecture. It allows to add custom probes for any
  +          Pluggable architecture. It allows to add custom aggregators for any
             kind of report, be them Maven reports or anything else (like 
  -          calling an SCM system, calling JIRA, etc). A probe is actually a
  -          Jelly script so that you have the full power of Jelly at your hand.
  +          calling an SCM system, calling JIRA, etc). An aggregator is actually 
  +          a Jelly script so that you have the full power of Jelly at your hand.
           </li>
           <li>
  -          Provides a default probe for gathering the number of Checkstyle 
  -          errors in subprojects.
  +          Provides <a href="aggregators.html">default aggregators</a>.
  +        </li>
  +        <li>
  +          Allows tight integration in one's own custom reactor and prevents
  +          running reports several times.
           </li>
         </ul>
       </section>
  @@ -72,8 +75,8 @@
             To do this, you need to add the <code>dashboard:report-single</code> 
             goal to the list of goals being run by your reactor. The best option 
             is to ensure this goal is run after the other goals generating the 
  -          report artifacts needed by the dashboard probes you're running. In 
  -          order to prevent the <code>dashboard:report-single</code> goal from
  +          report artifacts needed by the dashboard aggregators you're running. 
  +          In order to prevent the <code>dashboard:report-single</code> goal from
             automatically calling the report artifact goals, you'll need to add
             the following property: <code>maven.dashboard.rungoals = false</code>.
           </p>
  
  
  
  1.2       +9 -9      maven-plugins/dashboard/xdocs/properties.xml
  
  Index: properties.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/xdocs/properties.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- properties.xml	4 Nov 2003 21:11:31 -0000	1.1
  +++ properties.xml	5 Nov 2003 19:26:59 -0000	1.2
  @@ -38,17 +38,17 @@
   # Properties for gathering dashboard data for a single project
   # ------------------------------------------------------------
   
  -# Location of default dashboard adaptors
  -maven.dashboard.reports.dir = ${plugin.resources}/reports
  +# Location of default dashboard aggregators
  +maven.dashboard.aggregators.dir = ${plugin.resources}/reports
   
  -# List of reports to aggregate
  -maven.dashboard.reports = checkstyle
  +# Comma-separated list of aggregators to use
  +maven.dashboard.aggregators = checkstyle
   
  -# Properties for the default checkstyle adaptor
  -maven.dashboard.report.checkstyle.script = ${maven.dashboard.reports.dir}/checkstyle.jelly
  -maven.dashboard.report.checkstyle.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
  -maven.dashboard.report.checkstyle.label = Checkstyle errors
  -maven.dashboard.report.checkstyle.goal = checkstyle
  +# Properties for the default checkstyle aggregator
  +maven.dashboard.aggregator.checkstyle.script = ${maven.dashboard.aggregators.dir}/checkstyle.jelly
  +maven.dashboard.aggregator.checkstyle.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
  +maven.dashboard.aggregator.checkstyle.label = Checkstyle errors
  +maven.dashboard.aggregator.checkstyle.goal = checkstyle
   
   # Generated dashboard data for a single project
   maven.dashboard.report.single = ${maven.build.dir}/dashboard-single.xml
  
  
  
  1.1                  maven-plugins/dashboard/xdocs/aggregators.xml
  
  Index: aggregators.xml
  ===================================================================
  <?xml version="1.0"?>
  <document>
  
    <properties>
      <title>Maven Dashboard aggregators</title>
      <author email="vmassol@apache.org">Vincent Massol</author>
    </properties>
  
    <body>
      <section name="Maven Dashboard aggregators">
        <p>
          An aggregator is an extension to the dashboard that gathers 
          metric information that get displayed in the dashboard report.
          You can provide your own custom aggregators. The dashboard plugin
          comes with several default aggregators described below.
        </p>
        <table>
          <tr>
            <th>Aggregator name</th>
            <th>Topic</th>
            <th>Description</th>
          </tr>
          <tr>
            <td>csall</td>
            <td>Checkstyle</td>
            <td>
              Computes total number of Checkstyle warnings and errors.
            </td>
          </tr>
          <tr>
            <td>cserrors</td>
            <td>Checkstyle</td>
            <td>
              Computes total number of Checkstyle errors.
            </td>
          </tr>
          <tr>
            <td>cswarnings</td>
            <td>Checkstyle</td>
            <td>
              Computes total number of Checkstyle warnings.
            </td>
          </tr>
          <tr>
            <td>clovertpc</td>
            <td>Clover</td>
            <td>
              Computes total Test Coverage Percentage (TPC) using Clover.
            </td>
          </tr>
          <tr>
            <td>cloverloc</td>
            <td>Clover</td>
            <td>
              Computes total Line Of Code (LOC) using Clover.
            </td>
          </tr>
          <tr>
            <td>cloverncloc</td>
            <td>Clover</td>
            <td>
              Computes total Non-Commented Line Of Code (NCLOC) using Clover.
            </td>
          </tr>
        </table>
      </section>
   </body>
  </document>
  
  
  
  1.2       +1 -0      maven-plugins/dashboard/sample/subproject1/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/sample/subproject1/.cvsignore,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .cvsignore	5 Nov 2003 14:07:23 -0000	1.1
  +++ .cvsignore	5 Nov 2003 19:26:59 -0000	1.2
  @@ -1,2 +1,3 @@
   target
   maven.log
  +velocity.log
  
  
  
  1.2       +7 -0      maven-plugins/dashboard/sample/subproject1/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/sample/subproject1/project.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.xml	4 Nov 2003 21:11:31 -0000	1.1
  +++ project.xml	5 Nov 2003 19:26:59 -0000	1.2
  @@ -56,10 +56,17 @@
     <!-- build information for the project -->
     <build>
       <sourceDirectory>src/java</sourceDirectory>
  +    <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
  +    <unitTest>
  +      <includes>
  +        <include>**/Test*.java</include>
  +      </includes>
  +    </unitTest>
     </build>
   
     <reports>
       <report>maven-checkstyle-plugin</report>
  +    <report>maven-clover-plugin</report>
     </reports>
   
   </project>
  
  
  
  1.2       +39 -9     maven-plugins/dashboard/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/plugin.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- plugin.properties	4 Nov 2003 21:11:31 -0000	1.1
  +++ plugin.properties	5 Nov 2003 19:26:59 -0000	1.2
  @@ -35,17 +35,47 @@
   # Properties for gathering dashboard data for a single project
   # ------------------------------------------------------------
   
  -# Location of default dashboard adaptors
  -maven.dashboard.reports.dir = ${plugin.resources}/reports
  +# Location of default dashboard aggregators
  +maven.dashboard.aggregators.dir = ${plugin.resources}/reports
   
  -# List of reports to aggregate
  -maven.dashboard.reports = checkstyle
  +# Comma-separated list of aggregators to use
  +maven.dashboard.aggregators = cserrors,cswarnings,clovertpc,cloverloc,cloverncloc
   
  -# Properties for the default checkstyle adaptor
  -maven.dashboard.report.checkstyle.script = ${maven.dashboard.reports.dir}/checkstyle.jelly
  -maven.dashboard.report.checkstyle.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
  -maven.dashboard.report.checkstyle.label = Checkstyle errors
  -maven.dashboard.report.checkstyle.goal = checkstyle
  +# Properties for the Checkstyle error/warning aggregator (all errors/warnings)
  +maven.dashboard.aggregator.csall.script = ${maven.dashboard.aggregators.dir}/csall.jelly
  +maven.dashboard.aggregator.csall.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
  +maven.dashboard.aggregator.csall.label = CS err/warn
  +maven.dashboard.aggregator.csall.goal = checkstyle
  +
  +# Properties for the Checkstyle error aggregator (only errors)
  +maven.dashboard.aggregator.cserrors.script = ${maven.dashboard.aggregators.dir}/cserrors.jelly
  +maven.dashboard.aggregator.cserrors.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
  +maven.dashboard.aggregator.cserrors.label = CS errors
  +maven.dashboard.aggregator.cserrors.goal = checkstyle
  +
  +# Properties for the Checkstyle warning aggregator (only warnings)
  +maven.dashboard.aggregator.cswarnings.script = ${maven.dashboard.aggregators.dir}/cswarnings.jelly
  +maven.dashboard.aggregator.cswarnings.artifact = ${maven.build.dir}/checkstyle-raw-report.xml
  +maven.dashboard.aggregator.cswarnings.label = CS warnings
  +maven.dashboard.aggregator.cswarnings.goal = checkstyle
  +
  +# Properties for the Clover TPC aggregator (TPC = Total Percent Coverage)
  +maven.dashboard.aggregator.clovertpc.script = ${maven.dashboard.aggregators.dir}/clovertpc.jelly
  +maven.dashboard.aggregator.clovertpc.artifact = ${maven.build.dir}/clover.xml
  +maven.dashboard.aggregator.clovertpc.label = Clover TPC
  +maven.dashboard.aggregator.clovertpc.goal = clover
  +
  +# Properties for the Clover LOC aggregator (LOC = Line Of Code)
  +maven.dashboard.aggregator.cloverloc.script = ${maven.dashboard.aggregators.dir}/cloverloc.jelly
  +maven.dashboard.aggregator.cloverloc.artifact = ${maven.build.dir}/clover.xml
  +maven.dashboard.aggregator.cloverloc.label = Clover LOC
  +maven.dashboard.aggregator.cloverloc.goal = clover
  +
  +# Properties for the Clover NCLOC aggregator (NCLOC = Non Comment Line Of Code)
  +maven.dashboard.aggregator.cloverncloc.script = ${maven.dashboard.aggregators.dir}/cloverncloc.jelly
  +maven.dashboard.aggregator.cloverncloc.artifact = ${maven.build.dir}/clover.xml
  +maven.dashboard.aggregator.cloverncloc.label = Clover NCLOC
  +maven.dashboard.aggregator.cloverncloc.goal = clover
   
   # Generated dashboard data for a single project
   maven.dashboard.report.single = ${maven.build.dir}/dashboard-single.xml
  
  
  
  1.2       +24 -11    maven-plugins/dashboard/plugin.jelly
  
  Index: plugin.jelly
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/plugin.jelly,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- plugin.jelly	4 Nov 2003 21:11:31 -0000	1.1
  +++ plugin.jelly	5 Nov 2003 19:26:59 -0000	1.2
  @@ -83,7 +83,7 @@
               <u:file var="dashboardAsFile" 
                   name="${reactorProject.context.getVariable('maven.build.dir')}/dashboard-single.xml"/>
               <x:parse var="doc" xml="${dashboardAsFile}"/>           
  -            <x:copyOf select="$doc//report"/>
  +            <x:copyOf select="$doc//aggregator"/>
   
             </x:element>        
           </j:forEach>
  @@ -122,32 +122,45 @@
       <a:dirname property="singleReportDir" file="${maven.dashboard.report.single}"/>
       <a:mkdir dir="${singleReportDir}"/>
   
  -    <u:tokenize var="reportNames" delim=",">${maven.dashboard.reports}</u:tokenize>
  +    <u:tokenize var="aggregatorNames" delim=",">${maven.dashboard.aggregators}</u:tokenize>
   
  +    <!-- Property used to remember what goals have already been called -->
  +    <j:set var="executedGoals" value=""/>
  +    
       <!-- For each report, call the goal associated with the report type so that
            raw data for that report type are generated. For example the checkstyle 
            report type will call checkstyle:checkstyle -->
       <j:set var="rungoals" value="${maven.dashboard.rungoals}"/>
       <j:if test="${rungoals == 'true'}">
  -      <j:forEach var="reportName" items="${reportNames}">
  +      <j:forEach var="aggregatorName" items="${aggregatorNames}">
  +
           <j:set var="goalProperty" 
  -            value="maven.dashboard.report.${reportName}.goal"/>
  -        <attainGoal name="${context.getVariable(goalProperty)}"/>
  +            value="maven.dashboard.aggregator.${aggregatorName}.goal"/>
  +
  +        <!-- Only run if the artifact has not already been created by
  +             a previous goal run -->
  +        <j:if test="${executedGoals.indexOf(context.getVariable(goalProperty)) == '-1'}">
  +          <attainGoal name="${context.getVariable(goalProperty)}"/>
  +        </j:if>
  +
  +        <j:set var="executedGoals" 
  +            value="${goalProperty},${executedGoals}"/>
  +
         </j:forEach>
       </j:if>
   
       <j:file name="${maven.dashboard.report.single}" prettyPrint="true" 
           xmlns="dashboard">
         <dashboard-single>
  -        <j:forEach var="reportName" items="${reportNames}">
  -          <x:element name="report">
  +        <j:forEach var="aggregatorName" items="${aggregatorNames}">
  +          <x:element name="aggregator">
   
  -            <!-- Add report name -->
  -            <x:attribute name="name">${reportName}</x:attribute>
  +            <!-- Add aggregator name -->
  +            <x:attribute name="name">${aggregatorName}</x:attribute>
   
  -            <!-- Add report content -->
  +            <!-- Add aggregator content -->
               <j:set var="scriptProperty" 
  -                value="maven.dashboard.report.${reportName}.script"/>
  +                value="maven.dashboard.aggregator.${aggregatorName}.script"/>
               <j:import file="${context.getVariable(scriptProperty)}"
                   inherit="true"/>
   
  
  
  
  1.1                  maven-plugins/dashboard/src/main/org/apache/maven/dashboard/aggregator/clover/CloverTPC.java
  
  Index: CloverTPC.java
  ===================================================================
  package org.apache.maven.dashboard.aggregator.clover;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Maven" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Maven", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   * ====================================================================
   */
  
  import java.text.DecimalFormat;
  
  /**
   * @author <a href="mailto:vmassol@apache.org">Vincent Massol</a>
   *
   * @version $Id: CloverTPC.java,v 1.1 2003/11/05 19:26:59 vmassol Exp $
   */
  public class CloverTPC
  {
      public static String computeTPC(String elements, String coveredElements)
      {
          double e = Double.valueOf(elements).doubleValue();
          double ce = Double.valueOf(coveredElements).doubleValue();
          DecimalFormat formatter = new DecimalFormat("##%");
          return formatter.format(ce/e);
      }   
  }
  
  
  1.2       +4 -4      maven-plugins/dashboard/src/plugin-resources/templates/dashboard.jsl
  
  Index: dashboard.jsl
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/src/plugin-resources/templates/dashboard.jsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- dashboard.jsl	4 Nov 2003 21:11:32 -0000	1.1
  +++ dashboard.jsl	5 Nov 2003 19:26:59 -0000	1.2
  @@ -17,10 +17,10 @@
             <table>
               <tr>
                 <th>Project</th>
  -              <x:forEach var="reportName" select="project[1]/report/@name">
  +              <x:forEach var="aggregatorName" select="project[1]/aggregator/@name">
                   <th>
                     <j:set var="labelProperty" 
  -                      value="maven.dashboard.report.${reportName.value}.label"/>
  +                      value="maven.dashboard.aggregator.${aggregatorName.value}.label"/>
                     <j:expr value="${context.getVariable(labelProperty)}"/>
                   </th>
                 </x:forEach>
  @@ -35,11 +35,11 @@
     <jsl:template match="project">
       <tr>
         <td><x:expr select="@name"/></td>
  -      <jsl:applyTemplates select="report"/>
  +      <jsl:applyTemplates select="aggregator"/>
       </tr>
     </jsl:template>
   
  -  <jsl:template match="report">
  +  <jsl:template match="aggregator">
       <td>
         <x:expr select="text()"/>
       </td>
  
  
  
  1.2       +5 -0      maven-plugins/dashboard/sample/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/sample/project.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.properties	4 Nov 2003 21:11:31 -0000	1.1
  +++ project.properties	5 Nov 2003 19:26:59 -0000	1.2
  @@ -4,3 +4,8 @@
   maven.xdoc.date=left
   maven.xdoc.version=${pom.currentVersion}
   maven.checkstyle.header.file = ${basedir}/../../LICENSE.txt
  +
  +# Required to generate XML clover report
  +maven.clover.report.xml = true
  +
  +maven.dashboard.aggregators = csall,cserrors,cswarnings,clovertpc,cloverloc,cloverncloc
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org