This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
/
updates.xslt
41 lines (34 loc) · 1.97 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
<?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="LatestMajor" select="1" />
<xsl:variable name="LatestMinor" select="1" />
<xsl:variable name="LatestBuild" select="0" />
<!-- Match the PluginLocalInfo element created by serialising the data from the category -->
<xsl:template match="/PluginLocalInfo">
<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>
<InformationUri>https://github.com/JetBrains/resharper-nuget/wiki/Release-Notes</InformationUri>
<Title>
<xsl:value-of select="concat('NuGet Support for ReSharper ', $LatestMajor, '.', $LatestMinor, '.', $LatestBuild, ' Released')"/>
</Title>
<Description>A minor upgrade is available.</Description>
<DownloadUri>???</DownloadUri>
<CompanyName>JetBrains</CompanyName>
<ProductName>NuGet Support</ProductName>
<ProductVersion><xsl:value-of select="concat($LatestMajor, '.', $LatestMinor, '.', $LatestBuild, '.0')"/></ProductVersion>
<PriceTag />
<IsFree>true</IsFree>
</UpdateInfo>
</xsl:if>
</UpdateInfos>
</xsl:template>
</xsl:stylesheet>