You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

log.xsl 6.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  2. <xsl:output method="html" indent="yes" encoding="US-ASCII"/>
  3. <!--
  4. Licensed to the Apache Software Foundation (ASF) under one or more
  5. contributor license agreements. See the NOTICE file distributed with
  6. this work for additional information regarding copyright ownership.
  7. The ASF licenses this file to You under the Apache License, Version 2.0
  8. (the "License"); you may not use this file except in compliance with
  9. the License. You may obtain a copy of the License at
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing, software
  12. distributed under the License is distributed on an "AS IS" BASIS,
  13. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. See the License for the specific language governing permissions and
  15. limitations under the License.
  16. -->
  17. <!--
  18. The purpose have this XSL is to provide a nice way to look at the output
  19. from the Ant XmlLogger (ie: ant -listener org.apache.tools.ant.XmlLogger )
  20. @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a>
  21. -->
  22. <xsl:decimal-format decimal-separator="." grouping-separator="," />
  23. <xsl:template match="/">
  24. <html>
  25. <head>
  26. <style type="text/css">
  27. .bannercell {
  28. border: 0px;
  29. padding: 0px;
  30. }
  31. body {
  32. margin: 0;
  33. font:normal 100% arial,helvetica,sanserif;
  34. background-color:#FFFFFF;
  35. color:#000000;
  36. }
  37. table.status {
  38. font:bold 80% arial,helvetica,sanserif;
  39. background-color:#525D76;
  40. color:#ffffff;
  41. }
  42. table.log tr td, tr th {
  43. font-size: 80%;
  44. }
  45. .error {
  46. color:red;
  47. }
  48. .warn {
  49. color:brown;
  50. }
  51. .info {
  52. color:gray;
  53. }
  54. .debug{
  55. color:gray;
  56. }
  57. .failed {
  58. font-size:80%;
  59. background-color: red;
  60. color:#FFFFFF;
  61. font-weight: bold
  62. }
  63. .complete {
  64. font-size:80%;
  65. background-color: #525D76;
  66. color:#FFFFFF;
  67. font-weight: bold
  68. }
  69. .a td {
  70. background: #efefef;
  71. }
  72. .b td {
  73. background: #fff;
  74. }
  75. th, td {
  76. text-align: left;
  77. vertical-align: top;
  78. }
  79. th {
  80. background: #ccc;
  81. color: black;
  82. }
  83. table, th, td {
  84. border: none
  85. }
  86. h3 {
  87. font:bold 80% arial,helvetica,sanserif;
  88. background: #525D76;
  89. color: white;
  90. text-decoration: none;
  91. padding: 5px;
  92. margin-right: 2px;
  93. margin-left: 2px;
  94. margin-bottom: 0;
  95. }
  96. </style>
  97. </head>
  98. <body>
  99. <!-- jakarta logo -->
  100. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  101. <tr>
  102. <td valign="top" class="bannercell">
  103. <a href="http://jakarta.apache.org/">
  104. <img src="http://jakarta.apache.org/images/jakarta-logo.gif" alt="http://jakarta.apache.org" align="left" border="0"/>
  105. </a>
  106. </td>
  107. <td style="text-align:right;vertical-align:bottom">
  108. <a href="http://ant.apache.org/">Apache Ant</a>
  109. </td>
  110. </tr>
  111. </table>
  112. <table border="0" width="100%">
  113. <tr><td><hr noshade="yes" size="1"/></td></tr>
  114. </table>
  115. <xsl:apply-templates select="build"/>
  116. </body>
  117. </html>
  118. </xsl:template>
  119. <xsl:template match="build">
  120. <!-- build status -->
  121. <table width="100%">
  122. <xsl:attribute name="class">
  123. <xsl:if test="@error">failed</xsl:if>
  124. <xsl:if test="not(@error)">complete</xsl:if>
  125. </xsl:attribute>
  126. <tr>
  127. <xsl:if test="@error">
  128. <td nowrap="yes">Build Failed</td>
  129. </xsl:if>
  130. <xsl:if test="not(@error)">
  131. <td nowrap="yes">Build Complete</td>
  132. </xsl:if>
  133. <td style="text-align:right" nowrap="yes">Total Time: <xsl:value-of select="@time"/></td>
  134. </tr>
  135. <tr>
  136. <td colspan="2">
  137. <xsl:if test="@error">
  138. <tt><xsl:value-of select="@error"/></tt><br/>
  139. <i style="font-size:80%">See the <a href="#stacktrace" alt="Click for details">stacktrace</a>.</i>
  140. </xsl:if>
  141. </td>
  142. </tr>
  143. </table>
  144. <table border="1" cellspacing="2" cellpadding="3" width="100%" style="font-size:80%">
  145. <tr class="a"><td width="1">ant.file</td><td><xsl:value-of select="substring-after(//message[contains(text(),'ant.file')], '->')"/></td></tr>
  146. <tr class="b"><td width="1">ant.version</td><td><xsl:value-of select="substring-after(//message[contains(text(),'ant.version')], '->')"/></td></tr>
  147. <tr class="a"><td width="1">java.version</td><td><xsl:value-of select="substring-after(//message[contains(text(),'java.vm.version')], '->')"/></td></tr>
  148. <tr class="b"><td width="1">os.name</td><td><xsl:value-of select="substring-after(//message[contains(text(),'os.name')], '->')"/></td></tr>
  149. </table>
  150. <!-- build information -->
  151. <h3>Build events</h3>
  152. <table class="log" border="1" cellspacing="2" cellpadding="3" width="100%">
  153. <tr>
  154. <th nowrap="yes" align="left" width="1%">target</th>
  155. <th nowrap="yes" align="left" width="1%">task</th>
  156. <th nowrap="yes" align="left">message</th>
  157. </tr>
  158. <xsl:apply-templates select=".//message[@priority != 'debug']"/>
  159. </table>
  160. <p>
  161. <!-- stacktrace -->
  162. <xsl:if test="stacktrace">
  163. <a name="stacktrace"/>
  164. <h3>Error details</h3>
  165. <table width="100%">
  166. <tr><td>
  167. <pre><xsl:value-of select="stacktrace"/></pre>
  168. </td></tr>
  169. </table>
  170. </xsl:if>
  171. </p>
  172. </xsl:template>
  173. <!-- report every message but those with debug priority -->
  174. <xsl:template match="message[@priority!='debug']">
  175. <tr valign="top">
  176. <!-- alternated row style -->
  177. <xsl:attribute name="class">
  178. <xsl:if test="position() mod 2 = 1">a</xsl:if>
  179. <xsl:if test="position() mod 2 = 0">b</xsl:if>
  180. </xsl:attribute>
  181. <td nowrap="yes" width="1%"><xsl:value-of select="../../@name"/></td>
  182. <td nowrap="yes" style="text-align:right" width="1%">[ <xsl:value-of select="../@name"/> ]</td>
  183. <td class="{@priority}" nowrap="yes">
  184. <xsl:value-of select="text()"/>
  185. </td>
  186. </tr>
  187. </xsl:template>
  188. </xsl:stylesheet>