dotnet-sver
0.3.2
dotnet tool install --global dotnet-sver --version 0.3.2
dotnet new tool-manifest
dotnet tool install --local dotnet-sver --version 0.3.2
#tool dotnet:?package=dotnet-sver&version=0.3.2
nuke :add-package dotnet-sver --version 0.3.2
dotnet-sver
dotnet-sver
is a CLI tool for managing project versions using Semantic Versioning in .NET applications. It provides a set of commands to list, set, upgrade and downgrade project versions, making it easy to handle versioning within your development workflow.
Generally semantic versioning has three main parts. MAJOR, MINOR and PATCH and represents with the following template: X.Y.Z which X holds the MAJOR part, Y holds the MINOR and Z holds the PATCH.
It also supports pre-release and build versions which will be appended to X.Y.Z.
For more information, I refer you to here.
Features
- List the project versions within the target solution using
list
command. - Upgrade the current version of the projects using
upgrade
command. - Downgrade the current version of the projects using
downgrade
command. - Set the version of the projects using the
set
command. - Support for Semantic Versioning (MAJOR.MINOR.PATCH).
- Option to specify the project number for version manipulation.
- Option to operate on all projects at once.
Getting Started
Prerequisites
- Make sure you have latest .NET SDK installed on your machine.
Installation
Install dotnet-sver
from the universal source as a global tool using the following command:
$ dotnet tool install -g dotnet-sver
Build locally and install globally:
$ git clone https://github.com/shojajou/dotnet-sver
$ cd SemanticVersioning.Net/src/SemanticVersioning.Net.Cli
$ dotnet pack -c Release -o nupkg
$ dotnet tool install -g dotnet-sver --add-source .\nupkg
Usage
You can call
dotnet sver
as well asdotnet-sver
to use the tool.
First, your cwd(current working directory) must be somewhere inside your solution directory.
cd <somewhere-inside-yout-target-solution>
List Command
By executing this command, your projects and their versions will be printed out.
$ dotnet-sver list
1) Project-1.csproj [version]
2) Project-2.csproj [version]
3) Project-3.csproj [version]
4) Project-4.csproj [version]
5) Project-5.csproj [version]
Upgrade Command
Options:
--project-number
or-p
: specifying the project targeting for upgrading.--all
or-a
: upgrades all the projects inside the solution.Obviously, there should be either -p or -a in the command.
--major
: upgrades the X part of the version.--minor
: upgrades the Y part of the version.--patch
: upgrades the Z part of the version.
There are two ways of upgrading the projects:
- By specifying the project number printing in
dotnet-sver list
result using--project-number
or-p
option.$ dotnet-sver upgrade -p <project-number> [version-part-option] # For instance, the following command, upgrades the Z part of the version of the project number #3: $ dotnet-sver upgrade -p 3 --patch
- And IF you want to upgrade all the versions of the all projects, you can pass
-a
or--all
option.$ dotnet-sver upgrade -a [version-part-option] # For instance, the following command, upgrades the Y part of the version of the all projects. $ dotnet-sver upgrade -a --minor
Downgrade Command
Options:
--project-number
or-p
: specifying the project targeting for downgrading.--all
or-a
: downgrades all the projects inside the solution.Obviously, there should be either -p or -a in the command.
--major
: downgrades the X part of the version.--minor
: downgrades the Y part of the version.--patch
: downgrades the Z part of the version.
There are two ways of downgrading the projects:
- By specifying the project number printing in
dotnet-sver list
result using--project-number
or-p
option.$ dotnet-sver downgrade -p <project-number> [version-part-option] # For instance, the following command, downgrades the Z part of the version of the project number #3: $ dotnet-sver downgrade -p 3 --patch
- And IF you want to downgrade all the versions of the all projects, you can pass
-a
or--all
option.$ dotnet-sver downgrade -a [version-part-option] # For instance, the following command, downgrades the Y part of the version of the all projects. $ dotnet-sver downgrade -a --minor
Set Command
Maybe you'll be more comfortable to set the versions explicitly. I have your back 😎. Use the magical set
command.
Options:
--project-number
or-p
: specifying the project targeting for upgrading.--all
or-a
: downgrades all the projects inside the solution.Obviously, there should be either -p or -a in the command.
There are two ways of setting the projects:
- By specifying the project number printing in
dotnet-sver list
result using--project-number
or-p
option.$ dotnet-sver downgrade -p <project-number> [version-part-option] # For instance, the following command, downgrades the Z part of the version of the project number #3: $ dotnet-sver downgrade -p 3 --patch
- And IF you want to downgrade all the versions of the all projects, you can pass
-a
or--all
option.$ dotnet-sver downgrade -a [version-part-option] # For instance, the following command, downgrades the Y part of the version of the all projects. $ dotnet-sver downgrade -a --minor
Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvement, please open an issue on the GitHub repository. Pull requests are also appreciated.
License
This project is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
Version | Downloads | Last Updated |
---|---|---|
0.3.2 | 263 | 5/8/2023 |