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 | Copyright 2000-2004 The Apache Software Foundation |
---|
5 | |
---|
6 | Licensed under the Apache License, Version 2.0 (the "License"); |
---|
7 | you may not use this file except in compliance with the License. |
---|
8 | You may obtain a copy of the License at |
---|
9 | |
---|
10 | http://www.apache.org/licenses/LICENSE-2.0 |
---|
11 | |
---|
12 | Unless required by applicable law or agreed to in writing, software |
---|
13 | distributed under the License is distributed on an "AS IS" BASIS, |
---|
14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
15 | See the License for the specific language governing permissions and |
---|
16 | limitations under the License. |
---|
17 | |
---|
18 | --> |
---|
19 | |
---|
20 | <!-- |
---|
21 | |
---|
22 | The purpose have this XSL is to provide a nice way to look at the output |
---|
23 | from the Ant XmlLogger (ie: ant -listener org.apache.tools.ant.XmlLogger ) |
---|
24 | |
---|
25 | @author <a href="mailto:michiel.rook@gmail.com>Michiel Rook</a> |
---|
26 | @author <a href="mailto:sbailliez@apache.org">Stephane Bailliez</a> |
---|
27 | |
---|
28 | --> |
---|
29 | <xsl:decimal-format decimal-separator="." grouping-separator="," /> |
---|
30 | |
---|
31 | <xsl:template match="/"> |
---|
32 | <html> |
---|
33 | <head> |
---|
34 | <title>Phing Build Log</title> |
---|
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 | a { |
---|
106 | color: #003399; |
---|
107 | } |
---|
108 | a:hover { |
---|
109 | color: #888888; |
---|
110 | } |
---|
111 | </style> |
---|
112 | </head> |
---|
113 | <body> |
---|
114 | <!-- jakarta logo --> |
---|
115 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
---|
116 | <tr> |
---|
117 | <td valign="top" class="bannercell"> |
---|
118 | <a href="http://phing.info/"> |
---|
119 | <img src="http://phing.info/images/phing.gif" alt="http://phing.info/" align="left" border="0"/> |
---|
120 | </a> |
---|
121 | </td> |
---|
122 | <td style="text-align:right;vertical-align:bottom"> |
---|
123 | <a href="http://phing.info/">Phing</a> |
---|
124 | </td> |
---|
125 | </tr> |
---|
126 | </table> |
---|
127 | |
---|
128 | <table border="0" width="100%"> |
---|
129 | <tr><td><hr noshade="yes" size="1"/></td></tr> |
---|
130 | </table> |
---|
131 | |
---|
132 | <xsl:apply-templates select="build"/> |
---|
133 | |
---|
134 | <!-- FOOTER --> |
---|
135 | <table width="100%"> |
---|
136 | <tr><td><hr noshade="yes" size="1"/></td></tr> |
---|
137 | <tr><td> |
---|
138 | <div align="center"><font color="#525D76" size="-1"><em> |
---|
139 | <a href="http://phing.info/">Phing</a> |
---|
140 | </em></font></div> |
---|
141 | </td></tr> |
---|
142 | </table> |
---|
143 | </body> |
---|
144 | </html> |
---|
145 | </xsl:template> |
---|
146 | |
---|
147 | <xsl:template match="build"> |
---|
148 | <!-- build status --> |
---|
149 | <table width="100%"> |
---|
150 | <xsl:attribute name="class"> |
---|
151 | <xsl:if test="@error">failed</xsl:if> |
---|
152 | <xsl:if test="not(@error)">complete</xsl:if> |
---|
153 | </xsl:attribute> |
---|
154 | <tr> |
---|
155 | <xsl:if test="@error"> |
---|
156 | <td nowrap="yes">Build Failed</td> |
---|
157 | </xsl:if> |
---|
158 | <xsl:if test="not(@error)"> |
---|
159 | <td nowrap="yes">Build Complete</td> |
---|
160 | </xsl:if> |
---|
161 | <td style="text-align:right" nowrap="yes">Total Time: <xsl:value-of select="@time"/></td> |
---|
162 | </tr> |
---|
163 | <tr> |
---|
164 | <td colspan="2"> |
---|
165 | <xsl:if test="@error"> |
---|
166 | <tt><xsl:value-of select="@error"/></tt><br/> |
---|
167 | <i style="font-size:80%">See the <a href="#stacktrace" alt="Click for details">stacktrace</a>.</i> |
---|
168 | </xsl:if> |
---|
169 | </td> |
---|
170 | </tr> |
---|
171 | </table> |
---|
172 | <table border="1" cellspacing="2" cellpadding="3" width="100%" style="font-size:80%"> |
---|
173 | <tr class="a"><td width="1">phing.file</td><td><xsl:value-of select="substring-after(//message[contains(text(),'phing.file')], '->')"/></td></tr> |
---|
174 | <tr class="b"><td width="1">phing.version</td><td><xsl:value-of select="substring-after(//message[contains(text(),'phing.version')], '->')"/></td></tr> |
---|
175 | </table> |
---|
176 | <!-- build information --> |
---|
177 | <h3>Build events</h3> |
---|
178 | <table class="log" border="1" cellspacing="2" cellpadding="3" width="100%"> |
---|
179 | <tr> |
---|
180 | <th nowrap="yes" align="left" width="1%">target</th> |
---|
181 | <th nowrap="yes" align="left" width="1%">task</th> |
---|
182 | <th nowrap="yes" align="left">message</th> |
---|
183 | </tr> |
---|
184 | <xsl:apply-templates select=".//message[@priority != 'debug']"/> |
---|
185 | </table> |
---|
186 | <p> |
---|
187 | <!-- stacktrace --> |
---|
188 | <xsl:if test="stacktrace"> |
---|
189 | <a name="stacktrace"/> |
---|
190 | <h3>Error details</h3> |
---|
191 | <table width="100%"> |
---|
192 | <tr><td> |
---|
193 | <pre><xsl:value-of select="stacktrace"/></pre> |
---|
194 | </td></tr> |
---|
195 | </table> |
---|
196 | </xsl:if> |
---|
197 | </p> |
---|
198 | </xsl:template> |
---|
199 | |
---|
200 | <!-- report every message but those with debug priority --> |
---|
201 | <xsl:template match="message[@priority!='debug']"> |
---|
202 | <tr valign="top"> |
---|
203 | <!-- alternated row style --> |
---|
204 | <xsl:attribute name="class"> |
---|
205 | <xsl:if test="position() mod 2 = 1">a</xsl:if> |
---|
206 | <xsl:if test="position() mod 2 = 0">b</xsl:if> |
---|
207 | </xsl:attribute> |
---|
208 | <td nowrap="yes" width="1%"><xsl:value-of select="../../@name"/></td> |
---|
209 | <td nowrap="yes" style="text-align:right" width="1%">[ <xsl:value-of select="../@name"/> ]</td> |
---|
210 | <td class="{@priority}" nowrap="yes"> |
---|
211 | <xsl:value-of select="text()"/> |
---|
212 | </td> |
---|
213 | </tr> |
---|
214 | </xsl:template> |
---|
215 | |
---|
216 | </xsl:stylesheet> |
---|