This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.MinVer.
Summary
Run the MinVer dotnet tool using the specified settings.
- Assembly
- Cake
.MinVer .dll - Namespace
- Cake
.MinVer - Containing Type
- MinVerAliases
Syntax
public static MinVerVersion MinVer(this ICakeContext context, MinVerSettings settings)
Examples
Increment the major version (e.g. 'dotnet minver --auto-increment major')
var settings = new MinVerSettings
{
AutoIncrement = MinVerAutoIncrement.Major,
};
var buildVersion = MinVer(settings);
Information($"Version: {buildVersion.Version}");
// ...
Set the build metadata (e.g. 'dotnet minver --build-metadata abcdefg')
var settings = new MinVerSettings
{
BuildMetadata = "abcdefg",
};
var buildVersion = MinVer(settings);
Information($"Version: {buildVersion.Version}");
// ...
Set the default pre-release phase (e.g. 'dotnet minver --default-pre-release-phase preview')
var settings = new MinVerSettings
{
DefaultPreReleasePhase = "preview",
};
var buildVersion = MinVer(settings);
Information($"Version: {buildVersion.Version}");
// ...
Set the minimum major and minor version (e.g. 'dotnet minver --minimum-major-minor 2.5')
var settings = new MinVerSettings
{
MinimumMajorMinor = "2.5",
};
var buildVersion = MinVer(settings);
Information($"Version: {buildVersion.Version}");
// ...
Set the working directory for MinVer to use (e.g. 'dotnet minver --repo C:\MyProject')
var settings = new MinVerSettings
{
Repo = @"C:\MyProject",
};
var buildVersion = MinVer(settings);
Information($"Version: {buildVersion.Version}");
// ...
Set the tag prefix (e.g. 'dotnet minver --tag-prefix v')
var settings = new MinVerSettings
{
TagPrefix = "v",
};
var buildVersion = MinVer(settings);
Information($"Version: {buildVersion.Version}");
// ...
Run MinVer as a global tool (e.g. 'minver'), instead of local tool (e.g. 'dotnet minver')
var settings = new MinVerSettings
{
PreferGlobalTool = true,
};
var buildVersion = MinVer(settings);
Information($"Version: {buildVersion.Version}");
// ...
Disable the automatic fallback to global tool (or local tool) in case of errors
var settings = new MinVerSettings
{
NoFallback = true,
};
var buildVersion = MinVer(settings);
Information($"Version: {buildVersion.Version}");
// ...
Set the verbosity (e.g. 'dotnet minver --verbosity trace')
var settings = new MinVerSettings
{
Verbosity = MinVerVerbosity.Trace,
};
var buildVersion = MinVer(settings);
Information($"Version: {buildVersion.Version}");
// ...
Attributes
Type | Description |
---|---|
Cake |
|
Cake |
Parameters
Name | Type | Description |
---|---|---|
context | ICakeContext | The context. |
settings | MinVerSettings | The settings. |
Return Value
Type | Description |
---|---|
MinVerVersion |