-
Notifications
You must be signed in to change notification settings - Fork 25
/
updates.xslt
43 lines (36 loc) · 2.16 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
<?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-angularjs/wiki/Release-Notes</InformationUri>
<Title>
<xsl:value-of select="concat('AngularJS Support for ReSharper ', $LatestMajor, '.', $LatestMinor, '.', $LatestBuild, ' Released')" />
</Title>
<Description>A minor upgrade is available.</Description>
<DownloadUri>
<xsl:value-of select="concat('http://download.jetbrains.com/resharper/plugins/resharper-angularjs.', $LatestMajor, '.', $LatestMinor, '.', $LatestBuild, '.zip')" />
</DownloadUri>
<CompanyName>JetBrains</CompanyName>
<ProductName>AngularJS</ProductName>
<ProductVersion><xsl:value-of select="concat($LatestMajor, '.', $LatestMinor, '.', $LatestBuild, '.0')"/></ProductVersion>
<PriceTag />
<IsFree>true</IsFree>
</UpdateInfo>
</xsl:if>
</UpdateInfos>
</xsl:template>
</xsl:stylesheet>