Skip to content

Commit

Permalink
Automatically increase version in VSIX manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
rhuijben committed May 15, 2021
1 parent 69a91f1 commit 2f7bc2b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/gh-version-setup.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

SET CACHE=%0\..\gh.cache.bat
SET RSPFILE=%0\..\msbuild-version.rsp
SET CURD=%0\..

echo @echo off > %CACHE%

Expand All @@ -25,6 +26,8 @@ echo Prepare building AnkhSVN %ANKHSVN_MAJOR%.%ANKHSVN_MINOR%.%ANKHSVN_PATCH%
echo SET GIT_SHA=%GIT_SHA%
) >> %CACHE%

SET ANKHSVN_VER=%ANKHSVN_MAJOR%.%ANKHSVN_MINOR%.%ANKHSVN_PATCH%

(
echo /p:ForceAssemblyVersion=%ANKHSVN_MAJOR%.%ANKHSVN_MINOR%.%ANKHSVN_PATCH%
echo /p:ForceAssemblyInformationalVersion=%ANKHSVN_MAJOR%.%ANKHSVN_MINOR%.%ANKHSVN_PATCH%-%GIT_SHA%
Expand All @@ -33,3 +36,11 @@ echo Prepare building AnkhSVN %ANKHSVN_MAJOR%.%ANKHSVN_MINOR%.%ANKHSVN_PATCH%
echo /p:BuildBotBuild=true
echo /p:RestoreForce=true
) > %RSPFILE%

call :xmlpoke %CURD%\..\..\src\Ankh.Package\source.extension.VsixManifest //vsx:Metadata/vsx:Identity/@Version "%ANKHSVN_VER%"

goto :eof

:xmlpoke
msbuild /nologo /v:m %CURD%\xmlpoke.build "/p:File=%1" "/p:XPath=%2" "/p:Value=%3" || exit /B 1
exit /B 0
16 changes: 16 additions & 0 deletions scripts/xmlpoke.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" defaultTarget="Poke">
<PropertyGroup>
<Namespace>
<Namespace Prefix="nu" Uri="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd" />
<Namespace Prefix="vsx" Uri="http://schemas.microsoft.com/developer/vsx-schema/2011" />
</Namespace>
</PropertyGroup>

<Target Name="Poke">
<XmlPoke
XmlInputPath="$(File)"
Value="$(Value)"
Query="$(XPath)"
Namespaces="$(Namespace)"/>
</Target>
</Project>

0 comments on commit 2f7bc2b

Please sign in to comment.