Merge branch 'local_grails'
[grails.git] / cruise / buildstatus.xsl
blobfb4e8a363ae173c2d8f41bdc00e4986015ab5c48
1 <?xml version="1.0" encoding="us-ascii" ?>
2 <!--
3 Excerpted from the book, "Pragmatic Project Automation"
4 ISBN 0-9745140-3-9
5 Copyright 2004 The Pragmatic Programmers, LLC. All Rights Reserved.
6 Visit www.PragmaticProgrammer.com
7 -->
10 <xsl:stylesheet
11 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
12 version="1.0">
14 <xsl:output method="xml" indent="yes"/>
16 <xsl:template match="/">
18 <rss version="2.0">
19 <channel>
21 <title>Grails Build Status</title>
23 <link>http://grails.codehaus.org/</link>
25 <description>CruiseControl build status feed for the Grails project.</description>
27 <item>
29 <xsl:variable name="project.name"
30 select="cruisecontrol/info/property[@name='projectname']/@value"/>
31 <xsl:variable name="build.date"
32 select="cruisecontrol/info/property[@name='builddate']/@value"/>
33 <xsl:variable name="build.time"
34 select="cruisecontrol/build/@time"/>
35 <xsl:variable name="modification.list"
36 select="cruisecontrol/modifications/modification"/>
38 <xsl:variable name="testsuite.list" select="//testsuite"/>
39 <xsl:variable name="testcase.list" select="$testsuite.list/testcase"/>
40 <title>
41 <xsl:choose>
42 <xsl:when test="cruisecontrol/build/@error">BUILD FAILED</xsl:when>
43 <xsl:otherwise>Build Succeeded</xsl:otherwise>
44 </xsl:choose>
45 </title>
46 <link>http://build.canoo.com/grails/</link>
47 <description>
48 <xsl:choose>
49 <xsl:when test="cruisecontrol/build/@error">
50 <xsl:text>&lt;b&gt;Ant Error Message:&lt;/b&gt;&lt;br/&gt;</xsl:text>
51 <xsl:value-of select="cruisecontrol/build/@error"/>
52 </xsl:when>
53 <xsl:otherwise>
54 <xsl:text>&lt;b&gt;Build:&lt;/b&gt;</xsl:text>
55 <xsl:value-of select="cruisecontrol/info/property[@name='label']/@value"/>
56 </xsl:otherwise>
57 </xsl:choose>
59 &lt;br/&gt;
60 &lt;br/&gt;
62 &lt;b&gt;Date of build:&lt;/b&gt;
63 <xsl:value-of select="$build.date"/>&lt;br/&gt;
65 &lt;b&gt;Time to build:&lt;/b&gt;
66 <xsl:value-of select="$build.time"/>&lt;br/&gt;
68 <xsl:apply-templates select="$modification.list">
69 <xsl:sort select="date" order="descending" data-type="text"/>
70 </xsl:apply-templates>
72 &lt;br/&gt;
74 &lt;b&gt;Unit Tests:&lt;/b&gt;
75 <xsl:value-of select="count($testcase.list)"/>
77 </description>
78 </item>
79 </channel>
80 </rss>
81 </xsl:template>
83 <xsl:template match="modification">
84 <xsl:if test="position() = 1">
86 &lt;br/&gt;
88 &lt;b&gt;Last changed:&lt;/b&gt;
89 <xsl:value-of select="date"/>&lt;br/&gt;
91 &lt;b&gt;Last changed by:&lt;/b&gt;
92 <xsl:value-of select="user"/>&lt;br/&gt;
94 &lt;b&gt;Last log entry:&lt;/b&gt;
95 <xsl:value-of select="comment"/>&lt;br/&gt;
97 </xsl:if>
98 </xsl:template>
100 </xsl:stylesheet>