Skip to content

nefarius/vpatch

Repository files navigation

vpatch

.NET Requirements Nuget Nuget

Versioning helper command line utility.

About

This command line tool can version-stamp the following project files and types:

  • Legacy .NET Framework .csproj and AssemblyInfo.cs files
  • Current (SDK-format) .NET Core .csproj files
  • 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.

Installation

dotnet tool install --global Nefarius.Tools.Vpatch

Usage examples

Stamp *.rc files

Read 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-version

Stamp with version from AppVeyor:

vpatch --stamp-version "%APPVEYOR_BUILD_VERSION%" --target-file "%solution%\ExampleProject\ExampleProject.rc" --resource.file-version --resource.product-version

Stamp .NET Framework AssemblyInfo

Read 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-version

Stamp Windows Driver Project

Read 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-stamp

Stamp with version from AppVeyor:

vpatch --stamp-version "%APPVEYOR_BUILD_VERSION%" --target-file "%solution%\ExampleProject\ExampleProject.vcxproj" --vcxproj.inf-time-stamp

appveyor.yml example

Updates 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

About

Versioning helper command line utility

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages