Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

CruiseControl AntOutput Patch
Monday, April 14th, 2008 at 12:13:11pm MDT 

  1. Index: C:/Eclipse3.3/workspace/cc-svn/xsl/ant.xsl
  2. ===================================================================
  3. --- C:/Eclipse3.3/workspace/cc-svn/xsl/ant.xsl  (revision 3919)
  4. +++ C:/Eclipse3.3/workspace/cc-svn/xsl/ant.xsl  (working copy)
  5. @@ -1,6 +1,6 @@
  6.  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  7. -<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
  8. -<!--
  9. +  <xsl:output method="html" indent="yes" encoding="US-ASCII"/>
  10. +  <!--
  11.     Licensed to the Apache Software Foundation (ASF) under one or more
  12.     contributor license agreements.  See the NOTICE file distributed with
  13.     this work for additional information regarding copyright ownership.
  14. @@ -17,186 +17,225 @@
  15.     limitations under the License.
  16.    
  17.  -->
  18. -
  19. -<!--
  20.  
  21. +  <!--
  22. +
  23.    The purpose have this XSL is to provide a nice way to look at the output
  24.    from the Ant XmlLogger (ie: ant -listener org.apache.tools.ant.XmlLogger )
  25.    
  26.    @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a>
  27.    
  28.  -->
  29. -<xsl:decimal-format decimal-separator="." grouping-separator="," />
  30. +  <xsl:decimal-format decimal-separator="." grouping-separator="," />
  31.  
  32. -<xsl:template match="/">
  33. -<html>
  34. -  <head>
  35. -    <style type="text/css">
  36. -    .bannercell {
  37. -      border: 0px;
  38. -      padding: 0px;
  39. -    }
  40. -    body {
  41. -      margin: 0;
  42. -      font:normal 100% arial,helvetica,sanserif;
  43. -      background-color:#FFFFFF;
  44. -      color:#000000;
  45. -    }
  46. -    table.status {
  47. -      font:bold 80% arial,helvetica,sanserif;
  48. -      background-color:#525D76;
  49. -      color:#ffffff;
  50. -    }
  51. -    table.log tr td, tr th {
  52. -      font-size: 80%;
  53. -    }
  54. -    .error {
  55. -      color:red;
  56. -    }
  57. -    .warn {
  58. -      color:brown;
  59. -    }
  60. -    .info {
  61. -      color:gray;
  62. -    }
  63. -    .debug{
  64. -      color:gray;
  65. -    }
  66. -    .failed {
  67. -      font-size:80%;
  68. -      background-color: red;
  69. -      color:#FFFFFF;
  70. -      font-weight: bold
  71. -    }
  72. -    .complete {
  73. -      font-size:80%;
  74. -      background-color: #525D76;
  75. -      color:#FFFFFF;
  76. -      font-weight: bold
  77. -    }
  78. -    .a td {
  79. -      background: #efefef;
  80. -    }
  81. -    .b td {
  82. -      background: #fff;
  83. -    }
  84. -    th, td {
  85. -      text-align: left;
  86. -      vertical-align: top;
  87. -    }
  88. -    th {
  89. -      background: #ccc;
  90. -      color: black;
  91. -    }
  92. -    table, th, td {
  93. -      border: none
  94. -    }
  95. -    h3 {
  96. -      font:bold 80% arial,helvetica,sanserif;
  97. -      background: #525D76;
  98. -      color: white;
  99. -      text-decoration: none;
  100. -      padding: 5px;
  101. -      margin-right: 2px;
  102. -      margin-left: 2px;
  103. -      margin-bottom: 0;
  104. -    }
  105. -    </style>
  106. -  </head>
  107. -  <body>
  108. -    <!-- jakarta logo -->
  109. -    <table border="0" cellpadding="0" cellspacing="0" width="100%">
  110. -    <tr>
  111. -      <td valign="top" class="bannercell">
  112. -        <a href="http://jakarta.apache.org/">
  113. -        <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
  114. -        </a>
  115. -      </td>
  116. -      <td style="text-align:right;vertical-align:bottom">
  117. -        <a href="http://ant.apache.org/">Apache Ant</a>
  118. -      </td>
  119. -    </tr>
  120. -    </table>
  121. -     
  122. -    <table border="0" width="100%">
  123. -    <tr><td><hr noshade="yes" size="1"/></td></tr>
  124. -    </table>
  125. +  <xsl:template match="/">
  126. +         <style type="text/css">
  127. +           #ant_output {
  128. +           max-height: 650px;
  129. +           }
  130. +           
  131. +           #ant_output_container .bannercell {
  132. +           border: 0px;
  133. +           padding: 0px;
  134. +           }
  135.  
  136. -    <xsl:apply-templates select="cruisecontrol/build"/>
  137. +           #ant_output_container {
  138. +           font-family: verdana;
  139. +           font-size: 13px;
  140. +           background-color:#FFFFFF;
  141. +           color:#000000;
  142. +           }
  143.  
  144. -  </body>
  145. -</html>
  146. -</xsl:template>
  147. +           #ant_output_container table.status {
  148. +           background-color:#525D76;
  149. +           color:#ffffff;
  150. +           }
  151.  
  152. -<xsl:template match="build">
  153. -  <!-- build status -->
  154. -  <table width="100%">
  155. -    <xsl:attribute name="class">
  156. -      <xsl:if test="@error">failed</xsl:if>
  157. -      <xsl:if test="not(@error)">complete</xsl:if>
  158. -    </xsl:attribute>
  159. -    <tr>
  160. -      <xsl:if test="@error">
  161. -        <td nowrap="yes">Build Failed</td>
  162. -      </xsl:if>
  163. -      <xsl:if test="not(@error)">
  164. -        <td nowrap="yes">Build Complete</td>
  165. -      </xsl:if>
  166. -        <td style="text-align:right" nowrap="yes">Total Time: <xsl:value-of select="@time"/></td>
  167. -    </tr>
  168. -    <tr>
  169. -      <td colspan="2">
  170. +           #ant_output_container table.log {
  171. +
  172. +           }
  173. +
  174. +           #ant_output_container table.log tr td, tr th {
  175. +
  176. +           }
  177. +
  178. +           #ant_output_container .error {
  179. +           color:red;
  180. +           }
  181. +
  182. +           #ant_output_container .warn {
  183. +           color:brown;
  184. +           }
  185. +
  186. +           #ant_output_container .info {
  187. +           color:gray;
  188. +           }
  189. +
  190. +           #ant_output_container .debug{
  191. +           color:gray;
  192. +           }
  193. +
  194. +           #ant_output_container .failed {
  195. +           background-color: red;
  196. +           color:#FFFFFF;
  197. +           font-weight: bold
  198. +           }
  199. +
  200. +           #ant_output_container .complete {
  201. +           background-color: #525D76;
  202. +           color:#FFFFFF;
  203. +           font-weight: bold
  204. +           }
  205. +
  206. +           #ant_output_container .a td {
  207. +           background: #f7f7f7;
  208. +           }
  209. +
  210. +           #ant_output_container .b td {
  211. +           background: #fff;
  212. +           }
  213. +
  214. +           #ant_output_container th, td {
  215. +           text-align: left;
  216. +           vertical-align: top;
  217. +           }
  218. +
  219. +           #ant_output_container th {
  220. +           background: #ccc;
  221. +           color: black;
  222. +           }
  223. +
  224. +           #ant_output_container table, th, td {
  225. +           border-color: #fff;
  226. +           border-width: 0 0 0 0;
  227. +           border-style: none;
  228. +           padding: 2px;
  229. +           }
  230. +
  231. +           #ant_output_container h3 {
  232. +           font: bold 13px verdana;
  233. +           background: #525D76;
  234. +           color: white;
  235. +           text-decoration: none;
  236. +           padding: 5px;
  237. +           margin-right: 0;
  238. +           margin-left: 0;
  239. +           margin-bottom: 0;
  240. +           margin-top: 10px;
  241. +           }
  242. +         </style>
  243. +   
  244. +        <div id="ant_output_container">
  245. +
  246. +        <xsl:apply-templates select="cruisecontrol/build"/>
  247. +        </div>
  248. +  </xsl:template>
  249. +
  250. +  <xsl:template match="build">
  251. +    <!-- build status -->
  252. +    <table width="100%">
  253. +      <xsl:attribute name="class">
  254. +        <xsl:if test="@error">failed</xsl:if>
  255. +        <xsl:if test="not(@error)">complete</xsl:if>
  256. +      </xsl:attribute>
  257. +      <tr>
  258.          <xsl:if test="@error">
  259. -          <tt><xsl:value-of select="@error"/></tt><br/>
  260. -          <i style="font-size:80%">See the <a href="#stacktrace" alt="Click for details">stacktrace</a>.</i>
  261. +          <td nowrap="yes">Build Failed</td>
  262.          </xsl:if>
  263. +        <xsl:if test="not(@error)">
  264. +          <td nowrap="yes">Build Complete</td>
  265. +        </xsl:if>
  266. +        <td style="text-align:right" nowrap="yes">
  267. +          Total Time: <xsl:value-of select="@time"/>
  268. +        </td>
  269. +      </tr>
  270. +      <tr>
  271. +        <td colspan="2">
  272. +          <xsl:if test="@error">
  273. +            <tt>
  274. +              <xsl:value-of select="@error"/>
  275. +            </tt>
  276. +            <br/>
  277. +            <i style="font-size:80%">
  278. +              See the <a href="#stacktrace" alt="Click for details">stacktrace</a>.
  279. +            </i>
  280. +          </xsl:if>
  281. +        </td>
  282. +      </tr>
  283. +
  284. +    </table>
  285. +    <table border="1" cellspacing="2" cellpadding="3" width="100%" style="font-size:80%">
  286. +      <tr class="a">
  287. +        <td width="1">ant.file</td>
  288. +        <td>
  289. +          <xsl:value-of select="substring-after(//message[contains(text(),'ant.file')], '->')"/>
  290. +        </td>
  291. +      </tr>
  292. +      <tr class="b">
  293. +        <td width="1">ant.version</td>
  294. +        <td>
  295. +          <xsl:value-of select="substring-after(//message[contains(text(),'ant.version')], '->')"/>
  296. +        </td>
  297. +      </tr>
  298. +      <tr class="a">
  299. +        <td width="1">java.version</td>
  300. +        <td>
  301. +          <xsl:value-of select="substring-after(//message[contains(text(),'java.vm.version')], '->')"/>
  302. +        </td>
  303. +      </tr>
  304. +      <tr class="b">
  305. +        <td width="1">os.name</td>
  306. +        <td>
  307. +          <xsl:value-of select="substring-after(//message[contains(text(),'os.name')], '->')"/>
  308. +        </td>
  309. +      </tr>
  310. +    </table>
  311. +    <!-- build information -->
  312. +    <h3>Build events</h3>
  313. +    <table class="log" border="1" cellspacing="2" cellpadding="3" width="100%">
  314. +      <tr>
  315. +        <th nowrap="yes" align="left" width="1%">target</th>
  316. +        <th nowrap="yes" align="left" width="1%">task</th>
  317. +        <th nowrap="yes" align="left">message</th>
  318. +      </tr>
  319. +      <xsl:apply-templates select=".//message[@priority != 'debug']"/>
  320. +    </table>
  321. +    <p>
  322. +      <!-- stacktrace -->
  323. +      <xsl:if test="stacktrace">
  324. +        <a name="stacktrace"/>
  325. +        <h3>Error details</h3>
  326. +        <table width="100%">
  327. +          <tr>
  328. +            <td>
  329. +              <pre>
  330. +                <xsl:value-of select="stacktrace"/>
  331. +              </pre>
  332. +            </td>
  333. +          </tr>
  334. +        </table>
  335. +      </xsl:if>
  336. +    </p>
  337. +  </xsl:template>
  338. +
  339. +  <!-- report every message but those with debug priority -->
  340. +  <xsl:template match="message[@priority!='debug']">
  341. +    <tr valign="top">
  342. +      <!-- alternated row style -->
  343. +      <xsl:attribute name="class">
  344. +        <xsl:if test="position() mod 2 = 1">a</xsl:if>
  345. +        <xsl:if test="position() mod 2 = 0">b</xsl:if>
  346. +      </xsl:attribute>
  347. +      <td nowrap="yes" width="1%">
  348. +        <xsl:value-of select="../../@name"/>
  349.        </td>
  350. +      <td nowrap="yes" style="text-align:right" width="1%">
  351. +        [ <xsl:value-of select="../@name"/> ]
  352. +      </td>
  353. +      <td class="{@priority}" nowrap="yes">
  354. +        <xsl:value-of select="text()"/>
  355. +      </td>
  356.      </tr>
  357. -  </table>
  358. -  <table border="1" cellspacing="2" cellpadding="3" width="100%" style="font-size:80%">
  359. -    <tr class="a"><td width="1">ant.file</td><td><xsl:value-of select="substring-after(//message[contains(text(),'ant.file')], '->')"/></td></tr>
  360. -    <tr class="b"><td width="1">ant.version</td><td><xsl:value-of select="substring-after(//message[contains(text(),'ant.version')], '->')"/></td></tr>
  361. -    <tr class="a"><td width="1">java.version</td><td><xsl:value-of select="substring-after(//message[contains(text(),'java.vm.version')], '->')"/></td></tr>
  362. -    <tr class="b"><td width="1">os.name</td><td><xsl:value-of select="substring-after(//message[contains(text(),'os.name')], '->')"/></td></tr>
  363. -  </table>
  364. -  <!-- build information -->
  365. -  <h3>Build events</h3>
  366. -  <table class="log" border="1" cellspacing="2" cellpadding="3" width="100%">
  367. -  <tr>
  368. -    <th nowrap="yes" align="left" width="1%">target</th>
  369. -    <th nowrap="yes" align="left" width="1%">task</th>
  370. -    <th nowrap="yes" align="left">message</th>
  371. -  </tr>
  372. -  <xsl:apply-templates select=".//message[@priority != 'debug']"/>
  373. -  </table>
  374. -  <p>
  375. -  <!-- stacktrace -->
  376. -  <xsl:if test="stacktrace">
  377. -  <a name="stacktrace"/>
  378. -  <h3>Error details</h3>
  379. -  <table width="100%">
  380. -    <tr><td>
  381. -      <pre><xsl:value-of select="stacktrace"/></pre>
  382. -    </td></tr>
  383. -  </table>
  384. -  </xsl:if>
  385. -  </p>
  386. -</xsl:template>
  387. +  </xsl:template>
  388.  
  389. -<!-- report every message but those with debug priority -->
  390. -<xsl:template match="message[@priority!='debug']">
  391. -  <tr valign="top">
  392. -    <!-- alternated row style -->
  393. -    <xsl:attribute name="class">
  394. -      <xsl:if test="position() mod 2 = 1">a</xsl:if>
  395. -      <xsl:if test="position() mod 2 = 0">b</xsl:if>
  396. -    </xsl:attribute>
  397. -    <td nowrap="yes" width="1%"><xsl:value-of select="../../@name"/></td>
  398. -    <td nowrap="yes" style="text-align:right" width="1%">[ <xsl:value-of select="../@name"/> ]</td>
  399. -    <td class="{@priority}" nowrap="yes">
  400. -            <xsl:value-of select="text()"/>
  401. -    </td>
  402. -  </tr>
  403. -</xsl:template>
  404. -
  405. -</xsl:stylesheet>
  406. +</xsl:stylesheet>
  407. \ No newline at end of file
  408. Index: C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/service/WidgetPluginService.java
  409. ===================================================================
  410. --- C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/service/WidgetPluginService.java     (revision 3919)
  411. +++ C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/service/WidgetPluginService.java     (working copy)
  412. @@ -82,5 +82,7 @@
  413.          parameters.put(Widget.PARAM_PJT_LOG_ROOT, build.getLogFolder());
  414.          parameters.put(Widget.PARAM_BUILD_LOG_FILE, build.getLogFile());
  415.          parameters.put(Widget.PARAM_BUILD_ARTIFACTS_ROOT, build.getArtifactFolder());
  416. +        //Hardcode PARAM_CC_ROOT for now - CC Devs, is there a good place to pull this from?
  417. +        parameters.put(Widget.PARAM_CC_ROOT, "c:\\program files\\CruiseControl");
  418.      }
  419.  }
  420. Index: C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/widgets/AbstractXslOutputWidget.java
  421. ===================================================================
  422. --- C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/widgets/AbstractXslOutputWidget.java (revision 3919)
  423. +++ C:/Eclipse3.3/workspace/cc-svn/reporting/dashboard/src/net/sourceforge/cruisecontrol/dashboard/widgets/AbstractXslOutputWidget.java (working copy)
  424. @@ -35,9 +35,9 @@
  425.      }
  426.  
  427.      public Object getOutput(Map parameters) {
  428. -        File logFile = (File) parameters.get(Widget.PARAM_BUILD_LOG_FILE);
  429. +        File logFile = new File( (String)parameters.get(Widget.PARAM_BUILD_LOG_FILE) );
  430.          try {
  431. -            File ccHome = (File) parameters.get(Widget.PARAM_CC_ROOT);
  432. +            File ccHome = new File( (String)parameters.get(Widget.PARAM_CC_ROOT) );
  433.              File xsl = new File(ccHome.getCanonicalPath() + "/" + getXslPath());
  434.              Source xmlSource = new StreamSource(logFile);
  435.              Source xsltSource = new StreamSource(xsl);

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.