Skip to content

๐ŸŽฏโš™๏ธ Provides a NuGet package that adds functionality to your project to auto increment the version build and revision before every Debug build.

License

Notifications You must be signed in to change notification settings

guibranco/MSBuild.Version.Target

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MSBuild.Version.Target

Wakatime Build Status NuGet Version NuGet Downloads CodeFactor

๐ŸŽฏโš™๏ธ MSBuild.Version.Target is a NuGet package that automates versioning by auto-incrementing the build version for non-release configuration builds.

It integrates seamlessly with your project by:

  • Generating and maintaining a Version.txt file for versioning in Semantic Versioning (SemVer) format.
  • Automatically updating AssemblyInfo.cs and Version.txt with the incremented version during each build (except for the Release configuration).

๐Ÿš€ Features

  • Semantic Versioning (SemVer) support:
    • Major and minor versions are manually maintained.
    • Build (patch) version is automatically incremented during the build process.
  • Configurable via MSBuild.
  • Works in CI/CD pipelines or local builds.

๐Ÿ“ฆ Installation

To install the NuGet package, use the following command:

Install-Package MSBuild.Version.Target

Or visit the NuGet package page for more details.


๐Ÿ› ๏ธ Usage Instructions

  1. Post-installation Setup:
    After installing the package, locate the Version.txt file in the Properties folder of your project. Update the file with your current project version in the SemVer format:

    Major.Minor.Patch
    
    • Major and Minor: Managed manually.
    • Patch: Automatically incremented for non-Release builds.
  2. Configuration Management:
    The versioning logic activates during any build configuration other than Release. Ensure the appropriate configuration is selected:

    • In Visual Studio, adjust this under Build > Configuration Manager.
    • In CI pipelines or manual builds, specify the configuration explicitly using:
      MSBuild /p:Configuration=Debug
  3. Build Process:
    During the build, the following updates occur automatically:

    • AssemblyInfo.cs: The assembly version is updated to reflect the new version.
    • Version.txt: The build version is incremented.

๐Ÿ“‹ Example

Hereโ€™s a quick example of how the versioning would work:

  • Initial Version.txt:
    1.0.0
    
  • After a build with configuration Debug:
    1.0.1
    
  • After another Debug build:
    1.0.2
    
  • Build with configuration Release:
    • Version remains unchanged.

๐Ÿงฉ Contributing

Contributions are welcome!
Feel free to open issues, submit pull requests, or suggest features.


๐Ÿ“„ License

This project is licensed under the MIT License.

About

๐ŸŽฏโš™๏ธ Provides a NuGet package that adds functionality to your project to auto increment the version build and revision before every Debug build.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks