This repository has been archived by the owner on Dec 12, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathupdates.xslt
94 lines (80 loc) · 3.85 KB
/
updates.xslt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="msxsl">
<xsl:output method="xml" indent="yes"/>
<!-- This is the latest version available -->
<xsl:variable name="ReSharperLatestMajor" select="1" />
<xsl:variable name="ReSharperLatestMinor" select="3" />
<xsl:variable name="ReSharperLatestBuild" select="0" />
<xsl:variable name="dotCoverLatestMajor" select="1" />
<xsl:variable name="dotCoverLatestMinor" select="3" />
<xsl:variable name="dotCoverLatestBuild" select="0" />
<!-- Match the PluginLocalInfo element created by serialising the data from the category -->
<xsl:template match="/PluginLocalInfo">
<!-- Bet there's a better way of doing this -->
<xsl:variable name="LatestMajor">
<xsl:choose>
<xsl:when test="LocalEnvironment/Product/@Name='dotCover'">
<xsl:value-of select="$dotCoverLatestMajor"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$ReSharperLatestMajor"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="LatestMinor">
<xsl:choose>
<xsl:when test="LocalEnvironment/Product/@Name='dotCover'">
<xsl:value-of select="$dotCoverLatestMinor"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$ReSharperLatestMinor"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="LatestBuild">
<xsl:choose>
<xsl:when test="LocalEnvironment/Product/@Name='dotCover'">
<xsl:value-of select="$dotCoverLatestBuild"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$ReSharperLatestBuild"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="ReleaseUrl">
<xsl:choose>
<xsl:when test="LocalEnvironment/Product/@Name='dotCover'">
<xsl:value-of select="string('https://xunitcontrib.codeplex.com/releases/view/115727')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string('https://xunitcontrib.codeplex.com/releases/view/115729')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<UpdateInfos>
<xsl:variable name="InstalledMajor" select="PluginVersion/@Major" />
<xsl:variable name="InstalledMinor" select="PluginVersion/@Minor" />
<xsl:variable name="InstalledBuild" select="PluginVersion/@Build" />
<!-- If we have a new version, add an <UpdateInfo /> element to tell ReSharper a new version is ready -->
<xsl:if test="($InstalledMajor < $LatestMajor) or ($InstalledMajor = $LatestMajor and $InstalledMinor < $LatestMinor) or ($InstalledMajor = $LatestMajor and $InstalledMinor = $LatestMinor and $InstalledBuild < $LatestBuild)">
<UpdateInfo>
<!-- TODO: I really should create a release notes page -->
<InformationUri><xsl:value-of select="$ReleaseUrl" /></InformationUri>
<Title>
<xsl:value-of select="concat('xUnit.net test runner ', $LatestMajor, '.', $LatestMinor, '.', $LatestBuild, ' Released')" />
</Title>
<Description>A minor upgrade is available.</Description>
<!-- TODO: It would be nice to have a direct download, but codeplex doesn't really allow that -->
<DownloadUri><xsl:value-of select="$ReleaseUrl" /></DownloadUri>
<CompanyName>Matt Ellis</CompanyName>
<ProductName>xUnit.net test runner</ProductName>
<ProductVersion><xsl:value-of select="concat($LatestMajor, '.', $LatestMinor, '.', $LatestBuild, '.0')"/></ProductVersion>
<PriceTag />
<IsFree>true</IsFree>
</UpdateInfo>
</xsl:if>
</UpdateInfos>
</xsl:template>
</xsl:stylesheet>