Versioning helper command line utility.
This command line tool can version-stamp the following project files and types:
- Legacy .NET Framework
.csprojandAssemblyInfo.csfiles - Current (SDK-format) .NET Core
.csprojfiles - C/C++ Win32 VERSIONINFO resource files
- Stamping INF version info in driver projects
It is most useful in Continuous Integration setups to avoid having to deal with custom scripts to bump the version number with each build or release.
dotnet tool install --global Nefarius.Tools.VpatchRead version string from file version.txt and replace both File Version and Product Version attributes in resource
file ExampleProject.rc:
vpatch --stamp-version-from-file version.txt --target-file "%solution%\ExampleProject\ExampleProject.rc" --resource.file-version --resource.product-versionStamp with version from AppVeyor:
vpatch --stamp-version "%APPVEYOR_BUILD_VERSION%" --target-file "%solution%\ExampleProject\ExampleProject.rc" --resource.file-version --resource.product-versionRead version string from file version.txt and replace both AssemblyVersion and AssemblyFileVersion attributes in
AssemblyInfo.cs:
vpatch --stamp-version-from-file version.txt --target-file "%solution%\ExampleProject\Properties\AssemblyInfo.cs" --assembly.version --assembly.file-versionRead version string from file version.txt and replace TimeStamp attribute in ExampleProject.vcxproj:
vpatch --stamp-version-from-file version.txt --target-file "%solution%\ExampleProject\ExampleProject.vcxproj" --vcxproj.inf-time-stampStamp with version from AppVeyor:
vpatch --stamp-version "%APPVEYOR_BUILD_VERSION%" --target-file "%solution%\ExampleProject\ExampleProject.vcxproj" --vcxproj.inf-time-stampUpdates relevant version sections within a Windows Driver Project run on AppVeyor CI:
before_build:
- cmd: dotnet tool install --global Nefarius.Tools.Vpatch
- cmd: vpatch --stamp-version "%APPVEYOR_BUILD_VERSION%" --target-file ".\sys\%APPVEYOR_PROJECT_NAME%.vcxproj" --vcxproj.inf-time-stamp
- cmd: vpatch --stamp-version "%APPVEYOR_BUILD_VERSION%" --target-file ".\sys\%APPVEYOR_PROJECT_NAME%.rc" --resource.file-version --resource.product-version