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 2004/09/28 10:41:08 UTC

cvs commit: maven-plugins/dashboard/src/plugin-resources/images trans.gif

vmassol     2004/09/28 01:41:08

  Modified:    dashboard/xdocs changes.xml
               dashboard/src/plugin-resources/templates dashboard.jsl
               dashboard/src/plugin-test maven.xml
               dashboard plugin.properties
  Added:       dashboard/src/plugin-resources/images trans.gif
  Log:
  - Added new <code>fbfiles</code> aggregator that computes FindBugs total number of files with violations. (MPDASHBOARD-13)
  - Added new <code>fbviolations</code> aggregator that computes FindBugs total number of violations. (MPDASHBOARD-13)
  - Added percentage bar graphs to the report (MPDASHBOARD-3)
  
  Revision  Changes    Path
  1.26      +11 -0     maven-plugins/dashboard/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/xdocs/changes.xml,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- changes.xml	20 Sep 2004 10:04:46 -0000	1.25
  +++ changes.xml	28 Sep 2004 08:41:06 -0000	1.26
  @@ -25,6 +25,17 @@
     </properties>
     <body>
       <release version="1.5-SNAPSHOT" date="in CVS">
  +      <action dev="vmassol" type="add" issue="MPDASHBOARD-13" due-to="Nascif Abousalh-Neto">
  +        Added new <code>fbfiles</code> aggregator that computes FindBugs total 
  +        number of files with violations.
  +      </action>
  +      <action dev="vmassol" type="add" issue="MPDASHBOARD-13" due-to="Nascif Abousalh-Neto">
  +        Added new <code>fbviolations</code> aggregator that computes FindBugs 
  +        total number of violations.
  +      </action>
  +      <action dev="vmassol" type="add" issue="MPDASHBOARD-3" due-to="Nascif Abousalh-Neto">
  +        Added percentage bar graphs to the report.
  +      </action>      
         <action dev="vmassol" type="add" issue="MPDASHBOARD-12" due-to="Thomas Recloux">
           Added new <code>jcoverageloc</code> aggregator that computes JCoverage total
           lines of code.
  
  
  
  1.7       +76 -1     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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- dashboard.jsl	21 Apr 2004 00:55:43 -0000	1.6
  +++ dashboard.jsl	28 Sep 2004 08:41:06 -0000	1.7
  @@ -25,6 +25,7 @@
     xmlns:j="jelly:core"
     xmlns:jsl="jelly:jsl"
     xmlns:x="jelly:xml"
  +  xmlns:u="jelly:util"
     xmlns="dummy" trim="false">
   
     <jsl:template match="dashboard">
  @@ -78,7 +79,81 @@
   
     <jsl:template match="aggregator">
       <td>
  -      <x:expr select="text()"/>
  +      <x:set var="str" select="string()"/>
  +      <!-- if aggregator output is a not percentage value, just print the value -->
  +      <!-- could print a different background color based on a configurable -->
  +      <!-- range, see MPDASHBOARD-2 in Jira issues for this plugin -->
  +      <j:if test="${str.trim().endsWith('%') == 'false'}">
  +        <x:expr select="text()"/> 
  +      </j:if>
  +
  +      <!-- if aggregator output is a percentage value, print a progress bar -->
  +      <j:if test="${str.trim().endsWith('%') == 'true'}">
  +
  +        <!-- convert percentage string to two complementary numbers -->
  +        <u:replace var="percentStr" value="${str}" oldChar="%" newChar=" " trim="true"/>
  +        <j:set var="percent"  value="${0 + percentStr.trim()}"/>
  +        <j:set var="cpercent" value="${100 - percent}"/>
  +
  +        <j:whitespace trim="true">
  +          <table>
  +            <j:if test="${context.getVariable('maven.dashboard.report.bar.displayLabel') == 'true'}">
  +              <tr>
  +                <x:element name="td">
  +                  <x:attribute name="colspan">2</x:attribute>
  +                  <j:expr value="${percent}%"/>
  +                </x:element>
  +              </tr>
  +            </j:if>
  +            <tr>
  +              <j:if test="${percent != '0'}">
  +                <x:element name="td">
  +                  <x:attribute name="bgcolor">
  +                    <j:expr value="${maven.dashboard.report.bar.left}"/>
  +                  </x:attribute>
  +                  <x:element name="img">
  +                    <x:attribute name="hspace">0</x:attribute>
  +                    <x:attribute name="vspace">0</x:attribute>
  +                    <x:attribute name="src">
  +                      <j:expr value="${maven.dashboard.report.bar.image}"/>
  +                    </x:attribute>
  +                    <x:attribute name="height">
  +                      <j:expr value="${maven.dashboard.report.bar.height}"/>
  +                    </x:attribute>
  +                    <x:attribute name="border">        
  +                      <j:expr value="${maven.dashboard.report.bar.border}"/>
  +                    </x:attribute>
  +                    <x:attribute name="width">${percent}</x:attribute>
  +                    <x:attribute name="alt">${percent}%</x:attribute>
  +                  </x:element>
  +                </x:element>
  +              </j:if>
  +              <j:if test="${cpercent != '0'}">
  +                <x:element name="td">
  +                  <x:attribute name="bgcolor">
  +                    <j:expr value="${maven.dashboard.report.bar.right}"/>
  +                  </x:attribute>
  +                  <x:element name="img">
  +                    <x:attribute name="hspace">0</x:attribute>
  +                    <x:attribute name="vspace">0</x:attribute>
  +                    <x:attribute name="src">
  +                      <j:expr value="${maven.dashboard.report.bar.image}"/>
  +                    </x:attribute>
  +                    <x:attribute name="height">
  +                      <j:expr value="${maven.dashboard.report.bar.height}"/>
  +                    </x:attribute>
  +                    <x:attribute name="border">        
  +                      <j:expr value="${maven.dashboard.report.bar.border}"/>
  +                    </x:attribute>
  +                    <x:attribute name="width">${cpercent}</x:attribute>
  +                    <x:attribute name="alt">${cpercent}%</x:attribute>
  +                  </x:element>
  +                </x:element>
  +              </j:if>
  +            </tr>
  +          </table>
  +        </j:whitespace>
  +      </j:if>
       </td>
     </jsl:template>
   
  
  
  
  1.8       +1 -1      maven-plugins/dashboard/src/plugin-test/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/src/plugin-test/maven.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- maven.xml	25 May 2004 07:05:46 -0000	1.7
  +++ maven.xml	28 Sep 2004 08:41:07 -0000	1.8
  @@ -49,7 +49,7 @@
           name="${maven.gen.docs}/dashboard-report.xml"/>
       <x:parse var="doc" xml="${dashboardAsFile}"/>           
   
  -    <x:set var="count" select="count($doc//table//tr)"/>
  +    <x:set var="count" select="count($doc//body/section/table/tr)"/>
       <assert:assertEquals expected="4" value="${count.intValue().toString()}"/>
   
     </goal>
  
  
  
  1.12      +28 -0     maven-plugins/dashboard/plugin.properties
  
  Index: plugin.properties
  ===================================================================
  RCS file: /home/cvs/maven-plugins/dashboard/plugin.properties,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- plugin.properties	20 Sep 2004 10:04:46 -0000	1.11
  +++ plugin.properties	28 Sep 2004 08:41:07 -0000	1.12
  @@ -60,6 +60,19 @@
   # aggregators.
   maven.dashboard.report.showempty = true
   
  +# Images used when generating the progress bar for the dashboard HTML color
  +# for left bar
  +maven.dashboard.report.bar.left = green
  +
  +# HTML color for right bar
  +maven.dashboard.report.bar.right = red
  +
  +# Image to set cells with (should be transparent)
  +maven.dashboard.report.bar.image = ${plugin.resources}/images/trans.gif
  +maven.dashboard.report.bar.height = 10
  +maven.dashboard.report.bar.border = 0
  +maven.dashboard.report.bar.displayLabel = true
  +
   # Properties for gathering dashboard data for a single project
   # ------------------------------------------------------------
   
  @@ -189,3 +202,18 @@
   maven.dashboard.aggregator.jcoverageloc.label = JCoverage LOC
   maven.dashboard.aggregator.jcoverageloc.goal = maven-jcoverage-plugin:report
   maven.dashboard.aggregator.jcoverageloc.description = JCoverage total lines of code
  +
  +# Properties for the FindBugs file violations aggregator 
  +maven.dashboard.aggregator.fbfiles.script = ${maven.dashboard.aggregators.dir}/fbfiles.jelly
  +maven.dashboard.aggregator.fbfiles.artifact = ${maven.build.dir}/findbugs-raw-report.xml
  +maven.dashboard.aggregator.fbfiles.label = FindBugs Files with Violations
  +maven.dashboard.aggregator.fbfiles.goal = maven-findbugs-plugin:report
  +maven.dashboard.aggregator.fbfiles.description = Number of files with FindBugs violations
  +
  +# Properties for the FindBugs violations aggregator 
  +maven.dashboard.aggregator.fbviolations.script = ${maven.dashboard.aggregators.dir}/fbviolations.jelly
  +maven.dashboard.aggregator.fbviolations.artifact = ${maven.build.dir}/findbugs-raw-report.xml
  +maven.dashboard.aggregator.fbviolations.label = FindBugs Violations
  +maven.dashboard.aggregator.fbviolations.goal = maven-findbugs-plugin:report
  +maven.dashboard.aggregator.fbviolations.description = Number of FindBugs violations
  +
  
  
  
  1.1                  maven-plugins/dashboard/src/plugin-resources/images/trans.gif
  
  	<<Binary file>>
  
  

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