common/tools/brag/bragForDiamonds.xsl
author Simon Howkins <simonh@symbian.org>
Thu, 15 Oct 2009 16:47:42 +0100
changeset 676 63fe736c83fb
parent 587 97d29037659e
child 886 fc600bbaa15c
permissions -rw-r--r--
Moved invocation of sf-brag-to-diamonds, so it's right at the end of the postbuild (apart from publishing zipped logs). This avoids the possibility of a build abort when parallel threaqds are trying to a) convert a log file into a brag file, and b) merge all brag files ready to determine the brag status. It also makes more sense - don't calculate or send the BRAGG status until the build is on the cusp of completion.

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- Main template -->
<xsl:template match="/buildStatus">
	<xsl:variable name="criticalCount" select="count(phase/step/failures[@level='critical']/failure)"/>
	<xsl:variable name="majorCount" select="count(phase/step/failures[@level='major']/failure)"/>
	<xsl:variable name="minorCount" select="count(phase/step/failures[@level='minor']/failure)"/>
	<xsl:variable name="unknownCount" select="count(phase/step/failures[@level!='critical' and @level!='major' and @level!='minor']/failure)"/>

	<diamonds-build>
	<schema>13</schema>
	<build>
	<status>
	<xsl:choose>
		<xsl:when test="$criticalCount != 0">Black</xsl:when>
		<xsl:when test="$majorCount != 0">Red</xsl:when>
		<xsl:when test="$minorCount != 0">Amber</xsl:when>
		<xsl:when test="$unknownCount != 0">Green</xsl:when>
		<xsl:otherwise>Gold</xsl:otherwise>
	</xsl:choose>
	</status>
	</build>
	</diamonds-build>
</xsl:template>

</xsl:stylesheet>