All pastes #984989 Raw Edit

CruiseControl AntOutput Patch

public diff v1 · immutable
#984989 ·published 2008-04-14 18:13 UTC
rendered paste body
Index: C:/Eclipse3.3/workspace/cc-svn/xsl/ant.xsl===================================================================--- C:/Eclipse3.3/workspace/cc-svn/xsl/ant.xsl	(revision 3919)+++ C:/Eclipse3.3/workspace/cc-svn/xsl/ant.xsl	(working copy)@@ -1,6 +1,6 @@ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">-<xsl:output method="html" indent="yes" encoding="US-ASCII"/>-<!--+  <xsl:output method="html" indent="yes" encoding="US-ASCII"/>+  <!--    Licensed to the Apache Software Foundation (ASF) under one or more    contributor license agreements.  See the NOTICE file distributed with    this work for additional information regarding copyright ownership.@@ -17,186 +17,225 @@    limitations under the License.     -->- -<!-- +  <!--+   The purpose have this XSL is to provide a nice way to look at the output   from the Ant XmlLogger (ie: ant -listener org.apache.tools.ant.XmlLogger )      @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a>    -->-<xsl:decimal-format decimal-separator="." grouping-separator="," />+  <xsl:decimal-format decimal-separator="." grouping-separator="," /> -<xsl:template match="/">-<html>-  <head>-    <style type="text/css">-    .bannercell {-      border: 0px;-      padding: 0px;-    }-    body {-      margin: 0;-      font:normal 100% arial,helvetica,sanserif;-      background-color:#FFFFFF;-      color:#000000;-    }-    table.status {-      font:bold 80% arial,helvetica,sanserif;-      background-color:#525D76;-      color:#ffffff;-    }-    table.log tr td, tr th {-      font-size: 80%;-    }-    .error {-      color:red;-    }-    .warn {-      color:brown;-    }-    .info {-      color:gray;-    }-    .debug{-      color:gray;-    }-    .failed {-      font-size:80%;-      background-color: red;-      color:#FFFFFF;-      font-weight: bold-    }-    .complete {-      font-size:80%;-      background-color: #525D76;-      color:#FFFFFF;-      font-weight: bold-    }-    .a td { -      background: #efefef;-    }-    .b td { -      background: #fff;-    }-    th, td {-      text-align: left;-      vertical-align: top;-    }-    th {-      background: #ccc;-      color: black;-    }-    table, th, td {-      border: none-    }-    h3 {-      font:bold 80% arial,helvetica,sanserif;-      background: #525D76;-      color: white;-      text-decoration: none;-      padding: 5px;-      margin-right: 2px;-      margin-left: 2px;-      margin-bottom: 0;-    }-    </style>-  </head>-  <body>-    <!-- jakarta logo -->-    <table border="0" cellpadding="0" cellspacing="0" width="100%">-    <tr>-      <td valign="top" class="bannercell">-        <a href="http://jakarta.apache.org/">-        <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>-        </a>-      </td>-      <td style="text-align:right;vertical-align:bottom">-        <a href="http://ant.apache.org/">Apache Ant</a>-      </td>-    </tr>-    </table>-      -    <table border="0" width="100%">-    <tr><td><hr noshade="yes" size="1"/></td></tr>-    </table>+  <xsl:template match="/">+         <style type="text/css">+           #ant_output {+           max-height: 650px;+           }+           +           #ant_output_container .bannercell {+           border: 0px;+           padding: 0px;+           } -    <xsl:apply-templates select="cruisecontrol/build"/>+           #ant_output_container {+           font-family: verdana;+           font-size: 13px;+           background-color:#FFFFFF;+           color:#000000;+           } -  </body>-</html>-</xsl:template>+           #ant_output_container table.status {+           background-color:#525D76;+           color:#ffffff;+           } -<xsl:template match="build">-  <!-- build status -->-  <table width="100%">-    <xsl:attribute name="class">-      <xsl:if test="@error">failed</xsl:if>-      <xsl:if test="not(@error)">complete</xsl:if>-    </xsl:attribute>-    <tr>-      <xsl:if test="@error">-        <td nowrap="yes">Build Failed</td> -      </xsl:if>-      <xsl:if test="not(@error)">-        <td nowrap="yes">Build Complete</td>-      </xsl:if>-        <td style="text-align:right" nowrap="yes">Total Time: <xsl:value-of select="@time"/></td>-    </tr>-    <tr>-      <td colspan="2">+           #ant_output_container table.log {++           }++           #ant_output_container table.log tr td, tr th {++           }++           #ant_output_container .error {+           color:red;+           }++           #ant_output_container .warn {+           color:brown;+           }++           #ant_output_container .info {+           color:gray;+           }++           #ant_output_container .debug{+           color:gray;+           }++           #ant_output_container .failed {+           background-color: red;+           color:#FFFFFF;+           font-weight: bold+           }++           #ant_output_container .complete {+           background-color: #525D76;+           color:#FFFFFF;+           font-weight: bold+           }++           #ant_output_container .a td {+           background: #f7f7f7;+           }++           #ant_output_container .b td {+           background: #fff;+           }++           #ant_output_container th, td {+           text-align: left;+           vertical-align: top;+           }++           #ant_output_container th {+           background: #ccc;+           color: black;+           }++           #ant_output_container table, th, td {+           border-color: #fff;+           border-width: 0 0 0 0;+           border-style: none;+           padding: 2px;+           }++           #ant_output_container h3 {+           font: bold 13px verdana;+           background: #525D76;+           color: white;+           text-decoration: none;+           padding: 5px;+           margin-right: 0;+           margin-left: 0;+           margin-bottom: 0;+           margin-top: 10px;+           }+         </style>+    +        <div id="ant_output_container">++        <xsl:apply-templates select="cruisecontrol/build"/>+        </div>+  </xsl:template>++  <xsl:template match="build">+    <!-- build status -->+    <table width="100%">+      <xsl:attribute name="class">+        <xsl:if test="@error">failed</xsl:if>+        <xsl:if test="not(@error)">complete</xsl:if>+      </xsl:attribute>+      <tr>         <xsl:if test="@error">-          <tt><xsl:value-of select="@error"/></tt><br/>-          <i style="font-size:80%">See the <a href="#stacktrace" alt="Click for details">stacktrace</a>.</i>+          <td nowrap="yes">Build Failed</td>         </xsl:if>+        <xsl:if test="not(@error)">+          <td nowrap="yes">Build Complete</td>+        </xsl:if>+        <td style="text-align:right" nowrap="yes">+          Total Time: <xsl:value-of select="@time"/>+        </td>+      </tr>+      <tr>+        <td colspan="2">+          <xsl:if test="@error">+            <tt>+              <xsl:value-of select="@error"/>+            </tt>+            <br/>+            <i style="font-size:80%">+              See the <a href="#stacktrace" alt="Click for details">stacktrace</a>.+            </i>+          </xsl:if>+        </td>+      </tr>++    </table>+    <table border="1" cellspacing="2" cellpadding="3" width="100%" style="font-size:80%">+      <tr class="a">+        <td width="1">ant.file</td>+        <td>+          <xsl:value-of select="substring-after(//message[contains(text(),'ant.file')], '->')"/>+        </td>+      </tr>+      <tr class="b">+        <td width="1">ant.version</td>+        <td>+          <xsl:value-of select="substring-after(//message[contains(text(),'ant.version')], '->')"/>+        </td>+      </tr>+      <tr class="a">+        <td width="1">java.version</td>+        <td>+          <xsl:value-of select="substring-after(//message[contains(text(),'java.vm.version')], '->')"/>+        </td>+      </tr>+      <tr class="b">+        <td width="1">os.name</td>+        <td>+          <xsl:value-of select="substring-after(//message[contains(text(),'os.name')], '->')"/>+        </td>+      </tr>+    </table>+    <!-- build information -->+    <h3>Build events</h3>+    <table class="log" border="1" cellspacing="2" cellpadding="3" width="100%">+      <tr>+        <th nowrap="yes" align="left" width="1%">target</th>+        <th nowrap="yes" align="left" width="1%">task</th>+        <th nowrap="yes" align="left">message</th>+      </tr>+      <xsl:apply-templates select=".//message[@priority != 'debug']"/>+    </table>+    <p>+      <!-- stacktrace -->+      <xsl:if test="stacktrace">+        <a name="stacktrace"/>+        <h3>Error details</h3>+        <table width="100%">+          <tr>+            <td>+              <pre>+                <xsl:value-of select="stacktrace"/>+              </pre>+            </td>+          </tr>+        </table>+      </xsl:if>+    </p>+  </xsl:template>++  <!-- report every message but those with debug priority -->+  <xsl:template match="message[@priority!='debug']">+    <tr valign="top">+      <!-- alternated row style -->+      <xsl:attribute name="class">+        <xsl:if test="position() mod 2 = 1">a</xsl:if>+        <xsl:if test="position() mod 2 = 0">b</xsl:if>+      </xsl:attribute>+      <td nowrap="yes" width="1%">+        <xsl:value-of select="../../@name"/>       </td>+      <td nowrap="yes" style="text-align:right" width="1%">+        [ <xsl:value-of select="../@name"/> ]+      </td>+      <td class="{@priority}" nowrap="yes">+        <xsl:value-of select="text()"/>+      </td>     </tr>-  </table>-  <table border="1" cellspacing="2" cellpadding="3" width="100%" style="font-size:80%">-    <tr class="a"><td width="1">ant.file</td><td><xsl:value-of select="substring-after(//message[contains(text(),'ant.file')], '->')"/></td></tr>-    <tr class="b"><td width="1">ant.version</td><td><xsl:value-of select="substring-after(//message[contains(text(),'ant.version')], '->')"/></td></tr>-    <tr class="a"><td width="1">java.version</td><td><xsl:value-of select="substring-after(//message[contains(text(),'java.vm.version')], '->')"/></td></tr>-    <tr class="b"><td width="1">os.name</td><td><xsl:value-of select="substring-after(//message[contains(text(),'os.name')], '->')"/></td></tr>-  </table>-  <!-- build information -->-  <h3>Build events</h3>-  <table class="log" border="1" cellspacing="2" cellpadding="3" width="100%">-  <tr>-    <th nowrap="yes" align="left" width="1%">target</th>-    <th nowrap="yes" align="left" width="1%">task</th>-    <th nowrap="yes" align="left">message</th>-  </tr>-  <xsl:apply-templates select=".//message[@priority != 'debug']"/>-  </table>-  <p>-  <!-- stacktrace -->-  <xsl:if test="stacktrace">-  <a name="stacktrace"/>-  <h3>Error details</h3>-  <table width="100%">-    <tr><td>-      <pre><xsl:value-of select="stacktrace"/></pre>-    </td></tr>-  </table>-  </xsl:if>-  </p>-</xsl:template>+  </xsl:template> -<!-- report every message but those with debug priority -->-<xsl:template match="message[@priority!='debug']">-  <tr valign="top">-    <!-- alternated row style -->-    <xsl:attribute name="class">-      <xsl:if test="position() mod 2 = 1">a</xsl:if>-      <xsl:if test="position() mod 2 = 0">b</xsl:if>-    </xsl:attribute>-    <td nowrap="yes" width="1%"><xsl:value-of select="../../@name"/></td>-    <td nowrap="yes" style="text-align:right" width="1%">[ <xsl:value-of select="../@name"/> ]</td>-    <td class="{@priority}" nowrap="yes">-            <xsl:value-of select="text()"/>-    </td>-  </tr>-</xsl:template>--</xsl:stylesheet>+</xsl:stylesheet>\ No newline at end of fileIndex: C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/service/WidgetPluginService.java===================================================================--- C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/service/WidgetPluginService.java	(revision 3919)+++ C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/service/WidgetPluginService.java	(working copy)@@ -82,5 +82,7 @@         parameters.put(Widget.PARAM_PJT_LOG_ROOT, build.getLogFolder());         parameters.put(Widget.PARAM_BUILD_LOG_FILE, build.getLogFile());         parameters.put(Widget.PARAM_BUILD_ARTIFACTS_ROOT, build.getArtifactFolder());+        //Hardcode PARAM_CC_ROOT for now - CC Devs, is there a good place to pull this from?+        parameters.put(Widget.PARAM_CC_ROOT, "c:\\program files\\CruiseControl");     } }Index: C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/widgets/AbstractXslOutputWidget.java===================================================================--- C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/widgets/AbstractXslOutputWidget.java	(revision 3919)+++ C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/widgets/AbstractXslOutputWidget.java	(working copy)@@ -35,9 +35,9 @@     }      public Object getOutput(Map parameters) {-        File logFile = (File) parameters.get(Widget.PARAM_BUILD_LOG_FILE);+        File logFile = new File( (String)parameters.get(Widget.PARAM_BUILD_LOG_FILE) );         try {-            File ccHome = (File) parameters.get(Widget.PARAM_CC_ROOT);+            File ccHome = new File( (String)parameters.get(Widget.PARAM_CC_ROOT) );             File xsl = new File(ccHome.getCanonicalPath() + "/" + getXslPath());             Source xmlSource = new StreamSource(logFile);             Source xsltSource = new StreamSource(xsl);