Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use a custom MSBuild task #971

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions MinVer/Logger.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System;
using Microsoft.Build.Utilities;
using MinVer.Lib;

namespace MinVer;

internal sealed class Logger(Verbosity verbosity) : ILogger
internal sealed class Logger(Verbosity verbosity, TaskLoggingHelper taskLoggingHelper) : ILogger
{
private readonly Verbosity verbosity = verbosity;

Expand All @@ -16,45 +17,52 @@
// warnings are deliberately shown at quiet level
public bool IsWarnEnabled => this.verbosity >= Verbosity.Quiet;

public bool Trace(string message) => this.IsTraceEnabled && Message(message);

Check warning on line 20 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-20.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 20 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-6.0

Add 'this' or 'Me' qualification

Check warning on line 20 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 20 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / infer-sharp

Add 'this' or 'Me' qualification (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0009)

Check warning on line 20 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-7.0

Add 'this' or 'Me' qualification

Check warning on line 20 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-12-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 20 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-11-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 20 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2019-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 20 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2022-sdk-8.0

Add 'this' or 'Me' qualification

public bool Debug(string message) => this.IsDebugEnabled && Message(message);

Check warning on line 22 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-20.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 22 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-6.0

Add 'this' or 'Me' qualification

Check warning on line 22 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 22 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / infer-sharp

Add 'this' or 'Me' qualification (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0009)

Check warning on line 22 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-7.0

Add 'this' or 'Me' qualification

Check warning on line 22 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-12-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 22 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-11-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 22 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2019-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 22 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2022-sdk-8.0

Add 'this' or 'Me' qualification

public bool Info(string message) => this.IsInfoEnabled && Message(message);

Check warning on line 24 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-20.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 24 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-6.0

Add 'this' or 'Me' qualification

Check warning on line 24 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 24 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / infer-sharp

Add 'this' or 'Me' qualification (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0009)

Check warning on line 24 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-7.0

Add 'this' or 'Me' qualification

Check warning on line 24 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-12-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 24 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-11-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 24 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2019-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 24 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2022-sdk-8.0

Add 'this' or 'Me' qualification

public bool Warn(int code, string message) => this.IsWarnEnabled && Message($"warning MINVER{code:D4} : {message}");

Check warning on line 26 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-20.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 26 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-6.0

Add 'this' or 'Me' qualification

Check warning on line 26 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 26 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / infer-sharp

Add 'this' or 'Me' qualification (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0009)

Check warning on line 26 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-7.0

Add 'this' or 'Me' qualification

Check warning on line 26 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-12-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 26 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-11-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 26 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2019-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 26 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2022-sdk-8.0

Add 'this' or 'Me' qualification

public static void ErrorWorkDirDoesNotExist(string workDir) =>
public void ErrorWorkDirDoesNotExist(string workDir) =>
Error(1002, $"Working directory '{workDir}' does not exist.");

Check warning on line 29 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-20.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 29 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-6.0

Add 'this' or 'Me' qualification

Check warning on line 29 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 29 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / infer-sharp

Add 'this' or 'Me' qualification (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0009)

Check warning on line 29 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-7.0

Add 'this' or 'Me' qualification

Check warning on line 29 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-12-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 29 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-11-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 29 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2019-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 29 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2022-sdk-8.0

Add 'this' or 'Me' qualification

public static void ErrorInvalidAutoIncrement(string autoIncrement) =>
public void ErrorInvalidAutoIncrement(string autoIncrement) =>
Error(1006, $"Invalid auto increment '{autoIncrement}'. Valid values are {VersionPartExtensions.ValidValues}");

Check warning on line 32 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-20.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 32 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-6.0

Add 'this' or 'Me' qualification

Check warning on line 32 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 32 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / infer-sharp

Add 'this' or 'Me' qualification (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0009)

Check warning on line 32 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-7.0

Add 'this' or 'Me' qualification

Check warning on line 32 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-12-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 32 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-11-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 32 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2019-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 32 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2022-sdk-8.0

Add 'this' or 'Me' qualification

public static void ErrorInvalidMinMajorMinor(string minMajorMinor) =>
public void ErrorInvalidMinMajorMinor(string minMajorMinor) =>
Error(1003, $"Invalid minimum MAJOR.MINOR '{minMajorMinor}'. Valid values are {MajorMinor.ValidValues}");

Check warning on line 35 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-20.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 35 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-6.0

Add 'this' or 'Me' qualification

Check warning on line 35 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 35 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / infer-sharp

Add 'this' or 'Me' qualification (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0009)

Check warning on line 35 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-7.0

Add 'this' or 'Me' qualification

Check warning on line 35 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-12-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 35 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-11-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 35 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2019-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 35 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2022-sdk-8.0

Add 'this' or 'Me' qualification

public static void ErrorInvalidVerbosity(string verbosity) =>
public void ErrorInvalidVerbosity(string verbosity) =>
Error(1004, $"Invalid verbosity '{verbosity}'. Valid values are {VerbosityMap.ValidValues}.");

Check warning on line 38 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-20.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 38 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-6.0

Add 'this' or 'Me' qualification

Check warning on line 38 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 38 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / infer-sharp

Add 'this' or 'Me' qualification (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0009)

Check warning on line 38 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-7.0

Add 'this' or 'Me' qualification

Check warning on line 38 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-12-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 38 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-11-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 38 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2019-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 38 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2022-sdk-8.0

Add 'this' or 'Me' qualification

#if MINVER
public static void ErrorInvalidVersionOverride(string versionOverride) =>
public void ErrorInvalidVersionOverride(string versionOverride) =>
Error(1005, $"Invalid version override '{versionOverride}'");

Check warning on line 42 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-20.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 42 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-6.0

Add 'this' or 'Me' qualification

Check warning on line 42 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 42 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / infer-sharp

Add 'this' or 'Me' qualification (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0009)

Check warning on line 42 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-7.0

Add 'this' or 'Me' qualification

Check warning on line 42 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-12-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 42 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-11-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 42 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2019-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 42 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2022-sdk-8.0

Add 'this' or 'Me' qualification
#endif

public static void ErrorNoGit(string message) =>
public void ErrorNoGit(string message) =>
Error(1007, message);

Check warning on line 46 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-20.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 46 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-6.0

Add 'this' or 'Me' qualification

Check warning on line 46 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 46 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / ubuntu-22.04-sdk-7.0

Add 'this' or 'Me' qualification

Check warning on line 46 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-12-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 46 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / macos-11-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 46 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2019-sdk-8.0

Add 'this' or 'Me' qualification

Check warning on line 46 in MinVer/Logger.cs

View workflow job for this annotation

GitHub Actions / windows-2022-sdk-8.0

Add 'this' or 'Me' qualification

private static void Error(int code, string message) => Message($"error MINVER{code:D4} : {message}");
private void Error(int code, string message) => Message($"error MINVER{code:D4} : {message}", true);

private static bool Message(string message)
private bool Message(string message, bool error = false)
{
if (message.Contains('\r', StringComparison.OrdinalIgnoreCase) || message.Contains('\n', StringComparison.OrdinalIgnoreCase))
{
var lines = message.Replace("\r\n", "\n", StringComparison.OrdinalIgnoreCase).Split('\r', '\n');
message = string.Join($"{Environment.NewLine}MinVer: ", lines);
}

Console.Error.WriteLine($"MinVer: {message}");
if (error)
{
taskLoggingHelper.LogError($"MinVer: {message}");
}
else
{
taskLoggingHelper.LogMessage($"MinVer: {message}");
}

return true;
}
Expand Down
13 changes: 4 additions & 9 deletions MinVer/MinVer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,21 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<!-- NU5100: The folder being packaged contains an assembly file that is not in lib folder. -->
<NoWarn>$(NoWarn);NU5100</NoWarn>
<OutputType>Exe</OutputType>
<PackageIcon>minver.png</PackageIcon>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/adamralph/minver</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageReleaseNotes>https://github.com/adamralph/minver/blob/main/CHANGELOG.md</PackageReleaseNotes>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RollForward>major</RollForward>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<LangVersion>default</LangVersion>
<Version>6.0.0</Version>
adamralph marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

<ItemGroup>
<Compile Include="..\minver-cli\Options.cs" Link="Options.cs" />
<Compile Include="..\minver-cli\Program.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.0" PrivateAssets="All" Publish="true" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
adamralph marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.8.3" PrivateAssets="All" ExcludeAssets="runtime" />
</ItemGroup>

<ItemGroup>
Expand Down
101 changes: 101 additions & 0 deletions MinVer/MinVerTask.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
using System.IO;
using System.Linq;
using System.Reflection;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using MinVer.Lib;

using Version = MinVer.Lib.Version;

namespace MinVer;

public class MinVerTask : Task
{
public string? WorkingDirectory { get; set; }

public string? AutoIncrement { get; set; }

public string? BuildMeta { get; set; }

public string? DefaultPreReleaseIdentifiers { get; set; }

public string? DefaultPreReleasePhase { get; set; }

public bool? IgnoreHeight { get; set; }

public string? MinMajorMinor { get; set; }

public string? TagPrefix { get; set; }

public string? Verbosity { get; set; }

public string? VersionOverride { get; set; }

[Output]
public string? Version { get; set; }

public override bool Execute()
{
var log = new Logger(MinVer.Verbosity.Detailed, Log);

var informationalVersion = typeof(Versioner).Assembly.GetCustomAttributes<AssemblyInformationalVersionAttribute>().Single().InformationalVersion;

var workDir = WorkingDirectory ?? ".";

if (!Directory.Exists(workDir))
{
log.ErrorWorkDirDoesNotExist(workDir);
return false;
}

if (!Options.TryParse(
log,
AutoIncrement,
BuildMeta,
DefaultPreReleaseIdentifiers,
DefaultPreReleasePhase,
IgnoreHeight,
MinMajorMinor,
TagPrefix,
Verbosity,
VersionOverride,
out var options))
{
return false;
}

_ = log.IsDebugEnabled && log.Debug($"MinVer {informationalVersion}.");

if (options.VersionOverride != null)
{
_ = log.IsInfoEnabled && log.Info($"Using version override {options.VersionOverride}.");

Version = VersionOverride.ToString();

Check warning on line 73 in MinVer/MinVerTask.cs

View workflow job for this annotation

GitHub Actions / infer-sharp

Dereference of a possibly null reference.

return true;
}

var defaultPreReleaseIdentifiers = options.DefaultPreReleaseIdentifiers;
if (!string.IsNullOrEmpty(options.DefaultPreReleasePhase))
{
log.Warn(1008, $"MinVerDefaultPreReleasePhase is deprecated and will be removed in the next major version. Use MinVerDefaultPreReleaseIdentifiers instead, with an additional \"0\" identifier. For example, if you are setting MinVerDefaultPreReleasePhase to \"preview\", set MinVerDefaultPreReleaseIdentifiers to \"preview.0\" instead.");

defaultPreReleaseIdentifiers ??= new[] { options.DefaultPreReleasePhase, "0", };
}

Version version;
try
{
version = Versioner.GetVersion(workDir, options.TagPrefix ?? "", options.MinMajorMinor ?? MajorMinor.Default, options.BuildMeta ?? "", options.AutoIncrement ?? default, defaultPreReleaseIdentifiers ?? PreReleaseIdentifiers.Default, options.IgnoreHeight ?? false, log);
}
catch (NoGitException ex)
{
log.ErrorNoGit(ex.Message);
return false;
}

Version = version.ToString();

return true;
}
}
Loading
Loading