diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md index 597757df8a..7a1a71b53e 100644 --- a/.github/ISSUE_TEMPLATE/documentation.md +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -1,6 +1,6 @@ --- name: Documentation -about: Describe this issue template's purpose here. +about: Describe the missing/wrong information in the documentation. title: "[Docs]" labels: documentation assignees: '' diff --git a/.github/ISSUE_TEMPLATE/failing-test.md b/.github/ISSUE_TEMPLATE/failing-test.md index 252723f267..7e51b93a1f 100644 --- a/.github/ISSUE_TEMPLATE/failing-test.md +++ b/.github/ISSUE_TEMPLATE/failing-test.md @@ -1,6 +1,6 @@ --- name: Failing test -about: Describe this issue template's purpose here. +about: Describe the scenario you have as a unit test. title: "[Failing test]" labels: failing test case assignees: '' diff --git a/.github/ISSUE_TEMPLATE/improvement-request.md b/.github/ISSUE_TEMPLATE/improvement-request.md index eb0b004e01..20cb160417 100644 --- a/.github/ISSUE_TEMPLATE/improvement-request.md +++ b/.github/ISSUE_TEMPLATE/improvement-request.md @@ -1,6 +1,6 @@ --- name: Improvement request -about: Describe this issue template's purpose here. +about: Describe the change you want to request. title: "[Improvement]" labels: improvement assignees: '' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 308dbff8dd..fa5b539891 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -13,7 +13,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v7 + - uses: actions/stale@v8 with: # set 'stale' label stale-issue-label: stale diff --git a/build/Directory.Packages.props b/build/Directory.Packages.props index d91d774b51..85f9608e8c 100644 --- a/build/Directory.Packages.props +++ b/build/Directory.Packages.props @@ -1,4 +1,4 @@ - + true @@ -7,7 +7,7 @@ - + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index ea5ea84439..5468cd9bae 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -4,7 +4,7 @@ - + diff --git a/src/GitVersion.App.Tests/ArgumentParserOnBuildServerTests.cs b/src/GitVersion.App.Tests/ArgumentParserOnBuildServerTests.cs index 9fa43bde12..8be300083d 100644 --- a/src/GitVersion.App.Tests/ArgumentParserOnBuildServerTests.cs +++ b/src/GitVersion.App.Tests/ArgumentParserOnBuildServerTests.cs @@ -34,7 +34,7 @@ private class MockBuildAgent : ICurrentBuildAgent public bool IsDefault => false; public bool CanApplyToCurrentContext() => throw new NotImplementedException(); - public void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) => throw new NotImplementedException(); + public void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) => throw new NotImplementedException(); public string GetCurrentBranch(bool usingDynamicRepos) => throw new NotImplementedException(); diff --git a/src/GitVersion.App.Tests/ArgumentParserTests.cs b/src/GitVersion.App.Tests/ArgumentParserTests.cs index cf7d231972..656e8b33df 100644 --- a/src/GitVersion.App.Tests/ArgumentParserTests.cs +++ b/src/GitVersion.App.Tests/ArgumentParserTests.cs @@ -395,7 +395,7 @@ private static IEnumerable OverrideconfigWithInvalidOptionTestData } [TestCaseSource(nameof(OverrideConfigWithSingleOptionTestData))] - public void OverrideConfigWithSingleOptions(string options, GitVersionConfiguration expected) + public void OverrideConfigWithSingleOptions(string options, IGitVersionConfiguration expected) { var arguments = this.argumentParser.ParseArguments($"/overrideconfig {options}"); @@ -534,7 +534,7 @@ private static IEnumerable OverrideConfigWithSingleOptionTestData( } [TestCaseSource(nameof(OverrideConfigWithMultipleOptionsTestData))] - public void OverrideConfigWithMultipleOptions(string options, GitVersionConfiguration expected) + public void OverrideConfigWithMultipleOptions(string options, IGitVersionConfiguration expected) { var arguments = this.argumentParser.ParseArguments(options); ConfigurationHelper configurationHelper = new(arguments.OverrideConfiguration); diff --git a/src/GitVersion.App.Tests/Helpers/ExecutionResults.cs b/src/GitVersion.App.Tests/Helpers/ExecutionResults.cs index c56e6aef9d..d56be9834f 100644 --- a/src/GitVersion.App.Tests/Helpers/ExecutionResults.cs +++ b/src/GitVersion.App.Tests/Helpers/ExecutionResults.cs @@ -15,7 +15,7 @@ public ExecutionResults(int exitCode, string output, string? logContents) public string Output { get; } public string? Log { get; } - public virtual VersionVariables OutputVariables + public virtual GitVersionVariables OutputVariables { get { @@ -23,7 +23,7 @@ public virtual VersionVariables OutputVariables var jsonEndIndex = Output.IndexOf("}", StringComparison.Ordinal); var json = Output.Substring(jsonStartIndex, jsonEndIndex - jsonStartIndex + 1); - return VersionVariables.FromJson(json); + return VersionVariablesHelper.FromJson(json); } } } diff --git a/src/GitVersion.App.Tests/Helpers/ProgramFixture.cs b/src/GitVersion.App.Tests/Helpers/ProgramFixture.cs index 82880b04f5..61d1297bb8 100644 --- a/src/GitVersion.App.Tests/Helpers/ProgramFixture.cs +++ b/src/GitVersion.App.Tests/Helpers/ProgramFixture.cs @@ -80,7 +80,7 @@ public class ProgramFixtureResult public string? Output { get; set; } public string Log { get; set; } - public VersionVariables? OutputVariables + public GitVersionVariables? OutputVariables { get { @@ -90,7 +90,7 @@ public VersionVariables? OutputVariables var jsonEndIndex = Output.IndexOf("}", StringComparison.Ordinal); var json = Output.Substring(jsonStartIndex, jsonEndIndex - jsonStartIndex + 1); - return VersionVariables.FromJson(json); + return VersionVariablesHelper.FromJson(json); } } } diff --git a/src/GitVersion.App.Tests/JsonOutputOnBuildServerTest.cs b/src/GitVersion.App.Tests/JsonOutputOnBuildServerTest.cs index 7885e475bd..4328477bb8 100644 --- a/src/GitVersion.App.Tests/JsonOutputOnBuildServerTest.cs +++ b/src/GitVersion.App.Tests/JsonOutputOnBuildServerTest.cs @@ -61,7 +61,7 @@ public void BeingOnBuildServerWithOutputJsonAndOutputFileDoesNotFail(string outp var filePath = PathHelper.Combine(fixture.LocalRepositoryFixture.RepositoryPath, fileName); var json = File.ReadAllText(filePath); - var outputVariables = VersionVariables.FromJson(json); + var outputVariables = VersionVariablesHelper.FromJson(json); outputVariables.ShouldNotBeNull(); outputVariables.FullSemVer.ShouldBeEquivalentTo(expectedVersion); } diff --git a/src/GitVersion.App.Tests/UpdateWixVersionFileTests.cs b/src/GitVersion.App.Tests/UpdateWixVersionFileTests.cs index 1405fc018c..bb81a451ea 100644 --- a/src/GitVersion.App.Tests/UpdateWixVersionFileTests.cs +++ b/src/GitVersion.App.Tests/UpdateWixVersionFileTests.cs @@ -37,7 +37,7 @@ public void WixVersionFileVarCountTest() GitVersionHelper.ExecuteIn(fixture.RepositoryPath, arguments: " /updatewixversionfile"); var gitVersionVarsInWix = GetGitVersionVarsInWixFile(PathHelper.Combine(fixture.RepositoryPath, this.wixVersionFileName)); - var gitVersionVars = VersionVariables.AvailableVariables; + var gitVersionVars = GitVersionVariables.AvailableVariables; Assert.That(gitVersionVarsInWix, Has.Count.EqualTo(gitVersionVars.Count())); } @@ -55,7 +55,7 @@ public void WixVersionFileContentTest() GitVersionHelper.ExecuteIn(fixture.RepositoryPath, arguments: " /updatewixversionfile"); var gitVersionVarsInWix = GetGitVersionVarsInWixFile(PathHelper.Combine(fixture.RepositoryPath, this.wixVersionFileName)); - var gitVersionVars = VersionVariables.AvailableVariables; + var gitVersionVars = GitVersionVariables.AvailableVariables; foreach (var variable in gitVersionVars) { diff --git a/src/GitVersion.App/ArgumentParser.cs b/src/GitVersion.App/ArgumentParser.cs index 8cc710d59e..f44dedddd2 100644 --- a/src/GitVersion.App/ArgumentParser.cs +++ b/src/GitVersion.App/ArgumentParser.cs @@ -6,13 +6,14 @@ namespace GitVersion; -public class ArgumentParser : IArgumentParser +internal class ArgumentParser : IArgumentParser { private readonly IEnvironment environment; private readonly ICurrentBuildAgent buildAgent; private readonly IConsole console; private readonly IGlobbingResolver globbingResolver; private const string defaultOutputFileName = "GitVersion.json"; + private static readonly IEnumerable availableVariables = GitVersionVariables.AvailableVariables; public ArgumentParser(IEnvironment environment, ICurrentBuildAgent buildAgent, IConsole console, IGlobbingResolver globbingResolver) { @@ -382,13 +383,13 @@ private static void ParseShowVariable(Arguments arguments, string? value, string if (!value.IsNullOrWhiteSpace()) { - versionVariable = VersionVariables.AvailableVariables.SingleOrDefault(av => av.Equals(value.Replace("'", ""), StringComparison.CurrentCultureIgnoreCase)); + versionVariable = availableVariables.SingleOrDefault(av => av.Equals(value.Replace("'", ""), StringComparison.CurrentCultureIgnoreCase)); } if (versionVariable == null) { var message = $"{name} requires a valid version variable. Available variables are:{System.Environment.NewLine}" + - string.Join(", ", VersionVariables.AvailableVariables.Select(x => string.Concat("'", x, "'"))); + string.Join(", ", availableVariables.Select(x => string.Concat("'", x, "'"))); throw new WarningException(message); } @@ -399,14 +400,14 @@ private static void ParseFormat(Arguments arguments, string? value) { if (value.IsNullOrWhiteSpace()) { - throw new WarningException("Format requires a valid format string. Available variables are: " + string.Join(", ", VersionVariables.AvailableVariables)); + throw new WarningException("Format requires a valid format string. Available variables are: " + string.Join(", ", availableVariables)); } - var foundVariable = VersionVariables.AvailableVariables.Any(variable => value.Contains(variable, StringComparison.CurrentCultureIgnoreCase)); + var foundVariable = availableVariables.Any(variable => value.Contains(variable, StringComparison.CurrentCultureIgnoreCase)); if (!foundVariable) { - throw new WarningException("Format requires a valid format string. Available variables are: " + string.Join(", ", VersionVariables.AvailableVariables)); + throw new WarningException("Format requires a valid format string. Available variables are: " + string.Join(", ", availableVariables)); } arguments.Format = value; diff --git a/src/GitVersion.App/Arguments.cs b/src/GitVersion.App/Arguments.cs index d5c6c845e0..0680e196e5 100644 --- a/src/GitVersion.App/Arguments.cs +++ b/src/GitVersion.App/Arguments.cs @@ -2,7 +2,7 @@ namespace GitVersion; -public class Arguments +internal class Arguments { public AuthenticationInfo Authentication = new(); diff --git a/src/GitVersion.App/GitVersionAppModule.cs b/src/GitVersion.App/GitVersionAppModule.cs index abbfe807e7..b635179377 100644 --- a/src/GitVersion.App/GitVersionAppModule.cs +++ b/src/GitVersion.App/GitVersionAppModule.cs @@ -2,7 +2,7 @@ namespace GitVersion; -public class GitVersionAppModule : IGitVersionModule +internal class GitVersionAppModule : IGitVersionModule { public void RegisterTypes(IServiceCollection services) { diff --git a/src/GitVersion.App/GitVersionExecutor.cs b/src/GitVersion.App/GitVersionExecutor.cs index eb716e956a..5659f5d40f 100644 --- a/src/GitVersion.App/GitVersionExecutor.cs +++ b/src/GitVersion.App/GitVersionExecutor.cs @@ -4,7 +4,7 @@ namespace GitVersion; -public class GitVersionExecutor : IGitVersionExecutor +internal class GitVersionExecutor : IGitVersionExecutor { private readonly ILog log; private readonly IConsole console; diff --git a/src/GitVersion.App/GlobbingResolver.cs b/src/GitVersion.App/GlobbingResolver.cs index a79712f67f..43851b5435 100644 --- a/src/GitVersion.App/GlobbingResolver.cs +++ b/src/GitVersion.App/GlobbingResolver.cs @@ -3,7 +3,7 @@ namespace GitVersion; -public class GlobbingResolver : IGlobbingResolver +internal class GlobbingResolver : IGlobbingResolver { private readonly Matcher matcher = new(StringComparison.OrdinalIgnoreCase); diff --git a/src/GitVersion.App/HelpWriter.cs b/src/GitVersion.App/HelpWriter.cs index 664e281207..844d7763c7 100644 --- a/src/GitVersion.App/HelpWriter.cs +++ b/src/GitVersion.App/HelpWriter.cs @@ -3,7 +3,7 @@ namespace GitVersion; -public class HelpWriter : IHelpWriter +internal class HelpWriter : IHelpWriter { private readonly IVersionWriter versionWriter; private readonly IConsole console; diff --git a/src/GitVersion.App/IArgumentParser.cs b/src/GitVersion.App/IArgumentParser.cs index 0b54023c06..df71145f08 100644 --- a/src/GitVersion.App/IArgumentParser.cs +++ b/src/GitVersion.App/IArgumentParser.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public interface IArgumentParser +internal interface IArgumentParser { Arguments ParseArguments(string commandLineArguments); Arguments ParseArguments(string[] commandLineArguments); diff --git a/src/GitVersion.App/IGitVersionExecutor.cs b/src/GitVersion.App/IGitVersionExecutor.cs index 0bca364649..d65689e765 100644 --- a/src/GitVersion.App/IGitVersionExecutor.cs +++ b/src/GitVersion.App/IGitVersionExecutor.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public interface IGitVersionExecutor +internal interface IGitVersionExecutor { int Execute(GitVersionOptions gitVersionOptions); } diff --git a/src/GitVersion.App/IGlobbingResolver.cs b/src/GitVersion.App/IGlobbingResolver.cs index 161e649067..a65374573d 100644 --- a/src/GitVersion.App/IGlobbingResolver.cs +++ b/src/GitVersion.App/IGlobbingResolver.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public interface IGlobbingResolver +internal interface IGlobbingResolver { public IEnumerable Resolve(string workingDirectory, string pattern); } diff --git a/src/GitVersion.App/IHelpWriter.cs b/src/GitVersion.App/IHelpWriter.cs index 81c7b998b8..652badd469 100644 --- a/src/GitVersion.App/IHelpWriter.cs +++ b/src/GitVersion.App/IHelpWriter.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public interface IHelpWriter +internal interface IHelpWriter { void Write(); void WriteTo(Action writeAction); diff --git a/src/GitVersion.App/IVersionWriter.cs b/src/GitVersion.App/IVersionWriter.cs index 736ec6a6f6..cadaec1b79 100644 --- a/src/GitVersion.App/IVersionWriter.cs +++ b/src/GitVersion.App/IVersionWriter.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public interface IVersionWriter +internal interface IVersionWriter { void Write(Assembly assembly); void WriteTo(Assembly assembly, Action writeAction); diff --git a/src/GitVersion.App/PublicAPI.Unshipped.txt b/src/GitVersion.App/PublicAPI.Unshipped.txt index db97d37558..7dc5c58110 100644 --- a/src/GitVersion.App/PublicAPI.Unshipped.txt +++ b/src/GitVersion.App/PublicAPI.Unshipped.txt @@ -1,69 +1 @@ #nullable enable -GitVersion.ArgumentParser -GitVersion.ArgumentParser.ArgumentParser(GitVersion.IEnvironment! environment, GitVersion.Agents.ICurrentBuildAgent! buildAgent, GitVersion.Logging.IConsole! console, GitVersion.IGlobbingResolver! globbingResolver) -> void -GitVersion.ArgumentParser.ParseArguments(string! commandLineArguments) -> GitVersion.Arguments! -GitVersion.ArgumentParser.ParseArguments(string![]! commandLineArguments) -> GitVersion.Arguments! -GitVersion.Arguments -GitVersion.Arguments.Arguments() -> void -GitVersion.Arguments.Authentication -> GitVersion.AuthenticationInfo! -GitVersion.Arguments.ClonePath -> string? -GitVersion.Arguments.CommitId -> string? -GitVersion.Arguments.ConfigurationFile -> string? -GitVersion.Arguments.Diag -> bool -GitVersion.Arguments.EnsureAssemblyInfo -> bool -GitVersion.Arguments.Format -> string? -GitVersion.Arguments.Init -> bool -GitVersion.Arguments.IsHelp -> bool -GitVersion.Arguments.IsVersion -> bool -GitVersion.Arguments.LogFilePath -> string? -GitVersion.Arguments.NoCache -> bool -GitVersion.Arguments.NoFetch -> bool -GitVersion.Arguments.NoNormalize -> bool -GitVersion.Arguments.Output -> System.Collections.Generic.ISet! -GitVersion.Arguments.OutputFile -> string? -GitVersion.Arguments.OverrideConfiguration -> System.Collections.Generic.IReadOnlyDictionary! -GitVersion.Arguments.ShowConfiguration -> bool -GitVersion.Arguments.ShowVariable -> string? -GitVersion.Arguments.TargetBranch -> string? -GitVersion.Arguments.TargetPath -> string? -GitVersion.Arguments.TargetUrl -> string? -GitVersion.Arguments.ToOptions() -> GitVersion.GitVersionOptions! -GitVersion.Arguments.UpdateAssemblyInfo -> bool -GitVersion.Arguments.UpdateAssemblyInfoFileName -> System.Collections.Generic.ISet! -GitVersion.Arguments.UpdateProjectFiles -> bool -GitVersion.Arguments.UpdateWixVersionFile -> bool -GitVersion.Arguments.Verbosity -> GitVersion.Logging.Verbosity -GitVersion.GitVersionAppModule -GitVersion.GitVersionAppModule.GitVersionAppModule() -> void -GitVersion.GitVersionAppModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -GitVersion.GitVersionExecutor -GitVersion.GitVersionExecutor.Execute(GitVersion.GitVersionOptions! gitVersionOptions) -> int -GitVersion.GitVersionExecutor.GitVersionExecutor(GitVersion.Logging.ILog! log, GitVersion.Logging.IConsole! console, GitVersion.Configuration.IConfigurationFileLocator! configurationFileLocator, GitVersion.Configuration.IConfigurationProvider! configurationProvider, GitVersion.IGitVersionCalculateTool! gitVersionCalculateTool, GitVersion.IGitVersionOutputTool! gitVersionOutputTool, GitVersion.IVersionWriter! versionWriter, GitVersion.IHelpWriter! helpWriter, GitVersion.IGitRepositoryInfo! repositoryInfo) -> void -GitVersion.GlobbingResolver -GitVersion.GlobbingResolver.GlobbingResolver() -> void -GitVersion.GlobbingResolver.Resolve(string! workingDirectory, string! pattern) -> System.Collections.Generic.IEnumerable! -GitVersion.HelpWriter -GitVersion.HelpWriter.HelpWriter(GitVersion.IVersionWriter! versionWriter, GitVersion.Logging.IConsole! console) -> void -GitVersion.HelpWriter.Write() -> void -GitVersion.HelpWriter.WriteTo(System.Action! writeAction) -> void -GitVersion.IArgumentParser -GitVersion.IArgumentParser.ParseArguments(string! commandLineArguments) -> GitVersion.Arguments! -GitVersion.IArgumentParser.ParseArguments(string![]! commandLineArguments) -> GitVersion.Arguments! -GitVersion.IGitVersionExecutor -GitVersion.IGitVersionExecutor.Execute(GitVersion.GitVersionOptions! gitVersionOptions) -> int -GitVersion.IGlobbingResolver -GitVersion.IGlobbingResolver.Resolve(string! workingDirectory, string! pattern) -> System.Collections.Generic.IEnumerable! -GitVersion.IHelpWriter -GitVersion.IHelpWriter.Write() -> void -GitVersion.IHelpWriter.WriteTo(System.Action! writeAction) -> void -GitVersion.IVersionWriter -GitVersion.IVersionWriter.Write(System.Reflection.Assembly! assembly) -> void -GitVersion.IVersionWriter.WriteTo(System.Reflection.Assembly! assembly, System.Action! writeAction) -> void -GitVersion.QuotedStringHelpers -GitVersion.VersionWriter -GitVersion.VersionWriter.VersionWriter(GitVersion.Logging.IConsole! console) -> void -GitVersion.VersionWriter.Write(System.Reflection.Assembly! assembly) -> void -GitVersion.VersionWriter.WriteTo(System.Reflection.Assembly! assembly, System.Action! writeAction) -> void -static GitVersion.QuotedStringHelpers.SplitUnquoted(string? input, char splitChar) -> string![]! -static GitVersion.QuotedStringHelpers.UnquoteText(string! input) -> string! -virtual GitVersion.GlobbingResolver.GetDirectoryInfoWrapper(string! workingDirectory) -> Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoBase! diff --git a/src/GitVersion.App/QuotedStringHelpers.cs b/src/GitVersion.App/QuotedStringHelpers.cs index 15a1c7fa8f..b4ef0a9253 100644 --- a/src/GitVersion.App/QuotedStringHelpers.cs +++ b/src/GitVersion.App/QuotedStringHelpers.cs @@ -2,7 +2,7 @@ namespace GitVersion; -public static class QuotedStringHelpers +internal static class QuotedStringHelpers { /// /// Splits input string based on split-character, ignoring split-character in diff --git a/src/GitVersion.App/VersionWriter.cs b/src/GitVersion.App/VersionWriter.cs index a15889b9ad..e0767b23d1 100644 --- a/src/GitVersion.App/VersionWriter.cs +++ b/src/GitVersion.App/VersionWriter.cs @@ -3,7 +3,7 @@ namespace GitVersion; -public class VersionWriter : IVersionWriter +internal class VersionWriter : IVersionWriter { private readonly IConsole console; diff --git a/src/GitVersion.BuildAgents.Tests/Agents/AzurePipelinesTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/AzurePipelinesTests.cs index bf60590c7b..025cbb5c5f 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/AzurePipelinesTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/AzurePipelinesTests.cs @@ -28,7 +28,7 @@ public void SetEnvironmentVariableForTest() [Test] public void DevelopBranch() { - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Unstable4"); + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Unstable4" }; var vsVersion = this.buildServer.GenerateSetVersionMessage(vars); vsVersion.ShouldBe("##vso[build.updatebuildnumber]Some Build_Value 0.0.0-Unstable4 20151310.3 $(UnknownVar) Release"); @@ -49,7 +49,7 @@ public void MissingEnvShouldNotBlowUp() this.environment.SetEnvironmentVariable(key, null); const string semver = "0.0.0-Unstable4"; - var vars = new TestableVersionVariables(fullSemVer: semver); + var vars = new TestableGitVersionVariables { FullSemVer = semver }; var vsVersion = this.buildServer.GenerateSetVersionMessage(vars); vsVersion.ShouldBe(semver); } @@ -61,7 +61,7 @@ public void MissingEnvShouldNotBlowUp() public void AzurePipelinesBuildNumberWithFullSemVer(string buildNumberFormat, string myFullSemVer, string expectedBuildNumber) { this.environment.SetEnvironmentVariable(key, buildNumberFormat); - var vars = new TestableVersionVariables(fullSemVer: myFullSemVer); + var vars = new TestableGitVersionVariables { FullSemVer = myFullSemVer }; var logMessage = this.buildServer.GenerateSetVersionMessage(vars); logMessage.ShouldBe(logPrefix + expectedBuildNumber); } @@ -73,7 +73,7 @@ public void AzurePipelinesBuildNumberWithFullSemVer(string buildNumberFormat, st public void AzurePipelinesBuildNumberWithSemVer(string buildNumberFormat, string mySemVer, string expectedBuildNumber) { this.environment.SetEnvironmentVariable(key, buildNumberFormat); - var vars = new TestableVersionVariables(semVer: mySemVer); + var vars = new TestableGitVersionVariables { SemVer = mySemVer }; var logMessage = this.buildServer.GenerateSetVersionMessage(vars); logMessage.ShouldBe(logPrefix + expectedBuildNumber); } diff --git a/src/GitVersion.BuildAgents.Tests/Agents/BitBucketPipelinesTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/BitBucketPipelinesTests.cs index 12951340a1..7978ce31ad 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/BitBucketPipelinesTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/BitBucketPipelinesTests.cs @@ -41,7 +41,7 @@ public void CalculateVersionOnMainBranch() // Arrange this.environment.SetEnvironmentVariable(BitBucketPipelines.BranchEnvironmentVariableName, "refs/heads/main"); - var vars = new TestableVersionVariables(fullSemVer: "1.2.3"); + var vars = new TestableGitVersionVariables { FullSemVer = "1.2.3" }; var vsVersion = this.buildServer.GenerateSetVersionMessage(vars); vsVersion.ShouldBe("1.2.3"); @@ -53,7 +53,7 @@ public void CalculateVersionOnDevelopBranch() // Arrange this.environment.SetEnvironmentVariable(BitBucketPipelines.BranchEnvironmentVariableName, "refs/heads/develop"); - var vars = new TestableVersionVariables(fullSemVer: "1.2.3-unstable.4"); + var vars = new TestableGitVersionVariables { FullSemVer = "1.2.3-unstable.4" }; var vsVersion = this.buildServer.GenerateSetVersionMessage(vars); vsVersion.ShouldBe("1.2.3-unstable.4"); @@ -65,7 +65,7 @@ public void CalculateVersionOnFeatureBranch() // Arrange this.environment.SetEnvironmentVariable(BitBucketPipelines.BranchEnvironmentVariableName, "refs/heads/feature/my-work"); - var vars = new TestableVersionVariables(fullSemVer: "1.2.3-beta.4"); + var vars = new TestableGitVersionVariables { FullSemVer = "1.2.3-beta.4" }; var vsVersion = this.buildServer.GenerateSetVersionMessage(vars); vsVersion.ShouldBe("1.2.3-beta.4"); @@ -139,11 +139,7 @@ private void AssertVariablesAreWrittenToFile(string file) Minor = 2, Patch = 3, PreReleaseTag = "beta1", - BuildMetaData = new SemanticVersionBuildMetaData("5") - { - Sha = "f28807e615e9f06aec8a33c87780374e0c1f6fb8", - CommitDate = new DateTimeOffset(2022, 4, 6, 16, 10, 59, TimeSpan.FromHours(10)) - } + BuildMetaData = new SemanticVersionBuildMetaData("5") { Sha = "f28807e615e9f06aec8a33c87780374e0c1f6fb8", CommitDate = new DateTimeOffset(2022, 4, 6, 16, 10, 59, TimeSpan.FromHours(10)) } }; var configuration = new TestEffectiveConfiguration(); diff --git a/src/GitVersion.BuildAgents.Tests/Agents/BuildKiteTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/BuildKiteTests.cs index e09a630261..3cb40d44ec 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/BuildKiteTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/BuildKiteTests.cs @@ -86,7 +86,7 @@ public void GetSetParameterMessageShouldReturnEmptyArray() public void GetEmptyGenerateSetVersionMessage() { // Arrange - var vars = new TestableVersionVariables("1.0.0"); + var vars = new TestableGitVersionVariables { FullSemVer = "1.0.0" }; // Act var message = this.buildServer.GenerateSetVersionMessage(vars); diff --git a/src/GitVersion.BuildAgents.Tests/Agents/BuildServerBaseTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/BuildServerBaseTests.cs index a8cf2d29d8..3ae4bbff53 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/BuildServerBaseTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/BuildServerBaseTests.cs @@ -59,8 +59,8 @@ public BuildAgent(IEnvironment environment, ILog log) : base(environment, log) public override bool CanApplyToCurrentContext() => throw new NotImplementedException(); - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string GenerateSetVersionMessage(GitVersionVariables variables) => variables.FullSemVer; - public override string[] GenerateSetParameterMessage(string name, string value) => Array.Empty(); + public override string[] GenerateSetParameterMessage(string name, string? value) => Array.Empty(); } } diff --git a/src/GitVersion.BuildAgents.Tests/Agents/ContinuaCiTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/ContinuaCiTests.cs index 117ec70119..45f4882ea6 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/ContinuaCiTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/ContinuaCiTests.cs @@ -15,7 +15,7 @@ public class ContinuaCiTests : TestBase public void GenerateBuildVersion() { var buildServer = this.sp.GetRequiredService(); - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Beta4.7"); + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Beta4.7" }; var continuaCiVersion = buildServer.GenerateSetVersionMessage(vars); Assert.That(continuaCiVersion, Is.EqualTo("@@continua[setBuildVersion value='0.0.0-Beta4.7']")); } diff --git a/src/GitVersion.BuildAgents.Tests/Agents/EnvRunTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/EnvRunTests.cs index f54e63c24a..743158f5b1 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/EnvRunTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/EnvRunTests.cs @@ -51,14 +51,14 @@ public void CanApplyToCurrentContextEnvironmentVariableNotSet() [TestCase("1.2.3-rc4")] public void GenerateSetVersionMessage(string fullSemVer) { - var vars = new TestableVersionVariables(fullSemVer: fullSemVer); + var vars = new TestableGitVersionVariables { FullSemVer = fullSemVer }; var version = this.buildServer.GenerateSetVersionMessage(vars); version.ShouldBe(fullSemVer); } [TestCase("Version", "1.2.3", "@@envrun[set name='GitVersion_Version' value='1.2.3']")] [TestCase("Version", "1.2.3-rc4", "@@envrun[set name='GitVersion_Version' value='1.2.3-rc4']")] - public void GenerateSetParameterMessage(string name, string value, string expected) + public void GenerateSetParameterMessage(string name, string? value, string expected) { var output = this.buildServer.GenerateSetParameterMessage(name, value); output.ShouldHaveSingleItem(); diff --git a/src/GitVersion.BuildAgents.Tests/Agents/GitHubActionsTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/GitHubActionsTests.cs index f787016633..f8ff112cc5 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/GitHubActionsTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/GitHubActionsTests.cs @@ -123,7 +123,7 @@ public void SkipEmptySetParameterMessage() public void ShouldWriteIntegration() { // Arrange - var vars = new TestableVersionVariables("1.0.0"); + var vars = new TestableGitVersionVariables { Major = "1.0.0" }; var list = new List(); @@ -134,21 +134,12 @@ public void ShouldWriteIntegration() this.buildServer.WriteIntegration(s => list.Add(s), vars); // Assert - var expected = new List - { - "Executing GenerateSetVersionMessage for 'GitHubActions'.", - "", - "Executing GenerateBuildLogOutput for 'GitHubActions'.", - "Writing version variables to $GITHUB_ENV file for 'GitHubActions'." - }; - - string.Join(System.Environment.NewLine, list) - .ShouldBe(string.Join(System.Environment.NewLine, expected)); - - var expectedFileContents = new List - { - "GitVersion_Major=1.0.0" - }; + var expected = new List { "Executing GenerateSetVersionMessage for 'GitHubActions'.", "", "Executing GenerateBuildLogOutput for 'GitHubActions'.", "Writing version variables to $GITHUB_ENV file for 'GitHubActions'." }; + + string.Join(Environment.NewLine, list) + .ShouldBe(string.Join(Environment.NewLine, expected)); + + var expectedFileContents = new List { "GitVersion_Major=1.0.0" }; this.githubSetEnvironmentTempFilePath.ShouldNotBeNull(); var actualFileContents = File.ReadAllLines(this.githubSetEnvironmentTempFilePath); @@ -160,7 +151,7 @@ public void ShouldWriteIntegration() public void ShouldNotWriteIntegration() { // Arrange - var vars = new TestableVersionVariables("1.0.0"); + var vars = new TestableGitVersionVariables { FullSemVer = "1.0.0" }; var list = new List(); @@ -177,7 +168,7 @@ public void ShouldNotWriteIntegration() public void GetEmptyGenerateSetVersionMessage() { // Arrange - var vars = new TestableVersionVariables("1.0.0"); + var vars = new TestableGitVersionVariables { FullSemVer = "1.0.0" }; // Act var message = this.buildServer.GenerateSetVersionMessage(vars); diff --git a/src/GitVersion.BuildAgents.Tests/Agents/GitLabCiTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/GitLabCiTests.cs index 324d03945e..718239396e 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/GitLabCiTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/GitLabCiTests.cs @@ -21,7 +21,7 @@ public void SetUp() [Test] public void GenerateSetVersionMessageReturnsVersionAsIsAlthoughThisIsNotUsedByJenkins() { - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Beta4.7"); + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Beta4.7" }; this.buildServer.GenerateSetVersionMessage(vars).ShouldBe("0.0.0-Beta4.7"); } @@ -59,11 +59,7 @@ private void AssertVariablesAreWrittenToFile(string file) Minor = 2, Patch = 3, PreReleaseTag = "beta1", - BuildMetaData = new SemanticVersionBuildMetaData("5") - { - Sha = "commitSha", - CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") - } + BuildMetaData = new SemanticVersionBuildMetaData("5") { Sha = "commitSha", CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") } }; var configuration = new TestEffectiveConfiguration(); diff --git a/src/GitVersion.BuildAgents.Tests/Agents/JenkinsTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/JenkinsTests.cs index 8918f4fc50..68305d905a 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/JenkinsTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/JenkinsTests.cs @@ -92,7 +92,7 @@ public void JenkinsTakesBranchNameInPipelineAsCode() [Test] public void GenerateSetVersionMessageReturnsVersionAsIsAlthoughThisIsNotUsedByJenkins() { - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Beta4.7"); + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Beta4.7" }; this.buildServer.GenerateSetVersionMessage(vars).ShouldBe("0.0.0-Beta4.7"); } @@ -130,11 +130,7 @@ private void AssertVariablesAreWrittenToFile(string file) Minor = 2, Patch = 3, PreReleaseTag = "beta1", - BuildMetaData = new SemanticVersionBuildMetaData("5") - { - Sha = "commitSha", - CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") - } + BuildMetaData = new SemanticVersionBuildMetaData("5") { Sha = "commitSha", CommitDate = DateTimeOffset.Parse("2014-03-06 23:59:59Z") } }; var configuration = new TestEffectiveConfiguration(); diff --git a/src/GitVersion.BuildAgents.Tests/Agents/MyGetTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/MyGetTests.cs index 271dd382a4..73eb8fb787 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/MyGetTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/MyGetTests.cs @@ -18,7 +18,7 @@ public void SetUp() [Test] public void DevelopBranch() { - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Unstable4"); + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Unstable4" }; var message = this.buildServer.GenerateSetVersionMessage(vars); Assert.That(message, Is.EqualTo(null)); } diff --git a/src/GitVersion.BuildAgents.Tests/Agents/SpaceAutomationTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/SpaceAutomationTests.cs index dd338a6e71..9afdb28362 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/SpaceAutomationTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/SpaceAutomationTests.cs @@ -87,7 +87,7 @@ public void GetCurrentBranchShouldHandlePullRequests() public void GetEmptyGenerateSetVersionMessage() { // Arrange - var vars = new TestableVersionVariables("1.0.0"); + var vars = new TestableGitVersionVariables { FullSemVer = "1.0.0" }; // Act var message = this.buildServer.GenerateSetVersionMessage(vars); diff --git a/src/GitVersion.BuildAgents.Tests/Agents/TeamCityTests.cs b/src/GitVersion.BuildAgents.Tests/Agents/TeamCityTests.cs index b5cc79b2ea..f2364e3aaf 100644 --- a/src/GitVersion.BuildAgents.Tests/Agents/TeamCityTests.cs +++ b/src/GitVersion.BuildAgents.Tests/Agents/TeamCityTests.cs @@ -18,7 +18,7 @@ public void SetUp() [Test] public void DevelopBranch() { - var vars = new TestableVersionVariables(fullSemVer: "0.0.0-Unstable4"); + var vars = new TestableGitVersionVariables { FullSemVer = "0.0.0-Unstable4" }; var tcVersion = this.buildServer.GenerateSetVersionMessage(vars); Assert.That(tcVersion, Is.EqualTo("##teamcity[buildNumber '0.0.0-Unstable4']")); } diff --git a/src/GitVersion.BuildAgents/Agents/AppVeyor.cs b/src/GitVersion.BuildAgents/Agents/AppVeyor.cs index 6773e1e9d0..d269c285c2 100644 --- a/src/GitVersion.BuildAgents/Agents/AppVeyor.cs +++ b/src/GitVersion.BuildAgents/Agents/AppVeyor.cs @@ -14,7 +14,7 @@ public AppVeyor(IEnvironment environment, ILog log) : base(environment, log) protected override string EnvironmentVariable => EnvironmentVariableName; - public override string GenerateSetVersionMessage(VersionVariables variables) + public override string GenerateSetVersionMessage(GitVersionVariables variables) { var buildNumber = Environment.GetEnvironmentVariable("APPVEYOR_BUILD_NUMBER"); var apiUrl = Environment.GetEnvironmentVariable("APPVEYOR_API_URL") ?? throw new Exception("APPVEYOR_API_URL environment variable not set"); @@ -41,7 +41,7 @@ public override string GenerateSetVersionMessage(VersionVariables variables) return $"Set AppVeyor build number to '{variables.FullSemVer}'."; } - public override string[] GenerateSetParameterMessage(string name, string value) + public override string[] GenerateSetParameterMessage(string name, string? value) { var apiUrl = Environment.GetEnvironmentVariable("APPVEYOR_API_URL") ?? throw new Exception("APPVEYOR_API_URL environment variable not set"); var httpClient = GetHttpClient(apiUrl); diff --git a/src/GitVersion.BuildAgents/Agents/AzurePipelines.cs b/src/GitVersion.BuildAgents/Agents/AzurePipelines.cs index f00ed12f06..ae3743ba35 100644 --- a/src/GitVersion.BuildAgents/Agents/AzurePipelines.cs +++ b/src/GitVersion.BuildAgents/Agents/AzurePipelines.cs @@ -15,7 +15,7 @@ public AzurePipelines(IEnvironment environment, ILog log) : base(environment, lo protected override string EnvironmentVariable => EnvironmentVariableName; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] + public override string[] GenerateSetParameterMessage(string name, string? value) => new[] { $"##vso[task.setvariable variable=GitVersion.{name}]{value}", $"##vso[task.setvariable variable=GitVersion.{name};isOutput=true]{value}" @@ -25,7 +25,7 @@ public override string[] GenerateSetParameterMessage(string name, string value) public override bool PreventFetch() => true; - public override string GenerateSetVersionMessage(VersionVariables variables) + public override string GenerateSetVersionMessage(GitVersionVariables variables) { // For AzurePipelines, we'll get the Build Number and insert GitVersion variables where // specified @@ -33,7 +33,7 @@ public override string GenerateSetVersionMessage(VersionVariables variables) if (buildNumberEnv.IsNullOrWhiteSpace()) return variables.FullSemVer; - var newBuildNumber = variables.Aggregate(buildNumberEnv, ReplaceVariables); + var newBuildNumber = variables.OrderBy(x => x.Key).Aggregate(buildNumberEnv, ReplaceVariables); // If no variable substitution has happened, use FullSemVer if (buildNumberEnv == newBuildNumber) @@ -48,10 +48,14 @@ public override string GenerateSetVersionMessage(VersionVariables variables) return $"##vso[build.updatebuildnumber]{newBuildNumber}"; } - private static string ReplaceVariables(string buildNumberEnv, KeyValuePair variable) + private static string ReplaceVariables(string buildNumberEnv, KeyValuePair variable) { var pattern = $@"\$\(GITVERSION[_\.]{variable.Key}\)"; var replacement = variable.Value; - return buildNumberEnv.RegexReplace(pattern, replacement, RegexOptions.IgnoreCase); + return replacement switch + { + null => buildNumberEnv, + _ => buildNumberEnv.RegexReplace(pattern, replacement, RegexOptions.IgnoreCase) + }; } } diff --git a/src/GitVersion.BuildAgents/Agents/BitBucketPipelines.cs b/src/GitVersion.BuildAgents/Agents/BitBucketPipelines.cs index 85ce93675c..3b1a23a778 100644 --- a/src/GitVersion.BuildAgents/Agents/BitBucketPipelines.cs +++ b/src/GitVersion.BuildAgents/Agents/BitBucketPipelines.cs @@ -15,13 +15,13 @@ internal class BitBucketPipelines : BuildAgentBase protected override string EnvironmentVariable => EnvironmentVariableName; - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string GenerateSetVersionMessage(GitVersionVariables variables) => variables.FullSemVer; public void WithPropertyFile(string propertiesFileName) => this.file = propertiesFileName; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] { $"GITVERSION_{name.ToUpperInvariant()}={value}" }; + public override string[] GenerateSetParameterMessage(string name, string? value) => new[] { $"GITVERSION_{name.ToUpperInvariant()}={value}" }; - public override void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) + public override void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) { if (this.file is null) return; diff --git a/src/GitVersion.BuildAgents/Agents/BuildKite.cs b/src/GitVersion.BuildAgents/Agents/BuildKite.cs index 280785d906..754fb5e49e 100644 --- a/src/GitVersion.BuildAgents/Agents/BuildKite.cs +++ b/src/GitVersion.BuildAgents/Agents/BuildKite.cs @@ -15,10 +15,10 @@ public BuildKite(IEnvironment environment, ILog log) : base(environment, log) public override bool CanApplyToCurrentContext() => "true".Equals(Environment.GetEnvironmentVariable(EnvironmentVariable), StringComparison.OrdinalIgnoreCase); - public override string GenerateSetVersionMessage(VersionVariables variables) => + public override string GenerateSetVersionMessage(GitVersionVariables variables) => string.Empty; // There is no equivalent function in BuildKite. - public override string[] GenerateSetParameterMessage(string name, string value) => + public override string[] GenerateSetParameterMessage(string name, string? value) => Array.Empty(); // There is no equivalent function in BuildKite. public override string? GetCurrentBranch(bool usingDynamicRepos) diff --git a/src/GitVersion.BuildAgents/Agents/CodeBuild.cs b/src/GitVersion.BuildAgents/Agents/CodeBuild.cs index fe5ee8941e..7650ac73e9 100644 --- a/src/GitVersion.BuildAgents/Agents/CodeBuild.cs +++ b/src/GitVersion.BuildAgents/Agents/CodeBuild.cs @@ -16,9 +16,9 @@ internal sealed class CodeBuild : BuildAgentBase protected override string EnvironmentVariable => WebHookEnvironmentVariableName; - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string GenerateSetVersionMessage(GitVersionVariables variables) => variables.FullSemVer; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] + public override string[] GenerateSetParameterMessage(string name, string? value) => new[] { $"GitVersion_{name}={value}" }; @@ -30,7 +30,7 @@ public override string[] GenerateSetParameterMessage(string name, string value) return currentBranch.IsNullOrEmpty() ? Environment.GetEnvironmentVariable(SourceVersionEnvironmentVariableName) : currentBranch; } - public override void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) + public override void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) { if (this.file is null) return; diff --git a/src/GitVersion.BuildAgents/Agents/ContinuaCi.cs b/src/GitVersion.BuildAgents/Agents/ContinuaCi.cs index 73446b1102..7eee6ad9e5 100644 --- a/src/GitVersion.BuildAgents/Agents/ContinuaCi.cs +++ b/src/GitVersion.BuildAgents/Agents/ContinuaCi.cs @@ -13,12 +13,12 @@ public ContinuaCi(IEnvironment environment, ILog log) : base(environment, log) protected override string EnvironmentVariable => EnvironmentVariableName; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] + public override string[] GenerateSetParameterMessage(string name, string? value) => new[] { $"@@continua[setVariable name='GitVersion_{name}' value='{value}' skipIfNotDefined='true']" }; - public override string GenerateSetVersionMessage(VersionVariables variables) => $"@@continua[setBuildVersion value='{variables.FullSemVer}']"; + public override string GenerateSetVersionMessage(GitVersionVariables variables) => $"@@continua[setBuildVersion value='{variables.FullSemVer}']"; public override bool PreventFetch() => false; } diff --git a/src/GitVersion.BuildAgents/Agents/Drone.cs b/src/GitVersion.BuildAgents/Agents/Drone.cs index 208e120d18..3078b0dd7d 100644 --- a/src/GitVersion.BuildAgents/Agents/Drone.cs +++ b/src/GitVersion.BuildAgents/Agents/Drone.cs @@ -14,9 +14,9 @@ public Drone(IEnvironment environment, ILog log) : base(environment, log) protected override string EnvironmentVariable => EnvironmentVariableName; public override bool CanApplyToCurrentContext() => "true".Equals(Environment.GetEnvironmentVariable(EnvironmentVariable), StringComparison.OrdinalIgnoreCase); - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string GenerateSetVersionMessage(GitVersionVariables variables) => variables.FullSemVer; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] + public override string[] GenerateSetParameterMessage(string name, string? value) => new[] { $"GitVersion_{name}={value}" }; diff --git a/src/GitVersion.BuildAgents/Agents/EnvRun.cs b/src/GitVersion.BuildAgents/Agents/EnvRun.cs index 79512443d1..77392d1fdc 100644 --- a/src/GitVersion.BuildAgents/Agents/EnvRun.cs +++ b/src/GitVersion.BuildAgents/Agents/EnvRun.cs @@ -29,9 +29,9 @@ public override bool CanApplyToCurrentContext() return false; } - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string GenerateSetVersionMessage(GitVersionVariables variables) => variables.FullSemVer; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] + public override string[] GenerateSetParameterMessage(string name, string? value) => new[] { $"@@envrun[set name='GitVersion_{name}' value='{value}']" }; diff --git a/src/GitVersion.BuildAgents/Agents/GitHubActions.cs b/src/GitVersion.BuildAgents/Agents/GitHubActions.cs index 9c5e0cb053..380d216862 100644 --- a/src/GitVersion.BuildAgents/Agents/GitHubActions.cs +++ b/src/GitVersion.BuildAgents/Agents/GitHubActions.cs @@ -17,13 +17,13 @@ public GitHubActions(IEnvironment environment, ILog log) : base(environment, log protected override string EnvironmentVariable => EnvironmentVariableName; - public override string GenerateSetVersionMessage(VersionVariables variables) => + public override string GenerateSetVersionMessage(GitVersionVariables variables) => string.Empty; // There is no equivalent function in GitHub Actions. - public override string[] GenerateSetParameterMessage(string name, string value) => + public override string[] GenerateSetParameterMessage(string name, string? value) => Array.Empty(); // There is no equivalent function in GitHub Actions. - public override void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) + public override void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) { base.WriteIntegration(writer, variables, updateBuildNumber); diff --git a/src/GitVersion.BuildAgents/Agents/GitLabCi.cs b/src/GitVersion.BuildAgents/Agents/GitLabCi.cs index 8715d81162..253a211699 100644 --- a/src/GitVersion.BuildAgents/Agents/GitLabCi.cs +++ b/src/GitVersion.BuildAgents/Agents/GitLabCi.cs @@ -14,9 +14,9 @@ internal class GitLabCi : BuildAgentBase protected override string EnvironmentVariable => EnvironmentVariableName; - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string GenerateSetVersionMessage(GitVersionVariables variables) => variables.FullSemVer; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] + public override string[] GenerateSetParameterMessage(string name, string? value) => new[] { $"GitVersion_{name}={value}" }; @@ -25,7 +25,7 @@ public override string[] GenerateSetParameterMessage(string name, string value) public override bool PreventFetch() => true; - public override void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) + public override void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) { if (this.file is null) return; diff --git a/src/GitVersion.BuildAgents/Agents/Jenkins.cs b/src/GitVersion.BuildAgents/Agents/Jenkins.cs index a60f2772ec..6e3a9ef9fb 100644 --- a/src/GitVersion.BuildAgents/Agents/Jenkins.cs +++ b/src/GitVersion.BuildAgents/Agents/Jenkins.cs @@ -14,9 +14,9 @@ internal class Jenkins : BuildAgentBase public void WithPropertyFile(string propertiesFileName) => this.file = propertiesFileName; - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string GenerateSetVersionMessage(GitVersionVariables variables) => variables.FullSemVer; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] + public override string[] GenerateSetParameterMessage(string name, string? value) => new[] { $"GitVersion_{name}={value}" }; @@ -36,7 +36,7 @@ public override string[] GenerateSetParameterMessage(string name, string value) /// public override bool ShouldCleanUpRemotes() => IsPipelineAsCode(); - public override void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) + public override void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) { if (this.file is null) return; diff --git a/src/GitVersion.BuildAgents/Agents/MyGet.cs b/src/GitVersion.BuildAgents/Agents/MyGet.cs index 66d60a1974..583e91b567 100644 --- a/src/GitVersion.BuildAgents/Agents/MyGet.cs +++ b/src/GitVersion.BuildAgents/Agents/MyGet.cs @@ -21,7 +21,7 @@ public override bool CanApplyToCurrentContext() && buildRunner.Equals("MyGet", StringComparison.InvariantCultureIgnoreCase); } - public override string[] GenerateSetParameterMessage(string name, string value) + public override string[] GenerateSetParameterMessage(string name, string? value) { var messages = new List { @@ -36,7 +36,7 @@ public override string[] GenerateSetParameterMessage(string name, string value) return messages.ToArray(); } - public override string? GenerateSetVersionMessage(VersionVariables variables) => null; + public override string? GenerateSetVersionMessage(GitVersionVariables variables) => null; public override bool PreventFetch() => false; } diff --git a/src/GitVersion.BuildAgents/Agents/SpaceAutomation.cs b/src/GitVersion.BuildAgents/Agents/SpaceAutomation.cs index 07ecbafe4a..706372de9e 100644 --- a/src/GitVersion.BuildAgents/Agents/SpaceAutomation.cs +++ b/src/GitVersion.BuildAgents/Agents/SpaceAutomation.cs @@ -15,7 +15,7 @@ public SpaceAutomation(IEnvironment environment, ILog log) : base(environment, l public override string? GetCurrentBranch(bool usingDynamicRepos) => Environment.GetEnvironmentVariable("JB_SPACE_GIT_BRANCH"); - public override string[] GenerateSetParameterMessage(string name, string value) => Array.Empty(); + public override string[] GenerateSetParameterMessage(string name, string? value) => Array.Empty(); - public override string GenerateSetVersionMessage(VersionVariables variables) => string.Empty; + public override string GenerateSetVersionMessage(GitVersionVariables variables) => string.Empty; } diff --git a/src/GitVersion.BuildAgents/Agents/TeamCity.cs b/src/GitVersion.BuildAgents/Agents/TeamCity.cs index 07e66bb9f4..d75072afb6 100644 --- a/src/GitVersion.BuildAgents/Agents/TeamCity.cs +++ b/src/GitVersion.BuildAgents/Agents/TeamCity.cs @@ -39,11 +39,11 @@ private void WriteBranchEnvVariableWarning() => this.Log.Warning(@"TeamCity does public override bool PreventFetch() => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("Git_Branch")); - public override string[] GenerateSetParameterMessage(string name, string value) => new[] + public override string[] GenerateSetParameterMessage(string name, string? value) => new[] { $"##teamcity[setParameter name='GitVersion.{name}' value='{ServiceMessageEscapeHelper.EscapeValue(value)}']", $"##teamcity[setParameter name='system.GitVersion.{name}' value='{ServiceMessageEscapeHelper.EscapeValue(value)}']" }; - public override string GenerateSetVersionMessage(VersionVariables variables) => $"##teamcity[buildNumber '{ServiceMessageEscapeHelper.EscapeValue(variables.FullSemVer)}']"; + public override string GenerateSetVersionMessage(GitVersionVariables variables) => $"##teamcity[buildNumber '{ServiceMessageEscapeHelper.EscapeValue(variables.FullSemVer)}']"; } diff --git a/src/GitVersion.BuildAgents/Agents/TravisCI.cs b/src/GitVersion.BuildAgents/Agents/TravisCI.cs index 6e9a996f17..43b50f30ea 100644 --- a/src/GitVersion.BuildAgents/Agents/TravisCI.cs +++ b/src/GitVersion.BuildAgents/Agents/TravisCI.cs @@ -14,9 +14,9 @@ public TravisCi(IEnvironment environment, ILog log) : base(environment, log) public override bool CanApplyToCurrentContext() => "true".Equals(Environment.GetEnvironmentVariable(EnvironmentVariable)) && "true".Equals(Environment.GetEnvironmentVariable("CI")); - public override string GenerateSetVersionMessage(VersionVariables variables) => variables.FullSemVer; + public override string GenerateSetVersionMessage(GitVersionVariables variables) => variables.FullSemVer; - public override string[] GenerateSetParameterMessage(string name, string value) => new[] + public override string[] GenerateSetParameterMessage(string name, string? value) => new[] { $"GitVersion_{name}={value}" }; diff --git a/src/GitVersion.BuildAgents/GitVersionBuildAgentsModule.cs b/src/GitVersion.BuildAgents/GitVersionBuildAgentsModule.cs index 171fed7bb4..17ba4b85b8 100644 --- a/src/GitVersion.BuildAgents/GitVersionBuildAgentsModule.cs +++ b/src/GitVersion.BuildAgents/GitVersionBuildAgentsModule.cs @@ -2,11 +2,11 @@ namespace GitVersion.Agents; -public class GitVersionBuildAgentsModule : GitVersionModule +public class GitVersionBuildAgentsModule : IGitVersionModule { - public override void RegisterTypes(IServiceCollection services) + public void RegisterTypes(IServiceCollection services) { - var buildAgents = FindAllDerivedTypes(Assembly.GetAssembly(GetType())); + var buildAgents = IGitVersionModule.FindAllDerivedTypes(Assembly.GetAssembly(GetType())); foreach (var buildAgent in buildAgents) { diff --git a/src/GitVersion.BuildAgents/PublicAPI.Unshipped.txt b/src/GitVersion.BuildAgents/PublicAPI.Unshipped.txt index 8b5a705cd9..271d1babf9 100644 --- a/src/GitVersion.BuildAgents/PublicAPI.Unshipped.txt +++ b/src/GitVersion.BuildAgents/PublicAPI.Unshipped.txt @@ -1,4 +1,4 @@ #nullable enable GitVersion.Agents.GitVersionBuildAgentsModule GitVersion.Agents.GitVersionBuildAgentsModule.GitVersionBuildAgentsModule() -> void -override GitVersion.Agents.GitVersionBuildAgentsModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void +GitVersion.Agents.GitVersionBuildAgentsModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void diff --git a/src/GitVersion.Core.Tests/Configuration/ConfigurationExtensionsTests.cs b/src/GitVersion.Core.Tests/Configuration/ConfigurationExtensionsTests.cs index 1aa8147b48..817753962f 100644 --- a/src/GitVersion.Core.Tests/Configuration/ConfigurationExtensionsTests.cs +++ b/src/GitVersion.Core.Tests/Configuration/ConfigurationExtensionsTests.cs @@ -9,7 +9,7 @@ public class ConfigurationExtensionsTests : TestBase [Test] public void GetReleaseBranchConfigReturnsAllReleaseBranches() { - var configuration = new GitVersionConfiguration() + var configuration = new GitVersionConfiguration { Branches = new Dictionary { diff --git a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs index 6d604d5b59..9e32c4ef1a 100644 --- a/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs +++ b/src/GitVersion.Core.Tests/Core/GitVersionExecutorTests.cs @@ -26,12 +26,7 @@ public void CacheKeySameAfterReNormalizing() const string targetUrl = "https://github.com/GitTools/GitVersion.git"; const string targetBranch = $"refs/head/{MainBranch}"; - var gitVersionOptions = new GitVersionOptions - { - RepositoryInfo = { TargetUrl = targetUrl, TargetBranch = targetBranch }, - WorkingDirectory = fixture.RepositoryPath, - Settings = { NoNormalize = false } - }; + var gitVersionOptions = new GitVersionOptions { RepositoryInfo = { TargetUrl = targetUrl, TargetBranch = targetBranch }, WorkingDirectory = fixture.RepositoryPath, Settings = { NoNormalize = false } }; var environment = new TestEnvironment(); environment.SetEnvironmentVariable(AzurePipelines.EnvironmentVariableName, "true"); @@ -55,11 +50,7 @@ public void GitPreparerShouldNotFailWhenTargetPathNotInitialized() { const string targetUrl = "https://github.com/GitTools/GitVersion.git"; - var gitVersionOptions = new GitVersionOptions - { - RepositoryInfo = { TargetUrl = targetUrl }, - WorkingDirectory = string.Empty - }; + var gitVersionOptions = new GitVersionOptions { RepositoryInfo = { TargetUrl = targetUrl }, WorkingDirectory = string.Empty }; Should.NotThrow(() => { this.sp = GetServiceProvider(gitVersionOptions); @@ -82,11 +73,7 @@ public void CacheKeyForWorktree() const string targetUrl = "https://github.com/GitTools/GitVersion.git"; - var gitVersionOptions = new GitVersionOptions - { - RepositoryInfo = { TargetUrl = targetUrl, TargetBranch = MainBranch }, - WorkingDirectory = worktreePath - }; + var gitVersionOptions = new GitVersionOptions { RepositoryInfo = { TargetUrl = targetUrl, TargetBranch = MainBranch }, WorkingDirectory = worktreePath }; this.sp = GetServiceProvider(gitVersionOptions); @@ -148,7 +135,11 @@ public void CacheFileExistsOnDisk() var versionVariables = gitVersionCalculator.CalculateVersionVariables(); versionVariables.AssemblySemVer.ShouldBe("0.0.1.0"); - this.fileSystem.WriteAllText(versionVariables.FileName, versionCacheFileContent); + var cacheKeyFactory = this.sp.GetRequiredService(); + var cacheKey = cacheKeyFactory.Create(null); + var cacheFileName = this.gitVersionCache.GetCacheFileName(cacheKey); + + this.fileSystem.WriteAllText(cacheFileName, versionCacheFileContent); versionVariables = gitVersionCalculator.CalculateVersionVariables(); versionVariables.AssemblySemVer.ShouldBe("4.10.3.0"); @@ -195,7 +186,10 @@ public void CacheFileExistsOnDiskWhenOverrideConfigIsSpecifiedVersionShouldBeDyn var versionVariables = gitVersionCalculator.CalculateVersionVariables(); versionVariables.AssemblySemVer.ShouldBe("0.0.1.0"); - this.fileSystem.WriteAllText(versionVariables.FileName, versionCacheFileContent); + var cacheKeyFactory = this.sp.GetRequiredService(); + var cacheKey = cacheKeyFactory.Create(null); + var cacheFileName = this.gitVersionCache.GetCacheFileName(cacheKey); + this.fileSystem.WriteAllText(cacheFileName, versionCacheFileContent); var cacheDirectory = this.gitVersionCache.GetCacheDirectory(); @@ -204,11 +198,7 @@ public void CacheFileExistsOnDiskWhenOverrideConfigIsSpecifiedVersionShouldBeDyn var configuration = GitFlowConfigurationBuilder.New.WithLabelPrefix("prefix").Build(); var overrideConfiguration = new ConfigurationHelper(configuration).Dictionary; - gitVersionOptions = new GitVersionOptions - { - WorkingDirectory = fixture.RepositoryPath, - ConfigurationInfo = { OverrideConfiguration = overrideConfiguration } - }; + gitVersionOptions = new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath, ConfigurationInfo = { OverrideConfiguration = overrideConfiguration } }; gitVersionCalculator = GetGitVersionCalculator(gitVersionOptions); versionVariables = gitVersionCalculator.CalculateVersionVariables(); @@ -283,9 +273,12 @@ public void ConfigChangeInvalidatesCache(string configFileName) var versionVariables = gitVersionCalculator.CalculateVersionVariables(); versionVariables.AssemblySemVer.ShouldBe("0.0.1.0"); - versionVariables.FileName.ShouldNotBeNullOrEmpty(); - this.fileSystem.WriteAllText(versionVariables.FileName, versionCacheFileContent); + var cacheKeyFactory = this.sp.GetRequiredService(); + var cacheKey = cacheKeyFactory.Create(null); + var cacheFileName = this.gitVersionCache.GetCacheFileName(cacheKey); + + this.fileSystem.WriteAllText(cacheFileName, versionCacheFileContent); versionVariables = gitVersionCalculator.CalculateVersionVariables(); versionVariables.AssemblySemVer.ShouldBe("4.10.3.0"); @@ -340,9 +333,12 @@ public void NoCacheBypassesCache() var versionVariables = gitVersionCalculator.CalculateVersionVariables(); versionVariables.AssemblySemVer.ShouldBe("0.0.1.0"); - versionVariables.FileName.ShouldNotBeNullOrEmpty(); - this.fileSystem.WriteAllText(versionVariables.FileName, versionCacheFileContent); + var cacheKeyFactory = this.sp.GetRequiredService(); + var cacheKey = cacheKeyFactory.Create(null); + var cacheFileName = this.gitVersionCache.GetCacheFileName(cacheKey); + + this.fileSystem.WriteAllText(cacheFileName, versionCacheFileContent); versionVariables = gitVersionCalculator.CalculateVersionVariables(); versionVariables.AssemblySemVer.ShouldBe("4.10.3.0"); @@ -394,11 +390,7 @@ public void GetProjectRootDirectoryWorkingDirectoryWithWorktree() const string targetUrl = "https://github.com/GitTools/GitVersion.git"; - var gitVersionOptions = new GitVersionOptions - { - RepositoryInfo = { TargetUrl = targetUrl }, - WorkingDirectory = worktreePath - }; + var gitVersionOptions = new GitVersionOptions { RepositoryInfo = { TargetUrl = targetUrl }, WorkingDirectory = worktreePath }; this.sp = GetServiceProvider(gitVersionOptions); var repositoryInfo = this.sp.GetRequiredService(); @@ -416,11 +408,7 @@ public void GetProjectRootDirectoryNoWorktree() using var fixture = new EmptyRepositoryFixture(); const string targetUrl = "https://github.com/GitTools/GitVersion.git"; - var gitVersionOptions = new GitVersionOptions - { - RepositoryInfo = { TargetUrl = targetUrl }, - WorkingDirectory = fixture.RepositoryPath - }; + var gitVersionOptions = new GitVersionOptions { RepositoryInfo = { TargetUrl = targetUrl }, WorkingDirectory = fixture.RepositoryPath }; this.sp = GetServiceProvider(gitVersionOptions); var repositoryInfo = this.sp.GetRequiredService(); @@ -434,10 +422,7 @@ public void GetDotGitDirectoryNoWorktree() { using var fixture = new EmptyRepositoryFixture(); - var gitVersionOptions = new GitVersionOptions - { - WorkingDirectory = fixture.RepositoryPath - }; + var gitVersionOptions = new GitVersionOptions { WorkingDirectory = fixture.RepositoryPath }; this.sp = GetServiceProvider(gitVersionOptions); var repositoryInfo = this.sp.GetRequiredService(); @@ -459,10 +444,7 @@ public void GetDotGitDirectoryWorktree() var repo = new Repository(fixture.RepositoryPath); repo.Worktrees.Add("worktree", worktreePath, false); - var gitVersionOptions = new GitVersionOptions - { - WorkingDirectory = worktreePath - }; + var gitVersionOptions = new GitVersionOptions { WorkingDirectory = worktreePath }; this.sp = GetServiceProvider(gitVersionOptions); var repositoryInfo = this.sp.GetRequiredService(); diff --git a/src/GitVersion.Core.Tests/DocumentationTests.cs b/src/GitVersion.Core.Tests/DocumentationTests.cs index 5803fdec63..3c98e439d5 100644 --- a/src/GitVersion.Core.Tests/DocumentationTests.cs +++ b/src/GitVersion.Core.Tests/DocumentationTests.cs @@ -41,7 +41,7 @@ public void ConfigurationDocumentationIsUpToDate() public void VariableDocumentationIsUpToDate() { var variableDocumentationFile = ReadDocumentationFile("input/docs/reference/variables.md"); - var variables = VersionVariables.AvailableVariables.ToList(); + var variables = GitVersionVariables.AvailableVariables.ToList(); variables.ShouldNotBeEmpty(); diff --git a/src/GitVersion.Core.Tests/Extensions/GitToolsTestingExtensions.cs b/src/GitVersion.Core.Tests/Extensions/GitToolsTestingExtensions.cs index d527f86398..c817b8af53 100644 --- a/src/GitVersion.Core.Tests/Extensions/GitToolsTestingExtensions.cs +++ b/src/GitVersion.Core.Tests/Extensions/GitToolsTestingExtensions.cs @@ -55,7 +55,7 @@ public static void DumpGraph(this IGitRepository repository, Action? wri public static void DumpGraph(this IRepository repository, Action? writer = null, int? maxCommits = null) => GitExtensions.DumpGraph(repository.ToGitRepository().Path, writer, maxCommits); - public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, IGitVersionConfiguration? configuration = null, + public static GitVersionVariables GetVersion(this RepositoryFixtureBase fixture, IGitVersionConfiguration? configuration = null, IRepository? repository = null, string? commitId = null, bool onlyTrackedBranches = true, string? targetBranch = null) { repository ??= fixture.Repository; @@ -104,11 +104,11 @@ public static VersionVariables GetVersion(this RepositoryFixtureBase fixture, IG public static void WriteVersionVariables(this RepositoryFixtureBase fixture, string versionFile) { - var versionInfo = fixture.GetVersion(); + var versionVariables = fixture.GetVersion(); using var stream = File.Open(versionFile, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite); using var writer = new StreamWriter(stream); - writer.Write(versionInfo.ToString()); + writer.Write(versionVariables.ToJsonString()); } public static void AssertFullSemver(this RepositoryFixtureBase fixture, string fullSemver, diff --git a/src/GitVersion.Core.Tests/Helpers/TestableGitVersionVariables.cs b/src/GitVersion.Core.Tests/Helpers/TestableGitVersionVariables.cs new file mode 100644 index 0000000000..5670ca86a3 --- /dev/null +++ b/src/GitVersion.Core.Tests/Helpers/TestableGitVersionVariables.cs @@ -0,0 +1,29 @@ +using GitVersion.OutputVariables; + +namespace GitVersion.Core.Tests.Helpers; + +internal record TestableGitVersionVariables() : GitVersionVariables("", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ""); diff --git a/src/GitVersion.Core.Tests/Helpers/TestableVersionVariables.cs b/src/GitVersion.Core.Tests/Helpers/TestableVersionVariables.cs deleted file mode 100644 index 7838f8d8e7..0000000000 --- a/src/GitVersion.Core.Tests/Helpers/TestableVersionVariables.cs +++ /dev/null @@ -1,21 +0,0 @@ -using GitVersion.OutputVariables; - -namespace GitVersion.Core.Tests.Helpers; - -internal class TestableVersionVariables : VersionVariables -{ - public TestableVersionVariables( - string major = "", string minor = "", string patch = "", string buildMetaData = "", string fullBuildMetaData = "", string branchName = "", - string escapedBranchName = "", string sha = "", string shortSha = "", string majorMinorPatch = "", - string semVer = "", string fullSemVer = "", - string assemblySemVer = "", string assemblySemFileVer = "", string preReleaseTag = "", - string preReleaseTagWithDash = "", string preReleaseLabel = "", string preReleaseLabelWithDash = "", string preReleaseNumber = "", - string weightedPreReleaseNumber = "", string informationalVersion = "", string commitDate = "", string versionSourceSha = "", string commitsSinceVersionSource = "", string uncommittedChanges = "") : base( - major, minor, patch, buildMetaData, fullBuildMetaData, branchName, escapedBranchName, - sha, shortSha, majorMinorPatch, semVer, fullSemVer, - assemblySemVer, assemblySemFileVer, preReleaseTag, weightedPreReleaseNumber, preReleaseTagWithDash, - preReleaseLabel, preReleaseLabelWithDash, preReleaseNumber, informationalVersion, commitDate, - versionSourceSha, commitsSinceVersionSource, uncommittedChanges) - { - } -} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/FailingTests.cs b/src/GitVersion.Core.Tests/IntegrationTests/FailingTests.cs new file mode 100644 index 0000000000..be4e1e55fa --- /dev/null +++ b/src/GitVersion.Core.Tests/IntegrationTests/FailingTests.cs @@ -0,0 +1,450 @@ +using GitVersion.Configuration; +using GitVersion.Core.Tests.Helpers; +using GitVersion.Extensions; +using GitVersion.VersionCalculation; +using LibGit2Sharp; + +namespace GitVersion.Core.Tests.IntegrationTests; + +[TestFixture] +public class FailingTests : TestBase +{ + [TestFixture(Description = "Failed test: Issue #1255, PR #1600")] + public class Issue1255Pr1600 + { + [Test(Description = "DevelopScenarios")] + public void ShouldProvideTheCorrectVersionEvenIfPreReleaseLabelExistsInTheGitTagDevelop() + { + using var fixture = new EmptyRepositoryFixture(); + fixture.Repository.MakeACommit(); + fixture.ApplyTag("1.0.0-oreo.1"); + fixture.BranchTo("develop"); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("1.1.0-alpha.1"); + } + + [Test(Description = "MainScenarios")] + public void ShouldProvideTheCorrectVersionEvenIfPreReleaseLabelExistsInTheGitTagMain() + { + var configuration = GitFlowConfigurationBuilder.New + .WithSemanticVersionFormat(SemanticVersionFormat.Loose) + .WithNextVersion("5.0") + .WithBranch(MainBranch, + branchBuilder => branchBuilder.WithLabel("beta") + .WithIncrement(IncrementStrategy.Patch) + .WithVersioningMode(VersioningMode.ContinuousDeployment)) + .Build(); + + using EmptyRepositoryFixture fixture = new(MainBranch); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("5.0.0-beta.0", configuration); // why not "5.0.0-beta.1"? + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("5.0.0-beta.1", configuration); + fixture.Repository.MakeATaggedCommit("v5.0.0-rc.1"); + fixture.AssertFullSemver("5.0.0-rc.1", configuration); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("5.0.1-beta.1", configuration); // test fails here, it generates "5.0.0-beta.1" which is not unique and lower than "5.0.0-rc.1" + } + } + + [TestFixture(Description = "Failed test: Issue #1844, PR #1845")] + public class Issue1844Pr1845 + { + [Test(Description = "VersionBumpingScenarios")] + public void AppliedPrereleaseTagAfterBranchTagCausesVersionBump() + { + var configuration = GitFlowConfigurationBuilder.New + .WithBranch(MainBranch, + branchBuilder => branchBuilder.WithLabel("pre") + .WithSourceBranches(ArraySegment.Empty) + .WithVersioningMode(VersioningMode.ContinuousDeployment)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.Repository.MakeACommit(); + fixture.Repository.MakeATaggedCommit("1.0.0-rc"); + fixture.Repository.MakeACommit(); + + fixture.AssertFullSemver("1.0.1-pre.1", configuration); + } + } + + [TestFixture(Description = "Failed test: Issue #2034, PR #2059")] + public class Issue2034Pr2059 + { + [Test(Description = "MainlineDevelopmentMode")] + public void MergingMainBranchToDevelopWithInheritIncrementShouldIncrementDevelopPatch() + { + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyVersioningScheme(AssemblyVersioningScheme.MajorMinorPatch) + .WithVersioningMode(VersioningMode.Mainline) + .WithBranch(MainBranch, branchBuilder => branchBuilder.WithIncrement(IncrementStrategy.Patch)) + .WithBranch("develop", branchBuilder => branchBuilder.WithIncrement(IncrementStrategy.Inherit)) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeACommit($"initial in {MainBranch}"); + fixture.AssertFullSemver("0.1.0", configuration); + fixture.MakeACommit($"{MainBranch} change"); + fixture.AssertFullSemver("0.1.1", configuration); + + fixture.BranchTo("develop"); + fixture.AssertFullSemver("0.1.2-alpha.0", configuration); + fixture.MakeACommit("develop change"); + fixture.AssertFullSemver("0.1.2-alpha.1", configuration); + + fixture.Checkout(MainBranch); + fixture.MakeACommit($"{MainBranch} hotfix"); + fixture.AssertFullSemver("0.1.2", configuration); + + fixture.Checkout("develop"); + fixture.MergeNoFF(MainBranch); + fixture.AssertFullSemver("0.1.3-alpha.1", configuration); + } + } + + [TestFixture(Description = "Failed test: Issue #2693, PR #2696")] + public class Issue2693Pr2696 + { + [Test(Description = "HotfixBranchScenarios")] + public void VersionNumberInHotfixBranchShouldBeConsideredWhenPreventIncrementOfMergedBranchVersion() + { + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyVersioningScheme(AssemblyVersioningScheme.MajorMinorPatchTag) + .WithAssemblyFileVersioningFormat("{MajorMinorPatch}.0") + .WithVersioningMode(VersioningMode.ContinuousDeployment) + .WithBranch("hotfix", + branchBuilder => branchBuilder + .WithPreventIncrementOfMergedBranchVersion(true) + .WithRegularExpression("r^(origin/)?hotfix[/-]") + ) + .Build(); + + const string HotfixBranch = "hotfix/1.1.1"; + const string ReleaseBranch = "release/1.1.0"; + + using var fixture = new BaseGitFlowRepositoryFixture("1.0.0"); + Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch(ReleaseBranch)); + fixture.MakeACommit(); + Commands.Checkout(fixture.Repository, MainBranch); + fixture.MergeNoFF(ReleaseBranch); + fixture.Repository.CreateBranch(HotfixBranch); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("1.1.1-ci.1", configuration); + } + } + + [TestFixture(Description = "Failed test: Issue #2821, PR #2830")] + public class Issue2821Pr2830 : TestBase + { + private readonly GitVersionConfiguration configuration = GitFlowConfigurationBuilder.New + .WithVersioningMode(VersioningMode.Mainline) + .WithBranch("feature", branchBuilder => branchBuilder.WithIncrement(IncrementStrategy.Minor)) + .WithBranch("pull-request", branchBuilder => branchBuilder.WithIncrement(IncrementStrategy.Minor)) + .WithBranch("support", + branchBuilder => branchBuilder + .WithVersioningMode(VersioningMode.ContinuousDeployment) + .WithLabel("beta") + .WithIncrement(IncrementStrategy.Patch)) + .Build(); + + [Test] + public void IncrementFeatureByMinor() + { + using var fixture = new EmptyRepositoryFixture(); + fixture.MakeATaggedCommit("0.1.0"); + + // feature workflow + fixture.BranchTo("feature/foo", "foo"); + fixture.MakeACommit(); + fixture.AssertFullSemver("0.2.0-foo.1", this.configuration); + fixture.MakeACommit(); + fixture.AssertFullSemver("0.2.0-foo.2", this.configuration); + fixture.Checkout(MainBranch); + fixture.MergeNoFF("feature/foo"); + fixture.AssertFullSemver("0.2.0", this.configuration); + } + + [Test] + public void CanCalculatePullRequestChanges() + { + using var fixture = new EmptyRepositoryFixture(); + fixture.Repository.MakeATaggedCommit("1.0.0"); + fixture.Repository.MakeATaggedCommit("1.1.0"); + fixture.Repository.MakeATaggedCommit("2.0.0"); + + // feature branch + Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("feature/foo")); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("2.1.0-foo.1", this.configuration); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("2.1.0-foo.2", this.configuration); + + // pull request + fixture.Repository.CreatePullRequestRef("feature/foo", MainBranch, normalise: true); + fixture.AssertFullSemver("2.1.0-PullRequest0002.3", this.configuration); + Commands.Checkout(fixture.Repository, MainBranch); + fixture.Repository.MergeNoFF("feature/foo", Generate.SignatureNow()); + fixture.AssertFullSemver("2.1.0", this.configuration); + fixture.Repository.MakeATaggedCommit("2.1.0"); // must tag before pull of any hotfix otherwise hotfix stays at this version + + // hotfix branch + var tag = fixture.Repository.Tags.Single(t => t.FriendlyName == "1.0.0"); + var supportBranch = fixture.Repository.CreateBranch("support/1.0.0", (LibGit2Sharp.Commit)tag.Target); + Commands.Checkout(fixture.Repository, supportBranch); + fixture.AssertFullSemver("1.0.0", this.configuration); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("1.0.1-beta.1", this.configuration); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("1.0.1-beta.2", this.configuration); + fixture.Repository.MakeATaggedCommit("1.0.1"); + fixture.Repository.MakeACommit(); + fixture.AssertFullSemver("1.0.2-beta.1", this.configuration); + + // pull request + fixture.Repository.CreatePullRequestRef("support/1.0.0", MainBranch, 3, normalise: true); + fixture.Repository.DumpGraph(); + fixture.AssertFullSemver("2.1.1-PullRequest0003.6", this.configuration); + Commands.Checkout(fixture.Repository, MainBranch); + fixture.Repository.MergeNoFF("support/1.0.0", Generate.SignatureNow()); + fixture.AssertFullSemver("2.1.1", this.configuration); + } + } + + [TestFixture(Description = "Failed test: Issue #2786, PR #2787")] + public class Issue2786Pr2787 + { + [Test(Description = "MainlineDevelopmentMode")] + public void HotfixBranchesWithTaggedCommitsOnMain() + { + using var fixture = new EmptyRepositoryFixture(); + var configuration = GitFlowConfigurationBuilder.New + .WithVersioningMode(VersioningMode.Mainline) + .WithIncrement(IncrementStrategy.Minor) + .WithBranch(ConfigurationConstants.MainBranchKey, + branchBuilder => branchBuilder + .WithRegularExpression(ConfigurationConstants.MainBranchRegex) + .WithSourceBranches(ConfigurationConstants.DevelopBranchKey, ConfigurationConstants.ReleaseBranchKey) + .WithLabel("") + .WithPreventIncrementOfMergedBranchVersion(true) + .WithIncrement(IncrementStrategy.Minor) + .WithIsMainline(true) + .WithPreReleaseWeight(55000) + ) + .WithBranch(ConfigurationConstants.HotfixBranchKey, branchBuilder => branchBuilder.WithLabel("")) + .Build(); + + fixture.Repository.MakeACommit("1"); + fixture.MakeATaggedCommit("1.0.0"); + + fixture.MakeACommit(); // 1.1.0 + fixture.AssertFullSemver("1.1.0", configuration); + fixture.ApplyTag("1.1.0"); + fixture.AssertFullSemver("1.1.0", configuration); + + fixture.BranchTo("hotfix/may"); + fixture.AssertFullSemver("1.1.1", configuration); + + // Move main on + fixture.Checkout(MainBranch); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.2.0", configuration); + + // Continue on hotfix + fixture.Checkout("hotfix/may"); + fixture.MakeACommit(); // 1.2.1 + fixture.AssertFullSemver("1.1.1", configuration); + } + + [Test(Description = "MainlineDevelopmentMode")] + public void HotfixBranchesWithTaggedCommitsOnHotfix() + { + using var fixture = new EmptyRepositoryFixture(); + var configuration = GitFlowConfigurationBuilder.New + .WithVersioningMode(VersioningMode.Mainline) + .WithIncrement(IncrementStrategy.Minor) + .WithBranch(ConfigurationConstants.MainBranchKey, + branchBuilder => branchBuilder + .WithRegularExpression(ConfigurationConstants.MainBranchRegex) + .WithSourceBranches(ConfigurationConstants.DevelopBranchKey, ConfigurationConstants.ReleaseBranchKey) + .WithLabel("") + .WithPreventIncrementOfMergedBranchVersion(true) + .WithIncrement(IncrementStrategy.Minor) + .WithIsMainline(true) + .WithPreReleaseWeight(55000) + ) + .WithBranch(ConfigurationConstants.HotfixBranchKey, branchBuilder => branchBuilder.WithLabel("")) + .Build(); + + fixture.Repository.MakeACommit("1"); + fixture.MakeATaggedCommit("1.0.0"); + + fixture.MakeACommit(); // 1.1.0 + fixture.AssertFullSemver("1.1.0", configuration); + fixture.ApplyTag("1.1.0"); + fixture.AssertFullSemver("1.1.0", configuration); + fixture.MakeACommit(); // 1.2.0 + fixture.AssertFullSemver("1.2.0", configuration); + + fixture.BranchTo("hotfix/may"); + fixture.AssertFullSemver("1.2.1", configuration); + + // Move main on + fixture.Checkout(MainBranch); + fixture.MakeACommit(); + fixture.AssertFullSemver("1.3.0", configuration); + + // Continue on hotfix + fixture.Checkout("hotfix/may"); + fixture.MakeACommit(); // 1.2.1 + fixture.MakeATaggedCommit("1.2.2"); + fixture.MakeACommit(); // 1.2.3 + fixture.AssertFullSemver("1.2.3", configuration); + } + } + + [TestFixture(Description = "Failed test: Issue #2454, PR #2847")] + public class Issue2454Pr2847 + { + [Test(Description = "HotfixBranchScenarios")] + public void HotfixMergeIncrementsVersionWithModeContinuousDeployment() + { + var configuration = GitFlowConfigurationBuilder.New + .WithAssemblyVersioningScheme(AssemblyVersioningScheme.MajorMinorPatchTag) + .WithVersioningMode(VersioningMode.ContinuousDeployment) + .Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // initialize gitflow + + const string devBranch = "develop"; + + fixture.Repository.MakeACommit("setup repo"); + fixture.Repository.CreateBranch(devBranch); + Commands.Checkout(fixture.Repository, devBranch); + + // make some changes on dev + + fixture.Repository.MakeACommit("add stuff"); + fixture.Repository.MakeACommit("add more stuff"); + + // start a release + + const string releaseBranch = "release/1.0"; + + fixture.Repository.CreateBranch(releaseBranch); + Commands.Checkout(fixture.Repository, releaseBranch); + fixture.Repository.MakeACommit("fix some minor thing"); + + fixture.AssertFullSemver("1.0.0-beta.1", configuration); + + Commands.Checkout(fixture.Repository, MainBranch); + fixture.Repository.MergeNoFF(releaseBranch, Generate.SignatureNow()); + + fixture.AssertFullSemver("1.0.0-ci.0", configuration); + fixture.ApplyTag("1.0"); + fixture.AssertFullSemver("1.0.0", configuration); + + // start first hotfix + + const string hotfixBranch = "hotfix/something-important"; + + fixture.Repository.CreateBranch(hotfixBranch); + fixture.Repository.MakeACommit("fix the important issue"); + // fixture.AssertFullSemver("1.0.1-beta.1"); // FAILS, not sure if hotfixes should have beta tag + fixture.AssertFullSemver("1.0.1-ci.1", configuration); // PASSES + fixture.Repository.MakeACommit("fix something else"); + // fixture.AssertFullSemver("1.0.1-beta.2"); // FAILS, not sure if hotfixes should have beta tag + fixture.AssertFullSemver("1.0.1-ci.2", configuration); // PASSES + + Commands.Checkout(fixture.Repository, MainBranch); + fixture.Repository.MergeNoFF(hotfixBranch, Generate.SignatureNow()); + + fixture.AssertFullSemver("1.0.1-ci.2", configuration); + + // start second hotfix + + const string hotfix2Branch = "hotfix/another-important-thing"; + + fixture.Repository.CreateBranch(hotfix2Branch); + fixture.Repository.MakeACommit("fix the new issue"); + // fixture.AssertFullSemver("1.0.2-beta.1"); // FAILS, not sure if hotfixes should have beta tag + fixture.AssertFullSemver("1.0.2-ci.1", configuration); // FAILS, version is 1.0.1-ci.3 + + Commands.Checkout(fixture.Repository, MainBranch); + fixture.Repository.MergeNoFF(hotfix2Branch, Generate.SignatureNow()); + + fixture.AssertFullSemver("1.0.2-ci.1", configuration); // FAILS, version is 1.0.1-ci.3 + } + + [Test] + public void HotfixMergeIncrementsVersionWithDefaultConfig() + { + var configuration = GitFlowConfigurationBuilder.New.Build(); + + using var fixture = new EmptyRepositoryFixture(); + + // initialize gitflow + + const string devBranch = "develop"; + + fixture.Repository.MakeACommit("setup repo"); + fixture.Repository.CreateBranch(devBranch); + Commands.Checkout(fixture.Repository, devBranch); + + // make some changes on dev + + fixture.Repository.MakeACommit("add stuff"); + fixture.Repository.MakeACommit("add more stuff"); + + // start a release + + const string releaseBranch = "release/1.0"; + + fixture.Repository.CreateBranch(releaseBranch); + Commands.Checkout(fixture.Repository, releaseBranch); + fixture.Repository.MakeACommit("fix some minor thing"); + + fixture.AssertFullSemver("1.0.0-beta.1+1", configuration); + + Commands.Checkout(fixture.Repository, MainBranch); + fixture.Repository.MergeNoFF(releaseBranch, Generate.SignatureNow()); + + fixture.AssertFullSemver("1.0.0+0", configuration); + fixture.ApplyTag("1.0"); + fixture.AssertFullSemver("1.0.0", configuration); + + // start first hotfix + + const string hotfixBranch = "hotfix/something-important"; + + fixture.Repository.CreateBranch(hotfixBranch); + fixture.Repository.MakeACommit("fix the important issue"); + // fixture.AssertFullSemver("1.0.1-beta.1+1", config); // FAILS, not sure if hotfixes should have beta tag + fixture.AssertFullSemver("1.0.1+1", configuration); + fixture.Repository.MakeACommit("fix something else"); + // fixture.AssertFullSemver("1.0.1-beta.2+2", config); // FAILS, not sure if hotfixes should have beta tag + fixture.AssertFullSemver("1.0.1+2", configuration); + + Commands.Checkout(fixture.Repository, MainBranch); + fixture.Repository.MergeNoFF(hotfixBranch, Generate.SignatureNow()); + + fixture.AssertFullSemver("1.0.1+2", configuration); + + // start second hotfix + + const string hotfix2Branch = "hotfix/another-important-thing"; + + fixture.Repository.CreateBranch(hotfix2Branch); + fixture.Repository.MakeACommit("fix the new issue"); + // fixture.AssertFullSemver("1.0.2-beta.1+1", config); // FAILS, not sure if hotfixes should have beta tag + fixture.AssertFullSemver("1.0.2+1", configuration); // FAILS, version is 1.0.1+3 + + Commands.Checkout(fixture.Repository, MainBranch); + fixture.Repository.MergeNoFF(hotfix2Branch, Generate.SignatureNow()); + + fixture.AssertFullSemver("1.0.2+1", configuration); // FAILS, version is 1.0.1+3 + } + } +} diff --git a/src/GitVersion.Core.Tests/IntegrationTests/IgnoreBeforeScenarios.cs b/src/GitVersion.Core.Tests/IntegrationTests/IgnoreBeforeScenarios.cs index a6cb4200a9..e83637a5db 100644 --- a/src/GitVersion.Core.Tests/IntegrationTests/IgnoreBeforeScenarios.cs +++ b/src/GitVersion.Core.Tests/IntegrationTests/IgnoreBeforeScenarios.cs @@ -17,7 +17,7 @@ public void ShouldFallbackToBaseVersionWhenAllCommitsAreIgnored(string? nextVers fixture.MakeACommit(); var configuration = GitFlowConfigurationBuilder.New.WithNextVersion(nextVersion) - .WithIgnoreConfiguration(new() { Before = dateTimeNow.AddDays(1) }).Build(); + .WithIgnoreConfiguration(new IgnoreConfiguration() { Before = dateTimeNow.AddDays(1) }).Build(); fixture.AssertFullSemver(expectedFullSemVer, configuration); } @@ -33,7 +33,7 @@ public void ShouldNotFallbackToBaseVersionWhenAllCommitsAreNotIgnored(string? ne fixture.MakeACommit(); var configuration = GitFlowConfigurationBuilder.New.WithNextVersion(nextVersion) - .WithIgnoreConfiguration(new() { Before = dateTimeNow.AddDays(-1) }).Build(); + .WithIgnoreConfiguration(new IgnoreConfiguration() { Before = dateTimeNow.AddDays(-1) }).Build(); fixture.AssertFullSemver(expectedFullSemVer, configuration); } diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/JsonVersionBuilderTests.Json.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/JsonVersionBuilderTests.Json.approved.txt index ca5000682c..24061d9bfe 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/JsonVersionBuilderTests.Json.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/JsonVersionBuilderTests.Json.approved.txt @@ -1,27 +1,27 @@ { + "AssemblySemFileVer": "1.2.0.0", + "AssemblySemVer": "1.2.0.0", + "BranchName": "feature1", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "feature1", + "FullBuildMetaData": "5.Branch.feature1.Sha.commitSha", + "FullSemVer": "1.2.0-unstable.4+5", + "InformationalVersion": "1.2.0-unstable.4+5.Branch.feature1.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.0", "Minor": 2, "Patch": 0, - "PreReleaseTag": "unstable.4", - "PreReleaseTagWithDash": "-unstable.4", "PreReleaseLabel": "unstable", "PreReleaseLabelWithDash": "-unstable", "PreReleaseNumber": 4, - "WeightedPreReleaseNumber": 4, - "BuildMetaData": 5, - "FullBuildMetaData": "5.Branch.feature1.Sha.commitSha", - "MajorMinorPatch": "1.2.0", + "PreReleaseTag": "unstable.4", + "PreReleaseTagWithDash": "-unstable.4", "SemVer": "1.2.0-unstable.4", - "AssemblySemVer": "1.2.0.0", - "AssemblySemFileVer": "1.2.0.0", - "FullSemVer": "1.2.0-unstable.4+5", - "InformationalVersion": "1.2.0-unstable.4+5.Branch.feature1.Sha.commitSha", - "BranchName": "feature1", - "EscapedBranchName": "feature1", "Sha": "commitSha", "ShortSha": "commitShortSha", + "UncommittedChanges": 0, "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitDate": "2014-03-06", - "UncommittedChanges": 0 + "WeightedPreReleaseNumber": 4 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranch.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranch.approved.txt index 1d8d3544ae..2656e2afe4 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranch.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranch.approved.txt @@ -1,27 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "feature/123", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "feature-123", + "FullBuildMetaData": "5.Branch.feature-123.Sha.commitSha", + "FullSemVer": "1.2.3+5", + "InformationalVersion": "1.2.3+5.Branch.feature-123.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "", - "PreReleaseTagWithDash": "", "PreReleaseLabel": "", "PreReleaseLabelWithDash": "", "PreReleaseNumber": null, - "WeightedPreReleaseNumber": 0, - "BuildMetaData": 5, - "FullBuildMetaData": "5.Branch.feature-123.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "", + "PreReleaseTagWithDash": "", "SemVer": "1.2.3", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3+5", - "InformationalVersion": "1.2.3+5.Branch.feature-123.Sha.commitSha", - "BranchName": "feature/123", - "EscapedBranchName": "feature-123", "Sha": "commitSha", "ShortSha": "commitShortSha", + "UncommittedChanges": 0, "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitDate": "2014-03-06", - "UncommittedChanges": 0 + "WeightedPreReleaseNumber": 0 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat.approved.txt index 4dc5bd11b4..55166aebe6 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomAssemblyInfoFormat.approved.txt @@ -1,27 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "feature/123", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "feature-123", + "FullBuildMetaData": "5.Branch.feature-123.Sha.commitSha", + "FullSemVer": "1.2.3+5", + "InformationalVersion": "1.2.3+5.Branch.feature-123.Sha.commitShortSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "", - "PreReleaseTagWithDash": "", "PreReleaseLabel": "", "PreReleaseLabelWithDash": "", "PreReleaseNumber": null, - "WeightedPreReleaseNumber": 0, - "BuildMetaData": 5, - "FullBuildMetaData": "5.Branch.feature-123.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "", + "PreReleaseTagWithDash": "", "SemVer": "1.2.3", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3+5", - "InformationalVersion": "1.2.3+5.Branch.feature-123.Sha.commitShortSha", - "BranchName": "feature/123", - "EscapedBranchName": "feature-123", "Sha": "commitSha", "ShortSha": "commitShortSha", + "UncommittedChanges": 0, "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitDate": "2014-03-06", - "UncommittedChanges": 0 + "WeightedPreReleaseNumber": 0 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreRelease.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreRelease.approved.txt index f7a3df5466..4cc8738920 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreRelease.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreRelease.approved.txt @@ -1,27 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "develop", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "develop", + "FullBuildMetaData": "5.Branch.develop.Sha.commitSha", + "FullSemVer": "1.2.3-unstable.4+5", + "InformationalVersion": "1.2.3-unstable.4+5.Branch.develop.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "unstable.4", - "PreReleaseTagWithDash": "-unstable.4", "PreReleaseLabel": "unstable", "PreReleaseLabelWithDash": "-unstable", "PreReleaseNumber": 4, - "WeightedPreReleaseNumber": 4, - "BuildMetaData": 5, - "FullBuildMetaData": "5.Branch.develop.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "unstable.4", + "PreReleaseTagWithDash": "-unstable.4", "SemVer": "1.2.3-unstable.4", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3-unstable.4+5", - "InformationalVersion": "1.2.3-unstable.4+5.Branch.develop.Sha.commitSha", - "BranchName": "develop", - "EscapedBranchName": "develop", "Sha": "commitSha", "ShortSha": "commitShortSha", + "UncommittedChanges": 0, "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitDate": "2014-03-06", - "UncommittedChanges": 0 + "WeightedPreReleaseNumber": 4 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding.approved.txt deleted file mode 100644 index d9c308b49e..0000000000 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForPreReleaseWithPadding.approved.txt +++ /dev/null @@ -1,27 +0,0 @@ -{ - "Major": 1, - "Minor": 2, - "Patch": 3, - "PreReleaseTag": "unstable.4", - "PreReleaseTagWithDash": "-unstable.4", - "PreReleaseLabel": "unstable", - "PreReleaseLabelWithDash": "-unstable", - "PreReleaseNumber": 4, - "WeightedPreReleaseNumber": 4, - "BuildMetaData": 5, - "FullBuildMetaData": "5.Branch.develop.Sha.commitSha", - "MajorMinorPatch": "1.2.3", - "SemVer": "1.2.3-unstable.4", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3-unstable.4+5", - "InformationalVersion": "1.2.3-unstable.4+5.Branch.develop.Sha.commitSha", - "BranchName": "develop", - "EscapedBranchName": "develop", - "Sha": "commitSha", - "ShortSha": "commitShortSha", - "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "UncommittedChanges": 0, - "CommitDate": "2014-03-06" -} \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForStable.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForStable.approved.txt index 76146f8318..0b9c98e18a 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForStable.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeliveryModeForStable.approved.txt @@ -1,27 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "develop", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "develop", + "FullBuildMetaData": "5.Branch.develop.Sha.commitSha", + "FullSemVer": "1.2.3+5", + "InformationalVersion": "1.2.3+5.Branch.develop.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "", - "PreReleaseTagWithDash": "", "PreReleaseLabel": "", "PreReleaseLabelWithDash": "", "PreReleaseNumber": null, - "WeightedPreReleaseNumber": 0, - "BuildMetaData": 5, - "FullBuildMetaData": "5.Branch.develop.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "", + "PreReleaseTagWithDash": "", "SemVer": "1.2.3", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3+5", - "InformationalVersion": "1.2.3+5.Branch.develop.Sha.commitSha", - "BranchName": "develop", - "EscapedBranchName": "develop", "Sha": "commitSha", "ShortSha": "commitShortSha", + "UncommittedChanges": 0, "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitDate": "2014-03-06", - "UncommittedChanges": 0 + "WeightedPreReleaseNumber": 0 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForPreRelease.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForPreRelease.approved.txt index 0a2884fb75..34ec2c613b 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForPreRelease.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForPreRelease.approved.txt @@ -1,27 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "develop", + "BuildMetaData": null, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "develop", + "FullBuildMetaData": "Branch.develop.Sha.commitSha", + "FullSemVer": "1.2.3-unstable.8", + "InformationalVersion": "1.2.3-unstable.8+Branch.develop.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "unstable.8", - "PreReleaseTagWithDash": "-unstable.8", "PreReleaseLabel": "unstable", "PreReleaseLabelWithDash": "-unstable", "PreReleaseNumber": 8, - "WeightedPreReleaseNumber": 8, - "BuildMetaData": null, - "FullBuildMetaData": "Branch.develop.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "unstable.8", + "PreReleaseTagWithDash": "-unstable.8", "SemVer": "1.2.3-unstable.8", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3-unstable.8", - "InformationalVersion": "1.2.3-unstable.8+Branch.develop.Sha.commitSha", - "BranchName": "develop", - "EscapedBranchName": "develop", "Sha": "commitSha", "ShortSha": "commitShortSha", + "UncommittedChanges": 0, "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitDate": "2014-03-06", - "UncommittedChanges": 0 + "WeightedPreReleaseNumber": 8 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStable.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStable.approved.txt index 3b26568285..de207b299c 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStable.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStable.approved.txt @@ -1,27 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "develop", + "BuildMetaData": null, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "develop", + "FullBuildMetaData": "Branch.develop.Sha.commitSha", + "FullSemVer": "1.2.3-ci.5", + "InformationalVersion": "1.2.3-ci.5+Branch.develop.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "ci.5", - "PreReleaseTagWithDash": "-ci.5", "PreReleaseLabel": "ci", "PreReleaseLabelWithDash": "-ci", "PreReleaseNumber": 5, - "WeightedPreReleaseNumber": 5, - "BuildMetaData": null, - "FullBuildMetaData": "Branch.develop.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "ci.5", + "PreReleaseTagWithDash": "-ci.5", "SemVer": "1.2.3-ci.5", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3-ci.5", - "InformationalVersion": "1.2.3-ci.5+Branch.develop.Sha.commitSha", - "BranchName": "develop", - "EscapedBranchName": "develop", "Sha": "commitSha", "ShortSha": "commitShortSha", + "UncommittedChanges": 0, "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitDate": "2014-03-06", - "UncommittedChanges": 0 + "WeightedPreReleaseNumber": 5 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged.approved.txt b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged.approved.txt index e1dccf214f..330accf021 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged.approved.txt +++ b/src/GitVersion.Core.Tests/VersionCalculation/Approved/VariableProviderTests.ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommitIsTagged.approved.txt @@ -1,27 +1,27 @@ { + "AssemblySemFileVer": "1.2.3.0", + "AssemblySemVer": "1.2.3.0", + "BranchName": "", + "BuildMetaData": 5, + "CommitDate": "2014-03-06", + "CommitsSinceVersionSource": 5, + "EscapedBranchName": "", + "FullBuildMetaData": "5.Sha.commitSha", + "FullSemVer": "1.2.3+5", + "InformationalVersion": "1.2.3+5.Sha.commitSha", "Major": 1, + "MajorMinorPatch": "1.2.3", "Minor": 2, "Patch": 3, - "PreReleaseTag": "", - "PreReleaseTagWithDash": "", "PreReleaseLabel": "", "PreReleaseLabelWithDash": "", "PreReleaseNumber": null, - "WeightedPreReleaseNumber": 0, - "BuildMetaData": 5, - "FullBuildMetaData": "5.Sha.commitSha", - "MajorMinorPatch": "1.2.3", + "PreReleaseTag": "", + "PreReleaseTagWithDash": "", "SemVer": "1.2.3", - "AssemblySemVer": "1.2.3.0", - "AssemblySemFileVer": "1.2.3.0", - "FullSemVer": "1.2.3+5", - "InformationalVersion": "1.2.3+5.Sha.commitSha", - "BranchName": "", - "EscapedBranchName": "", "Sha": "commitSha", "ShortSha": "commitShortSha", + "UncommittedChanges": 0, "VersionSourceSha": "versionSourceSha", - "CommitsSinceVersionSource": 5, - "CommitDate": "2014-03-06", - "UncommittedChanges": 0 + "WeightedPreReleaseNumber": 0 } \ No newline at end of file diff --git a/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs index 2f5a36e73f..de0f59334a 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/JsonVersionBuilderTests.cs @@ -1,4 +1,5 @@ using GitVersion.Core.Tests.Helpers; +using GitVersion.OutputVariables; using GitVersion.VersionCalculation; using Microsoft.Extensions.DependencyInjection; @@ -28,7 +29,6 @@ public void Json() var variableProvider = serviceProvider.GetRequiredService(); var variables = variableProvider.GetVariablesFor(semanticVersion, configuration, null); - var json = variables.ToString(); - json.ShouldMatchApproved(c => c.SubFolder("Approved")); + variables.ToJsonString().ShouldMatchApproved(c => c.SubFolder("Approved")); } } diff --git a/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs b/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs index 4b1a156202..2306d62f38 100644 --- a/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs +++ b/src/GitVersion.Core.Tests/VersionCalculation/VariableProviderTests.cs @@ -1,5 +1,6 @@ using GitVersion.Core.Tests.Helpers; using GitVersion.Logging; +using GitVersion.OutputVariables; using GitVersion.VersionCalculation; using Microsoft.Extensions.DependencyInjection; @@ -49,7 +50,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForPreRelease() var vars = this.variableProvider.GetVariablesFor(semVer, configuration, null); - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + vars.ToJsonString().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] @@ -74,7 +75,7 @@ public void ProvidesVariablesInContinuousDeploymentModeForPreRelease() var vars = this.variableProvider.GetVariablesFor(semVer, configuration, null); - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + vars.ToJsonString().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] @@ -98,7 +99,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForStable() var vars = this.variableProvider.GetVariablesFor(semVer, configuration, null); - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + vars.ToJsonString().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] @@ -122,7 +123,7 @@ public void ProvidesVariablesInContinuousDeploymentModeForStable() var vars = this.variableProvider.GetVariablesFor(semVer, configuration, null); - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + vars.ToJsonString().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] @@ -148,7 +149,7 @@ public void ProvidesVariablesInContinuousDeploymentModeForStableWhenCurrentCommi var variables = this.variableProvider.GetVariablesFor(semVer, configuration, SemanticVersion.Empty); - variables.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + variables.ToJsonString().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] @@ -220,7 +221,7 @@ public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranch() var vars = this.variableProvider.GetVariablesFor(semVer, configuration, null); - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + vars.ToJsonString().ShouldMatchApproved(c => c.SubFolder("Approved")); } [Test] @@ -247,6 +248,6 @@ public void ProvidesVariablesInContinuousDeliveryModeForFeatureBranchWithCustomA var vars = this.variableProvider.GetVariablesFor(semVer, configuration, null); - vars.ToString().ShouldMatchApproved(c => c.SubFolder("Approved")); + vars.ToJsonString().ShouldMatchApproved(c => c.SubFolder("Approved")); } } diff --git a/src/GitVersion.Core/Agents/BuildAgentBase.cs b/src/GitVersion.Core/Agents/BuildAgentBase.cs index 829ca73e92..e3b572a942 100644 --- a/src/GitVersion.Core/Agents/BuildAgentBase.cs +++ b/src/GitVersion.Core/Agents/BuildAgentBase.cs @@ -18,8 +18,8 @@ protected BuildAgentBase(IEnvironment environment, ILog log) protected abstract string EnvironmentVariable { get; } public virtual bool IsDefault => false; - public abstract string? GenerateSetVersionMessage(VersionVariables variables); - public abstract string[] GenerateSetParameterMessage(string name, string value); + public abstract string? GenerateSetVersionMessage(GitVersionVariables variables); + public abstract string[] GenerateSetParameterMessage(string name, string? value); public virtual bool CanApplyToCurrentContext() => !Environment.GetEnvironmentVariable(EnvironmentVariable).IsNullOrEmpty(); @@ -28,7 +28,7 @@ protected BuildAgentBase(IEnvironment environment, ILog log) public virtual bool PreventFetch() => true; public virtual bool ShouldCleanUpRemotes() => false; - public virtual void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true) + public virtual void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true) { if (updateBuildNumber) { @@ -42,7 +42,7 @@ public virtual void WriteIntegration(Action writer, VersionVariables va } } - protected IEnumerable GenerateBuildLogOutput(VersionVariables variables) + protected IEnumerable GenerateBuildLogOutput(GitVersionVariables variables) { var output = new List(); diff --git a/src/GitVersion.Core/Agents/BuildAgentResolver.cs b/src/GitVersion.Core/Agents/BuildAgentResolver.cs index b0f53e56a3..5bab1e8175 100644 --- a/src/GitVersion.Core/Agents/BuildAgentResolver.cs +++ b/src/GitVersion.Core/Agents/BuildAgentResolver.cs @@ -3,7 +3,7 @@ namespace GitVersion.Agents; -public class BuildAgentResolver : IBuildAgentResolver +internal class BuildAgentResolver : IBuildAgentResolver { private readonly IEnumerable buildAgents; private readonly ILog log; diff --git a/src/GitVersion.Core/Agents/IBuildAgent.cs b/src/GitVersion.Core/Agents/IBuildAgent.cs index 32038e2764..8b575934eb 100644 --- a/src/GitVersion.Core/Agents/IBuildAgent.cs +++ b/src/GitVersion.Core/Agents/IBuildAgent.cs @@ -7,10 +7,11 @@ public interface IBuildAgent bool IsDefault { get; } bool CanApplyToCurrentContext(); - void WriteIntegration(Action writer, VersionVariables variables, bool updateBuildNumber = true); string? GetCurrentBranch(bool usingDynamicRepos); bool PreventFetch(); bool ShouldCleanUpRemotes(); + + void WriteIntegration(Action writer, GitVersionVariables variables, bool updateBuildNumber = true); } public interface ICurrentBuildAgent : IBuildAgent { } diff --git a/src/GitVersion.Core/Agents/IBuildAgentResolver.cs b/src/GitVersion.Core/Agents/IBuildAgentResolver.cs index 311ecbd737..650b72033f 100644 --- a/src/GitVersion.Core/Agents/IBuildAgentResolver.cs +++ b/src/GitVersion.Core/Agents/IBuildAgentResolver.cs @@ -1,6 +1,6 @@ namespace GitVersion.Agents; -public interface IBuildAgentResolver +internal interface IBuildAgentResolver { ICurrentBuildAgent Resolve(); } diff --git a/src/GitVersion.Core/Agents/LocalBuild.cs b/src/GitVersion.Core/Agents/LocalBuild.cs index 0544243810..3dfc84c0c3 100644 --- a/src/GitVersion.Core/Agents/LocalBuild.cs +++ b/src/GitVersion.Core/Agents/LocalBuild.cs @@ -13,6 +13,6 @@ public LocalBuild(IEnvironment environment, ILog log) : base(environment, log) protected override string EnvironmentVariable => string.Empty; public override bool CanApplyToCurrentContext() => true; - public override string? GenerateSetVersionMessage(VersionVariables variables) => null; - public override string[] GenerateSetParameterMessage(string name, string value) => Array.Empty(); + public override string? GenerateSetVersionMessage(GitVersionVariables variables) => null; + public override string[] GenerateSetParameterMessage(string name, string? value) => Array.Empty(); } diff --git a/src/GitVersion.Core/Configuration/Abstractions/IConfigurationFileLocator.cs b/src/GitVersion.Core/Configuration/Abstractions/IConfigurationFileLocator.cs index 3a716c613c..17e5c17a07 100644 --- a/src/GitVersion.Core/Configuration/Abstractions/IConfigurationFileLocator.cs +++ b/src/GitVersion.Core/Configuration/Abstractions/IConfigurationFileLocator.cs @@ -3,7 +3,7 @@ namespace GitVersion.Configuration; public interface IConfigurationFileLocator { bool TryGetConfigurationFile(string? workingDirectory, string? projectRootDirectory, out string? configFilePath); - GitVersionConfiguration ReadConfiguration(string? configFilePath); + IGitVersionConfiguration ReadConfiguration(string? configFilePath); IReadOnlyDictionary? ReadOverrideConfiguration(string? configFilePath); void Verify(string? workingDirectory, string? projectRootDirectory); } diff --git a/src/GitVersion.Core/Configuration/BranchConfiguration.cs b/src/GitVersion.Core/Configuration/BranchConfiguration.cs index 20aca70b7c..65953f1a34 100644 --- a/src/GitVersion.Core/Configuration/BranchConfiguration.cs +++ b/src/GitVersion.Core/Configuration/BranchConfiguration.cs @@ -4,7 +4,7 @@ namespace GitVersion.Configuration; -public record BranchConfiguration : IBranchConfiguration +internal record BranchConfiguration : IBranchConfiguration { [JsonPropertyName("mode")] [JsonPropertyDescription("The versioning mode for this branch. Can be 'ContinuousDelivery', 'ContinuousDeployment', 'Mainline'.")] diff --git a/src/GitVersion.Core/Configuration/BranchConfigurationBuilder.cs b/src/GitVersion.Core/Configuration/BranchConfigurationBuilder.cs index 28b9aeb90e..2f7db23cb3 100644 --- a/src/GitVersion.Core/Configuration/BranchConfigurationBuilder.cs +++ b/src/GitVersion.Core/Configuration/BranchConfigurationBuilder.cs @@ -2,7 +2,7 @@ namespace GitVersion.Configuration; -public class BranchConfigurationBuilder +internal class BranchConfigurationBuilder { public static BranchConfigurationBuilder New => new(); @@ -148,7 +148,7 @@ public virtual BranchConfigurationBuilder WithConfiguration(IBranchConfiguration return this; } - public BranchConfiguration Build() => new() + public IBranchConfiguration Build() => new BranchConfiguration { VersioningMode = versioningMode, Label = label, diff --git a/src/GitVersion.Core/Configuration/ConfigurationBuilderBase.cs b/src/GitVersion.Core/Configuration/ConfigurationBuilderBase.cs index 528960d7e1..85d31138f7 100644 --- a/src/GitVersion.Core/Configuration/ConfigurationBuilderBase.cs +++ b/src/GitVersion.Core/Configuration/ConfigurationBuilderBase.cs @@ -167,9 +167,9 @@ public virtual TConfigurationBuilder WithLabelPreReleaseWeight(int? value) return (TConfigurationBuilder)this; } - public virtual TConfigurationBuilder WithIgnoreConfiguration(IgnoreConfiguration value) + public virtual TConfigurationBuilder WithIgnoreConfiguration(IIgnoreConfiguration value) { - this.ignore = value; + this.ignore = (IgnoreConfiguration)value; return (TConfigurationBuilder)this; } @@ -206,6 +206,9 @@ public virtual TConfigurationBuilder WithoutBranches() public virtual BranchConfigurationBuilder WithBranch(string value) => this.branchConfigurationBuilders.GetOrAdd(value, () => BranchConfigurationBuilder.New); + public virtual BranchConfigurationBuilder WithBranch(string value, BranchConfigurationBuilder builder) + => this.branchConfigurationBuilders.GetOrAdd(value, () => builder); + public virtual TConfigurationBuilder WithBranch(string value, Action action) { var result = this.branchConfigurationBuilders.GetOrAdd(value, () => BranchConfigurationBuilder.New); @@ -291,7 +294,7 @@ public virtual TConfigurationBuilder WithPreReleaseWeight(int? value) return (TConfigurationBuilder)this; } - public virtual TConfigurationBuilder WithConfiguration(GitVersionConfiguration value) + public virtual TConfigurationBuilder WithConfiguration(IGitVersionConfiguration value) { WithAssemblyVersioningScheme(value.AssemblyVersioningScheme); WithAssemblyFileVersioningScheme(value.AssemblyFileVersioningScheme); @@ -338,15 +341,15 @@ public void AddOverride(IReadOnlyDictionary value) } } - public virtual GitVersionConfiguration Build() + public virtual IGitVersionConfiguration Build() { Dictionary branches = new(); foreach (var (name, branchConfigurationBuilder) in this.branchConfigurationBuilders) { - branches.Add(name, branchConfigurationBuilder.Build()); + branches.Add(name, (BranchConfiguration)branchConfigurationBuilder.Build()); } - GitVersionConfiguration configuration = new() + IGitVersionConfiguration configuration = new GitVersionConfiguration { AssemblyVersioningScheme = this.assemblyVersioningScheme, AssemblyFileVersioningScheme = this.assemblyFileVersioningScheme, @@ -397,7 +400,7 @@ public virtual GitVersionConfiguration Build() return configuration; } - private static void FinalizeConfiguration(GitVersionConfiguration configuration) + private static void FinalizeConfiguration(IGitVersionConfiguration configuration) { foreach (var (name, branchConfiguration) in configuration.Branches) { @@ -405,18 +408,18 @@ private static void FinalizeConfiguration(GitVersionConfiguration configuration) } } - private static void FinalizeBranchConfiguration(GitVersionConfiguration configuration, string branchName, + private static void FinalizeBranchConfiguration(IGitVersionConfiguration configuration, string branchName, IBranchConfiguration branchConfiguration) { - var branches = new Dictionary(configuration.Branches); + var branches = configuration.Branches; foreach (var targetBranchName in branchConfiguration.IsSourceBranchFor) { - var targetBranchConfiguration = branches[targetBranchName]; + var targetBranchConfiguration = (BranchConfiguration)branches[targetBranchName]; targetBranchConfiguration.SourceBranches.Add(branchName); } } - private static void ValidateConfiguration(GitVersionConfiguration configuration) + private static void ValidateConfiguration(IGitVersionConfiguration configuration) { foreach (var (name, branchConfiguration) in configuration.Branches) { diff --git a/src/GitVersion.Core/Configuration/ConfigurationConstants.cs b/src/GitVersion.Core/Configuration/ConfigurationConstants.cs index 2500427685..85966d7759 100644 --- a/src/GitVersion.Core/Configuration/ConfigurationConstants.cs +++ b/src/GitVersion.Core/Configuration/ConfigurationConstants.cs @@ -1,6 +1,6 @@ namespace GitVersion.Configuration; -public static class ConfigurationConstants +internal static class ConfigurationConstants { public const string DefaultLabelPrefix = "[vV]?"; public const string BranchNamePlaceholder = "{BranchName}"; diff --git a/src/GitVersion.Core/Configuration/ConfigurationFileLocator.cs b/src/GitVersion.Core/Configuration/ConfigurationFileLocator.cs index 3d4da2794d..2023e8345c 100644 --- a/src/GitVersion.Core/Configuration/ConfigurationFileLocator.cs +++ b/src/GitVersion.Core/Configuration/ConfigurationFileLocator.cs @@ -5,7 +5,7 @@ namespace GitVersion.Configuration; -public class ConfigurationFileLocator : IConfigurationFileLocator +internal class ConfigurationFileLocator : IConfigurationFileLocator { public const string DefaultFileName = "GitVersion.yml"; public const string DefaultAlternativeFileName = "GitVersion.yaml"; @@ -30,7 +30,7 @@ public void Verify(string? workingDirectory, string? projectRootDirectory) WarnAboutAmbiguousConfigFileSelection(workingDirectory, projectRootDirectory); } - public GitVersionConfiguration ReadConfiguration(string? configFilePath) + public IGitVersionConfiguration ReadConfiguration(string? configFilePath) { if (configFilePath == null || !this.fileSystem.Exists(configFilePath)) return new GitVersionConfiguration(); diff --git a/src/GitVersion.Core/Configuration/ConfigurationHelper.cs b/src/GitVersion.Core/Configuration/ConfigurationHelper.cs index 65f74b8a0d..a7a82f4536 100644 --- a/src/GitVersion.Core/Configuration/ConfigurationHelper.cs +++ b/src/GitVersion.Core/Configuration/ConfigurationHelper.cs @@ -16,21 +16,21 @@ internal class ConfigurationHelper if (this._dictionary == null) { this._yaml ??= ConfigurationSerializer.Serialize(this.configuration!); - this._dictionary = ConfigurationSerializer.Deserialize>(this._yaml!); + this._dictionary = ConfigurationSerializer.Deserialize>(this._yaml); } return this._dictionary; } } private IReadOnlyDictionary? _dictionary; - public GitVersionConfiguration Configuration => this.configuration ??= ConfigurationSerializer.Deserialize(Yaml); - private GitVersionConfiguration? configuration; + public IGitVersionConfiguration Configuration => this.configuration ??= ConfigurationSerializer.Deserialize(Yaml); + private IGitVersionConfiguration? configuration; internal ConfigurationHelper(string yaml) => this._yaml = yaml.NotNull(); internal ConfigurationHelper(IReadOnlyDictionary dictionary) => this._dictionary = dictionary.NotNull(); - public ConfigurationHelper(GitVersionConfiguration configuration) => this.configuration = configuration.NotNull(); + public ConfigurationHelper(IGitVersionConfiguration configuration) => this.configuration = configuration.NotNull(); public void Override(IReadOnlyDictionary value) { diff --git a/src/GitVersion.Core/Configuration/ConfigurationProvider.cs b/src/GitVersion.Core/Configuration/ConfigurationProvider.cs index 6e09d050ca..a67b669d92 100644 --- a/src/GitVersion.Core/Configuration/ConfigurationProvider.cs +++ b/src/GitVersion.Core/Configuration/ConfigurationProvider.cs @@ -8,7 +8,7 @@ namespace GitVersion.Configuration; -public class ConfigurationProvider : IConfigurationProvider +internal class ConfigurationProvider : IConfigurationProvider { private readonly IFileSystem fileSystem; private readonly ILog log; diff --git a/src/GitVersion.Core/Configuration/ConfigurationSerializer.cs b/src/GitVersion.Core/Configuration/ConfigurationSerializer.cs index 049d38d6c9..f29a19a1b3 100644 --- a/src/GitVersion.Core/Configuration/ConfigurationSerializer.cs +++ b/src/GitVersion.Core/Configuration/ConfigurationSerializer.cs @@ -4,7 +4,7 @@ namespace GitVersion.Configuration; -public static class ConfigurationSerializer +internal static class ConfigurationSerializer { private static IDeserializer Deserializer => new DeserializerBuilder() .WithNamingConvention(HyphenatedNamingConvention.Instance) @@ -20,7 +20,7 @@ public static class ConfigurationSerializer public static string Serialize(object graph) => Serializer.Serialize(graph); - public static GitVersionConfiguration Read(TextReader reader) + public static IGitVersionConfiguration Read(TextReader reader) { var configuration = Deserializer.Deserialize(reader); return configuration ?? new GitVersionConfiguration(); diff --git a/src/GitVersion.Core/Configuration/GitFlowConfigurationBuilder.cs b/src/GitVersion.Core/Configuration/GitFlowConfigurationBuilder.cs index e698a3f1f4..aa9635910d 100644 --- a/src/GitVersion.Core/Configuration/GitFlowConfigurationBuilder.cs +++ b/src/GitVersion.Core/Configuration/GitFlowConfigurationBuilder.cs @@ -9,7 +9,7 @@ internal sealed class GitFlowConfigurationBuilder : ConfigurationBuilderBase value); - GitVersionConfiguration Build(); + IGitVersionConfiguration Build(); } diff --git a/src/GitVersion.Core/Configuration/IgnoreConfiguration.cs b/src/GitVersion.Core/Configuration/IgnoreConfiguration.cs index 79c23d154e..92c02db4f9 100644 --- a/src/GitVersion.Core/Configuration/IgnoreConfiguration.cs +++ b/src/GitVersion.Core/Configuration/IgnoreConfiguration.cs @@ -2,7 +2,7 @@ namespace GitVersion.Configuration; -public record IgnoreConfiguration : IIgnoreConfiguration +internal record IgnoreConfiguration : IIgnoreConfiguration { [JsonPropertyName("commits-before")] [JsonPropertyDescription("Commits before this date will be ignored. Format: yyyy-MM-ddTHH:mm:ss.")] diff --git a/src/GitVersion.Core/Configuration/IgnoreConfigurationBuilder.cs b/src/GitVersion.Core/Configuration/IgnoreConfigurationBuilder.cs index 0b367d320f..6825ad091f 100644 --- a/src/GitVersion.Core/Configuration/IgnoreConfigurationBuilder.cs +++ b/src/GitVersion.Core/Configuration/IgnoreConfigurationBuilder.cs @@ -32,7 +32,7 @@ public IgnoreConfigurationBuilder WithShas(HashSet value) return this; } - public IgnoreConfiguration Build() => new() + public IIgnoreConfiguration Build() => new IgnoreConfiguration() { Before = before, Shas = shas diff --git a/src/GitVersion.Core/Configuration/IgnoreConfigurationExtensions.cs b/src/GitVersion.Core/Configuration/IgnoreConfigurationExtensions.cs index 2840852878..c442ad829b 100644 --- a/src/GitVersion.Core/Configuration/IgnoreConfigurationExtensions.cs +++ b/src/GitVersion.Core/Configuration/IgnoreConfigurationExtensions.cs @@ -3,7 +3,7 @@ namespace GitVersion.Configuration; -public static class IgnoreConfigurationExtensions +internal static class IgnoreConfigurationExtensions { public static IEnumerable ToFilters(this IIgnoreConfiguration source) { diff --git a/src/GitVersion.Core/Configuration/Init/BuildServer/AppVeyorSetup.cs b/src/GitVersion.Core/Configuration/Init/BuildServer/AppVeyorSetup.cs index 6915946cb3..7d105f06dd 100644 --- a/src/GitVersion.Core/Configuration/Init/BuildServer/AppVeyorSetup.cs +++ b/src/GitVersion.Core/Configuration/Init/BuildServer/AppVeyorSetup.cs @@ -18,7 +18,7 @@ public AppVeyorSetup WithData(ProjectVisibility visibility) return this; } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { var editConfigStep = this.StepFactory.CreateStep(); switch (result) @@ -80,7 +80,7 @@ private void WriteConfig(string workingDirectory, IFileSystem fileSystem, string this.Log.Info($"AppVeyor sample configuration file written to {outputFilename}"); } - protected override string GetPrompt(GitVersionConfiguration configuration, string workingDirectory) + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) { var prompt = new StringBuilder(); if (AppVeyorConfigExists(workingDirectory, this.FileSystem)) diff --git a/src/GitVersion.Core/Configuration/Init/BuildServer/AppveyorPublicPrivate.cs b/src/GitVersion.Core/Configuration/Init/BuildServer/AppveyorPublicPrivate.cs index e60167dcae..ca2a5ffa43 100644 --- a/src/GitVersion.Core/Configuration/Init/BuildServer/AppveyorPublicPrivate.cs +++ b/src/GitVersion.Core/Configuration/Init/BuildServer/AppveyorPublicPrivate.cs @@ -9,7 +9,7 @@ public AppveyorPublicPrivate(IConsole console, IFileSystem fileSystem, ILog log, { } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { switch (result) { @@ -26,7 +26,7 @@ protected override StepResult HandleResult(string? result, Queue @"Is your project public or private? + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => @"Is your project public or private? That is ... does it require authentication to clone/pull? diff --git a/src/GitVersion.Core/Configuration/Init/BuildServer/SetupBuildScripts.cs b/src/GitVersion.Core/Configuration/Init/BuildServer/SetupBuildScripts.cs index bd1624b8f6..65b389f514 100644 --- a/src/GitVersion.Core/Configuration/Init/BuildServer/SetupBuildScripts.cs +++ b/src/GitVersion.Core/Configuration/Init/BuildServer/SetupBuildScripts.cs @@ -9,7 +9,7 @@ public SetupBuildScripts(IConsole console, IFileSystem fileSystem, ILog log, ICo { } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { switch (result) { @@ -23,7 +23,7 @@ protected override StepResult HandleResult(string? result, Queue @"What build server are you using? + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => @"What build server are you using? Want to see more? Contribute a pull request! diff --git a/src/GitVersion.Core/Configuration/Init/EditConfigStep.cs b/src/GitVersion.Core/Configuration/Init/EditConfigStep.cs index 03200fa6ed..be42fbecfe 100644 --- a/src/GitVersion.Core/Configuration/Init/EditConfigStep.cs +++ b/src/GitVersion.Core/Configuration/Init/EditConfigStep.cs @@ -5,13 +5,13 @@ namespace GitVersion.Configuration.Init; -public class EditConfigStep : ConfigInitWizardStep +internal class EditConfigStep : ConfigInitWizardStep { public EditConfigStep(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { switch (result) { @@ -45,7 +45,10 @@ protected override StepResult HandleResult(string? result, Queue $@"Which would you like to change? + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) + { + var configuration = configurationBuilder.Build(); + return $@"Which would you like to change? 0) Save changes and exit 1) Exit without saving @@ -57,6 +60,7 @@ protected override string GetPrompt(GitVersionConfiguration configuration, strin 5) Branch Increment mode (per commit/after tag) (Current: {configuration.VersioningMode ?? VersionCalculation.VersioningMode.ContinuousDeployment}) 6) Assembly versioning scheme (Current: {configuration.AssemblyVersioningScheme}) 7) Setup build scripts"; + } protected override string? DefaultResult => null; } diff --git a/src/GitVersion.Core/Configuration/Init/GitVersionInitModule.cs b/src/GitVersion.Core/Configuration/Init/GitVersionInitModule.cs index 156fca30c7..048d81c233 100644 --- a/src/GitVersion.Core/Configuration/Init/GitVersionInitModule.cs +++ b/src/GitVersion.Core/Configuration/Init/GitVersionInitModule.cs @@ -3,14 +3,14 @@ namespace GitVersion.Configuration.Init; -public class GitVersionInitModule : GitVersionModule +public class GitVersionInitModule : IGitVersionModule { - public override void RegisterTypes(IServiceCollection services) + public void RegisterTypes(IServiceCollection services) { services.AddTransient(); services.AddTransient(); - var steps = FindAllDerivedTypes(Assembly.GetAssembly(GetType())); + var steps = IGitVersionModule.FindAllDerivedTypes(Assembly.GetAssembly(GetType())); foreach (var step in steps) { diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/AssemblyVersioningSchemeSetting.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/AssemblyVersioningSchemeSetting.cs index f085e5807b..e48eac26a1 100644 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/AssemblyVersioningSchemeSetting.cs +++ b/src/GitVersion.Core/Configuration/Init/SetConfig/AssemblyVersioningSchemeSetting.cs @@ -4,13 +4,13 @@ namespace GitVersion.Configuration.Init.SetConfig; -public class AssemblyVersioningSchemeSetting : ConfigInitWizardStep +internal class AssemblyVersioningSchemeSetting : ConfigInitWizardStep { public AssemblyVersioningSchemeSetting(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { var editConfigStep = this.StepFactory.CreateStep(); switch (result) @@ -19,23 +19,23 @@ protected override StepResult HandleResult(string? result, Queue @"What assembly versioning scheme do you want to use: + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => @"What assembly versioning scheme do you want to use: 0) Go Back 1) Major.0.0.0 diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranch.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranch.cs index 89accd9510..1099c93976 100644 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranch.cs +++ b/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranch.cs @@ -3,23 +3,23 @@ namespace GitVersion.Configuration.Init.SetConfig; -public class ConfigureBranch : ConfigInitWizardStep +internal class ConfigureBranch : ConfigInitWizardStep { private string name; - private BranchConfiguration branchConfiguration; + private BranchConfigurationBuilder branchConfigurationBuilder; public ConfigureBranch(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - public ConfigureBranch WithData(string configName, BranchConfiguration configuration) + public ConfigureBranch WithData(string configName, BranchConfigurationBuilder configurationBuilder) { - this.branchConfiguration = configuration; + this.branchConfigurationBuilder = configurationBuilder; this.name = configName; return this; } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { switch (result) { @@ -27,21 +27,25 @@ protected override StepResult HandleResult(string? result, Queue()); return StepResult.Ok(); case "1": - steps.Enqueue(this.StepFactory.CreateStep().WithData(name, branchConfiguration)); + steps.Enqueue(this.StepFactory.CreateStep().WithData(name, this.branchConfigurationBuilder)); return StepResult.Ok(); case "2": - steps.Enqueue(this.StepFactory.CreateStep().WithData(name, branchConfiguration)); + steps.Enqueue(this.StepFactory.CreateStep().WithData(name, this.branchConfigurationBuilder)); return StepResult.Ok(); } return StepResult.InvalidResponseSelected(); } - protected override string GetPrompt(GitVersionConfiguration configuration, string workingDirectory) => $@"What would you like to change for '{this.name}': + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) + { + var branchConfiguration = this.branchConfigurationBuilder.Build(); + return $@"What would you like to change for '{this.name}': 0) Go Back -1) Branch Pr-release tag (Current: {this.branchConfiguration.Label}) -2) Branch Increment mode (per commit/after tag) (Current: {this.branchConfiguration.VersioningMode})"; +1) Branch Pr-release tag (Current: {branchConfiguration.Label}) +2) Branch Increment mode (per commit/after tag) (Current: {branchConfiguration.VersioningMode})"; + } protected override string DefaultResult => "0"; } diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranches.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranches.cs index 442ff98754..b2b9d90964 100644 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranches.cs +++ b/src/GitVersion.Core/Configuration/Init/SetConfig/ConfigureBranches.cs @@ -3,13 +3,13 @@ namespace GitVersion.Configuration.Init.SetConfig; -public class ConfigureBranches : ConfigInitWizardStep +internal class ConfigureBranches : ConfigInitWizardStep { public ConfigureBranches(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { if (int.TryParse(result, out var parsed)) { @@ -21,14 +21,11 @@ protected override StepResult HandleResult(string? result, Queue().WithData(foundBranch.Key, branchConfiguration)); + var configuration = configurationBuilder.Build(); + var (name, branchConfiguration) = OrderedBranches(configuration).ElementAt(parsed - 1); + var branchConfigurationBuilder = BranchConfigurationBuilder.New.WithConfiguration(branchConfiguration); + configurationBuilder.WithBranch(name, branchConfigurationBuilder); + steps.Enqueue(this.StepFactory.CreateStep().WithData(name, branchConfigurationBuilder)); return StepResult.Ok(); } catch (ArgumentOutOfRangeException) @@ -38,20 +35,25 @@ protected override StepResult HandleResult(string? result, Queue @"Which branch would you like to configure: + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) + { + var configuration = configurationBuilder.Build(); + return @"Which branch would you like to configure: 0) Go Back " + string.Join(System.Environment.NewLine, OrderedBranches(configuration).Select((c, i) => $"{i + 1}) {c.Key}")); + } - private static IOrderedEnumerable> OrderedBranches(GitVersionConfiguration configuration) + private static IOrderedEnumerable> OrderedBranches(IGitVersionConfiguration configuration) { var defaultConfig = GitFlowConfigurationBuilder.New.Build(); + var configurationBranches = configuration.Branches; var defaultConfigurationBranches = defaultConfig.Branches - .Where(k => !configuration.Branches.ContainsKey(k.Key)) + .Where(k => !configurationBranches.ContainsKey(k.Key)) // Return an empty branch configuration - .Select(v => new KeyValuePair(v.Key, new BranchConfiguration())); - return configuration.Branches.Union(defaultConfigurationBranches).OrderBy(b => b.Key); + .Select(v => new KeyValuePair(v.Key, new BranchConfiguration())); + return configurationBranches.Union(defaultConfigurationBranches).OrderBy(b => b.Key); } protected override string DefaultResult => "0"; diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/GlobalModeSetting.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/GlobalModeSetting.cs index 9497f3689b..99cea142d7 100644 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/GlobalModeSetting.cs +++ b/src/GitVersion.Core/Configuration/Init/SetConfig/GlobalModeSetting.cs @@ -4,7 +4,7 @@ namespace GitVersion.Configuration.Init.SetConfig; -public class GlobalModeSetting : ConfigInitWizardStep +internal class GlobalModeSetting : ConfigInitWizardStep { private ConfigInitWizardStep returnToStep; private bool isPartOfWizard; @@ -20,20 +20,20 @@ public GlobalModeSetting WithData(ConfigInitWizardStep returnStep, bool isPartOf return this; } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { switch (result) { case "1": - configuration.VersioningMode = VersioningMode.ContinuousDelivery; + configurationBuilder.WithVersioningMode(VersioningMode.ContinuousDelivery); steps.Enqueue(this.returnToStep); return StepResult.Ok(); case "2": - configuration.VersioningMode = VersioningMode.ContinuousDeployment; + configurationBuilder.WithVersioningMode(VersioningMode.ContinuousDeployment); steps.Enqueue(this.returnToStep); return StepResult.Ok(); case "3": - configuration.VersioningMode = VersioningMode.Mainline; + configurationBuilder.WithVersioningMode(VersioningMode.Mainline); steps.Enqueue(this.returnToStep); return StepResult.Ok(); case "0": @@ -45,7 +45,7 @@ protected override StepResult HandleResult(string? result, Queue $@"What do you want the default increment mode to be (can be override per branch): + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => $@"What do you want the default increment mode to be (can be override per branch): {(!this.isPartOfWizard ? "0) Go Back" : string.Empty)} 1) Follow SemVer and only increment when a release has been tagged (continuous delivery mode) 2) Increment based on branch configuration every commit (continuous deployment mode) diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchIncrementMode.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchIncrementMode.cs index 005dd1c2ba..68c830084d 100644 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchIncrementMode.cs +++ b/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchIncrementMode.cs @@ -4,44 +4,44 @@ namespace GitVersion.Configuration.Init.SetConfig; -public class SetBranchIncrementMode : ConfigInitWizardStep +internal class SetBranchIncrementMode : ConfigInitWizardStep { private string name; - private BranchConfiguration branchConfiguration; + private BranchConfigurationBuilder branchConfigurationBuilder; public SetBranchIncrementMode(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - public SetBranchIncrementMode WithData(string configName, BranchConfiguration configuration) + public SetBranchIncrementMode WithData(string configName, BranchConfigurationBuilder configurationBuilder) { - this.branchConfiguration = configuration; + this.branchConfigurationBuilder = configurationBuilder; this.name = configName; return this; } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { var configureBranchStep = this.StepFactory.CreateStep(); switch (result) { case "0": - steps.Enqueue(configureBranchStep.WithData(this.name, this.branchConfiguration)); + steps.Enqueue(configureBranchStep.WithData(this.name, this.branchConfigurationBuilder)); return StepResult.Ok(); case "1": - this.branchConfiguration.VersioningMode = VersioningMode.ContinuousDelivery; - steps.Enqueue(configureBranchStep.WithData(name, this.branchConfiguration)); + this.branchConfigurationBuilder.WithVersioningMode(VersioningMode.ContinuousDelivery); + steps.Enqueue(configureBranchStep.WithData(name, this.branchConfigurationBuilder)); return StepResult.Ok(); case "2": - this.branchConfiguration.VersioningMode = VersioningMode.ContinuousDeployment; - steps.Enqueue(configureBranchStep.WithData(name, this.branchConfiguration)); + this.branchConfigurationBuilder.WithVersioningMode(VersioningMode.ContinuousDeployment); + steps.Enqueue(configureBranchStep.WithData(name, this.branchConfigurationBuilder)); return StepResult.Ok(); } return StepResult.InvalidResponseSelected(); } - protected override string GetPrompt(GitVersionConfiguration configuration, string workingDirectory) => $@"What do you want the increment mode for {this.name} to be? + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => $@"What do you want the increment mode for {this.name} to be? 0) Go Back 1) Follow SemVer and only increment when a release has been tagged (continuous delivery mode) diff --git a/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchTag.cs b/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchTag.cs index 4aacf2ac83..411d25bb31 100644 --- a/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchTag.cs +++ b/src/GitVersion.Core/Configuration/Init/SetConfig/SetBranchTag.cs @@ -4,23 +4,23 @@ namespace GitVersion.Configuration.Init.SetConfig; -public class SetBranchTag : ConfigInitWizardStep +internal class SetBranchTag : ConfigInitWizardStep { private string name; - private BranchConfiguration branchConfiguration; + private BranchConfigurationBuilder branchConfigurationBuilder; public SetBranchTag(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - public SetBranchTag WithData(string configName, BranchConfiguration configuration) + public SetBranchTag WithData(string configName, BranchConfigurationBuilder configurationBuilder) { - this.branchConfiguration = configuration; + this.branchConfigurationBuilder = configurationBuilder; this.name = configName; return this; } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { if (result.IsNullOrWhiteSpace()) { @@ -31,20 +31,20 @@ protected override StepResult HandleResult(string? result, Queue @"This sets the per-release tag which will be used for versions on this branch (beta, rc etc) + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => @"This sets the per-release tag which will be used for versions on this branch (beta, rc etc) 0) Go Back 1) No tag diff --git a/src/GitVersion.Core/Configuration/Init/SetNextVersion.cs b/src/GitVersion.Core/Configuration/Init/SetNextVersion.cs index 620dd6b4f1..a7a1e9198d 100644 --- a/src/GitVersion.Core/Configuration/Init/SetNextVersion.cs +++ b/src/GitVersion.Core/Configuration/Init/SetNextVersion.cs @@ -4,13 +4,13 @@ namespace GitVersion.Configuration.Init; -public class SetNextVersion : ConfigInitWizardStep +internal class SetNextVersion : ConfigInitWizardStep { public SetNextVersion(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { var editConfigStep = this.StepFactory.CreateStep(); if (result.IsNullOrEmpty()) @@ -19,15 +19,16 @@ protected override StepResult HandleResult(string? result, Queue "What would you like to set the next version to (enter nothing to cancel)?"; + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => "What would you like to set the next version to (enter nothing to cancel)?"; protected override string? DefaultResult => null; } diff --git a/src/GitVersion.Core/Configuration/Init/StepResult.cs b/src/GitVersion.Core/Configuration/Init/StepResult.cs index b88a3478d5..10e0b9acdd 100644 --- a/src/GitVersion.Core/Configuration/Init/StepResult.cs +++ b/src/GitVersion.Core/Configuration/Init/StepResult.cs @@ -1,6 +1,6 @@ namespace GitVersion.Configuration.Init; -public sealed class StepResult +internal sealed class StepResult { private StepResult() { } diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitStepFactory.cs b/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitStepFactory.cs index f6414b5bce..11d66fae97 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitStepFactory.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitStepFactory.cs @@ -3,7 +3,7 @@ namespace GitVersion.Configuration.Init.Wizard; -public class ConfigInitStepFactory : IConfigInitStepFactory +internal class ConfigInitStepFactory : IConfigInitStepFactory { private readonly IServiceProvider sp; diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizard.cs b/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizard.cs index 91a6522634..c8b1ce12b6 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizard.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizard.cs @@ -3,7 +3,7 @@ namespace GitVersion.Configuration.Init.Wizard; -public class ConfigInitWizard : IConfigInitWizard +internal class ConfigInitWizard : IConfigInitWizard { private readonly IConsole console; private readonly IConfigInitStepFactory stepFactory; @@ -14,21 +14,22 @@ public ConfigInitWizard(IConsole console, IConfigInitStepFactory stepFactory) this.stepFactory = stepFactory.NotNull(); } - public GitVersionConfiguration? Run(GitVersionConfiguration configuration, string workingDirectory) + public IGitVersionConfiguration? Run(IGitVersionConfiguration configuration, string workingDirectory) { this.console.WriteLine("GitVersion init will guide you through setting GitVersion up to work for you"); var steps = new Queue(); steps.Enqueue(this.stepFactory.CreateStep()); + var configurationBuilder = ConfigurationBuilder.New.WithConfiguration(configuration); while (steps.Count > 0) { var currentStep = steps.Dequeue(); - if (!currentStep.Apply(steps, configuration, workingDirectory)) + if (!currentStep.Apply(steps, configurationBuilder, workingDirectory)) { return null; } } - return configuration; + return configurationBuilder.Build(); } } diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizardStep.cs b/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizardStep.cs index 73d5a17722..5ddef43b7c 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizardStep.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/ConfigInitWizardStep.cs @@ -3,7 +3,7 @@ namespace GitVersion.Configuration.Init.Wizard; -public abstract class ConfigInitWizardStep +internal abstract class ConfigInitWizardStep { protected readonly IConsole Console; protected readonly IFileSystem FileSystem; @@ -18,10 +18,10 @@ protected ConfigInitWizardStep(IConsole console, IFileSystem fileSystem, ILog lo this.StepFactory = stepFactory.NotNull(); } - public bool Apply(Queue steps, GitVersionConfiguration configuration, string workingDirectory) + public bool Apply(Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { this.Console.WriteLine(); - this.Console.WriteLine(GetPrompt(configuration, workingDirectory)); + this.Console.WriteLine(GetPrompt(configurationBuilder, workingDirectory)); this.Console.WriteLine(); this.Console.Write("> "); var input = this.Console.ReadLine(); @@ -40,7 +40,7 @@ public bool Apply(Queue steps, GitVersionConfiguration con return true; } var resultWithDefaultApplied = input.IsNullOrEmpty() ? DefaultResult : input; - var stepResult = HandleResult(resultWithDefaultApplied, steps, configuration, workingDirectory); + var stepResult = HandleResult(resultWithDefaultApplied, steps, configurationBuilder, workingDirectory); if (stepResult.InvalidResponse) { InvalidResponse(steps); @@ -63,7 +63,7 @@ private void InvalidResponse(Queue steps) steps.Enqueue(this); } - protected abstract StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory); - protected abstract string GetPrompt(GitVersionConfiguration configuration, string workingDirectory); + protected abstract StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory); + protected abstract string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory); protected abstract string? DefaultResult { get; } } diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/FinishedSetupStep.cs b/src/GitVersion.Core/Configuration/Init/Wizard/FinishedSetupStep.cs index b872dfcb93..0ca875c319 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/FinishedSetupStep.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/FinishedSetupStep.cs @@ -2,11 +2,11 @@ namespace GitVersion.Configuration.Init.Wizard; -public class FinishedSetupStep : EditConfigStep +internal class FinishedSetupStep : EditConfigStep { public FinishedSetupStep(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - protected override string GetPrompt(GitVersionConfiguration configuration, string workingDirectory) => $"Questions are all done, you can now edit GitVersion's configuration further{System.Environment.NewLine}" + base.GetPrompt(configuration, workingDirectory); + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => $"Questions are all done, you can now edit GitVersion's configuration further{System.Environment.NewLine}" + base.GetPrompt(configurationBuilder, workingDirectory); } diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/GitFlowSetupStep.cs b/src/GitVersion.Core/Configuration/Init/Wizard/GitFlowSetupStep.cs index 03446bee89..7cea60b0d0 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/GitFlowSetupStep.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/GitFlowSetupStep.cs @@ -3,12 +3,12 @@ namespace GitVersion.Configuration.Init.Wizard; -public class GitFlowSetupStep : GlobalModeSetting +internal class GitFlowSetupStep : GlobalModeSetting { public GitFlowSetupStep(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - protected override string GetPrompt(GitVersionConfiguration configuration, string workingDirectory) - => $"By default GitVersion will only increment the version of the 'develop' branch every commit, all other branches will increment when tagged{System.Environment.NewLine}{System.Environment.NewLine}" + base.GetPrompt(configuration, workingDirectory); + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) + => $"By default GitVersion will only increment the version of the 'develop' branch every commit, all other branches will increment when tagged{System.Environment.NewLine}{System.Environment.NewLine}" + base.GetPrompt(configurationBuilder, workingDirectory); } diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/GitHubFlowStep.cs b/src/GitVersion.Core/Configuration/Init/Wizard/GitHubFlowStep.cs index a04a2f65d7..3a38a10465 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/GitHubFlowStep.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/GitHubFlowStep.cs @@ -3,11 +3,11 @@ namespace GitVersion.Configuration.Init.Wizard; -public class GitHubFlowStep : GlobalModeSetting +internal class GitHubFlowStep : GlobalModeSetting { public GitHubFlowStep(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - protected override string GetPrompt(GitVersionConfiguration configuration, string workingDirectory) => $"By default GitVersion will only increment the version when tagged{System.Environment.NewLine}{System.Environment.NewLine}" + base.GetPrompt(configuration, workingDirectory); + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => $"By default GitVersion will only increment the version when tagged{System.Environment.NewLine}{System.Environment.NewLine}" + base.GetPrompt(configurationBuilder, workingDirectory); } diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitStepFactory.cs b/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitStepFactory.cs index e5d249d61e..78e3d38df6 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitStepFactory.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitStepFactory.cs @@ -1,6 +1,6 @@ namespace GitVersion.Configuration.Init.Wizard; -public interface IConfigInitStepFactory +internal interface IConfigInitStepFactory { T CreateStep() where T : notnull; } diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitWizard.cs b/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitWizard.cs index 482f419926..4e57edf56e 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitWizard.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/IConfigInitWizard.cs @@ -1,6 +1,6 @@ namespace GitVersion.Configuration.Init.Wizard; -public interface IConfigInitWizard +internal interface IConfigInitWizard { - GitVersionConfiguration? Run(GitVersionConfiguration configuration, string workingDirectory); + IGitVersionConfiguration? Run(IGitVersionConfiguration configuration, string workingDirectory); } diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy1Step.cs b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy1Step.cs index be077d66bd..97e91194a7 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy1Step.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy1Step.cs @@ -2,13 +2,13 @@ namespace GitVersion.Configuration.Init.Wizard; -public class PickBranchingStrategy1Step : ConfigInitWizardStep +internal class PickBranchingStrategy1Step : ConfigInitWizardStep { public PickBranchingStrategy1Step(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { switch (result?.ToLower()) { @@ -26,7 +26,7 @@ protected override StepResult HandleResult(string? result, Queue @"GitVersion can try to recommend you a branching strategy based on a few questions. + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => @"GitVersion can try to recommend you a branching strategy based on a few questions. Do you need to maintain multiple versions of your application simultaneously in production? (y/n)"; diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy2Step.cs b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy2Step.cs index 8a079ba9cc..acc5052154 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy2Step.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy2Step.cs @@ -2,13 +2,13 @@ namespace GitVersion.Configuration.Init.Wizard; -public class PickBranchingStrategy2Step : ConfigInitWizardStep +internal class PickBranchingStrategy2Step : ConfigInitWizardStep { public PickBranchingStrategy2Step(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { switch (result?.ToLower()) { @@ -29,7 +29,7 @@ protected override StepResult HandleResult(string? result, Queue "Do you stabilise releases while continuing work on the next version? (y/n)"; + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => "Do you stabilise releases while continuing work on the next version? (y/n)"; protected override string? DefaultResult => null; } diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy3Step.cs b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy3Step.cs index 5021af5584..aa2aaa5f2a 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy3Step.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategy3Step.cs @@ -2,13 +2,13 @@ namespace GitVersion.Configuration.Init.Wizard; -public class PickBranchingStrategy3Step : ConfigInitWizardStep +internal class PickBranchingStrategy3Step : ConfigInitWizardStep { public PickBranchingStrategy3Step(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { switch (result?.ToLower()) { @@ -30,7 +30,7 @@ protected override StepResult HandleResult(string? result, Queue "Do you need to build nightly or consume packages the CI build creates without releasing those versions? (y/n)"; + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => "Do you need to build nightly or consume packages the CI build creates without releasing those versions? (y/n)"; protected override string? DefaultResult => null; } diff --git a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategyStep.cs b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategyStep.cs index 081679f8cc..517e4448c6 100644 --- a/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategyStep.cs +++ b/src/GitVersion.Core/Configuration/Init/Wizard/PickBranchingStrategyStep.cs @@ -2,13 +2,13 @@ namespace GitVersion.Configuration.Init.Wizard; -public class PickBranchingStrategyStep : ConfigInitWizardStep +internal class PickBranchingStrategyStep : ConfigInitWizardStep { public PickBranchingStrategyStep(IConsole console, IFileSystem fileSystem, ILog log, IConfigInitStepFactory stepFactory) : base(console, fileSystem, log, stepFactory) { } - protected override StepResult HandleResult(string? result, Queue steps, GitVersionConfiguration configuration, string workingDirectory) + protected override StepResult HandleResult(string? result, Queue steps, ConfigurationBuilder configurationBuilder, string workingDirectory) { var returnToStep = this.StepFactory.CreateStep(); switch (result) @@ -29,7 +29,7 @@ protected override StepResult HandleResult(string? result, Queue @"The way you will use GitVersion will change a lot based on your branching strategy. What branching strategy will you be using: + protected override string GetPrompt(ConfigurationBuilder configurationBuilder, string workingDirectory) => @"The way you will use GitVersion will change a lot based on your branching strategy. What branching strategy will you be using: 1) GitFlow (or similar) 2) GitHubFlow diff --git a/src/GitVersion.Core/Configuration/SupportedWorkflows/WorkflowManager.cs b/src/GitVersion.Core/Configuration/SupportedWorkflows/WorkflowManager.cs index af8956ed97..51a9cd3fe0 100644 --- a/src/GitVersion.Core/Configuration/SupportedWorkflows/WorkflowManager.cs +++ b/src/GitVersion.Core/Configuration/SupportedWorkflows/WorkflowManager.cs @@ -1,28 +1,27 @@ using GitVersion.Extensions; -namespace GitVersion.Configuration.SupportedWorkflows -{ - internal static class WorkflowManager - { - private static readonly string ResourceNameTemplate = DetermineResourceNameTemplate(); +namespace GitVersion.Configuration.SupportedWorkflows; - private static string DetermineResourceNameTemplate() - { - var fullClassName = typeof(WorkflowManager).FullName!; - var resourceNamePrefix = fullClassName[..(fullClassName.Length - nameof(WorkflowManager).Length - 1)]; - return $"{resourceNamePrefix}.{{0}}.yml"; - } +internal static class WorkflowManager +{ + private static readonly string ResourceNameTemplate = DetermineResourceNameTemplate(); - public static Dictionary? GetOverrideConfiguration(string? workflow) - { - if (string.IsNullOrEmpty(workflow)) return null; + private static string DetermineResourceNameTemplate() + { + var fullClassName = typeof(WorkflowManager).FullName!; + var resourceNamePrefix = fullClassName[..(fullClassName.Length - nameof(WorkflowManager).Length - 1)]; + return $"{resourceNamePrefix}.{{0}}.yml"; + } - var resourceName = GetResourceName(workflow); - var embeddedResource = resourceName.ReadAsStringFromEmbeddedResource(typeof(WorkflowManager).Assembly); - return ConfigurationSerializer.Deserialize>(embeddedResource); - } + public static Dictionary? GetOverrideConfiguration(string? workflow) + { + if (string.IsNullOrEmpty(workflow)) return null; - private static string GetResourceName(string workflow) - => ResourceNameTemplate.Replace("{0}", workflow.Replace('/', '.')); + var resourceName = GetResourceName(workflow); + var embeddedResource = resourceName.ReadAsStringFromEmbeddedResource(typeof(WorkflowManager).Assembly); + return ConfigurationSerializer.Deserialize>(embeddedResource); } + + private static string GetResourceName(string workflow) + => ResourceNameTemplate.Replace("{0}", workflow.Replace('/', '.')); } diff --git a/src/GitVersion.Core/Core/Abstractions/IGitVersionCalculateTool.cs b/src/GitVersion.Core/Core/Abstractions/IGitVersionCalculateTool.cs index 94f2e5c1d0..24c86e9428 100644 --- a/src/GitVersion.Core/Core/Abstractions/IGitVersionCalculateTool.cs +++ b/src/GitVersion.Core/Core/Abstractions/IGitVersionCalculateTool.cs @@ -4,5 +4,5 @@ namespace GitVersion; public interface IGitVersionCalculateTool { - VersionVariables CalculateVersionVariables(); + GitVersionVariables CalculateVersionVariables(); } diff --git a/src/GitVersion.Core/Core/Abstractions/IGitVersionModule.cs b/src/GitVersion.Core/Core/Abstractions/IGitVersionModule.cs index e1461d9fc2..0d8e217a35 100644 --- a/src/GitVersion.Core/Core/Abstractions/IGitVersionModule.cs +++ b/src/GitVersion.Core/Core/Abstractions/IGitVersionModule.cs @@ -1,3 +1,4 @@ +using GitVersion.Extensions; using Microsoft.Extensions.DependencyInjection; namespace GitVersion; @@ -5,4 +6,12 @@ namespace GitVersion; public interface IGitVersionModule { void RegisterTypes(IServiceCollection services); + + static IEnumerable FindAllDerivedTypes(Assembly? assembly) + { + assembly.NotNull(); + + var derivedType = typeof(T); + return assembly.GetTypes().Where(t => t != derivedType && derivedType.IsAssignableFrom(t)); + } } diff --git a/src/GitVersion.Core/Core/Abstractions/IGitVersionOutputTool.cs b/src/GitVersion.Core/Core/Abstractions/IGitVersionOutputTool.cs deleted file mode 100644 index a20f5a9ecf..0000000000 --- a/src/GitVersion.Core/Core/Abstractions/IGitVersionOutputTool.cs +++ /dev/null @@ -1,11 +0,0 @@ -using GitVersion.OutputVariables; - -namespace GitVersion; - -public interface IGitVersionOutputTool -{ - void OutputVariables(VersionVariables variables, bool updateBuildNumber); - void UpdateAssemblyInfo(VersionVariables variables); - void UpdateWixVersionFile(VersionVariables variables); - void GenerateGitVersionInformation(VersionVariables variables, FileWriteInfo fileWriteInfo); -} diff --git a/src/GitVersion.Core/Core/Environment.cs b/src/GitVersion.Core/Core/Environment.cs index 7e9200007a..c60818882a 100644 --- a/src/GitVersion.Core/Core/Environment.cs +++ b/src/GitVersion.Core/Core/Environment.cs @@ -1,6 +1,6 @@ namespace GitVersion; -public class Environment : IEnvironment +internal class Environment : IEnvironment { public string? GetEnvironmentVariable(string variableName) => System.Environment.GetEnvironmentVariable(variableName); diff --git a/src/GitVersion.Core/Core/FileSystem.cs b/src/GitVersion.Core/Core/FileSystem.cs index d8eb0b3175..fc253319fc 100644 --- a/src/GitVersion.Core/Core/FileSystem.cs +++ b/src/GitVersion.Core/Core/FileSystem.cs @@ -2,7 +2,7 @@ namespace GitVersion; -public class FileSystem : IFileSystem +internal class FileSystem : IFileSystem { public void Copy(string from, string to, bool overwrite) => File.Copy(from, to, overwrite); diff --git a/src/GitVersion.Core/Core/GitPreparer.cs b/src/GitVersion.Core/Core/GitPreparer.cs index 97dc7934e0..5735e018b1 100644 --- a/src/GitVersion.Core/Core/GitPreparer.cs +++ b/src/GitVersion.Core/Core/GitPreparer.cs @@ -7,7 +7,7 @@ namespace GitVersion; -public class GitPreparer : IGitPreparer +internal class GitPreparer : IGitPreparer { private readonly ILog log; private readonly IEnvironment environment; @@ -356,19 +356,19 @@ private void CreateOrUpdateLocalBranchesFromRemoteTrackingOnes(string remoteName } } - public void EnsureLocalBranchExistsForCurrentBranch(IRemote? remote, string? currentBranch) + public void EnsureLocalBranchExistsForCurrentBranch(IRemote remote, string? currentBranch) { remote.NotNull(); if (currentBranch.IsNullOrEmpty()) return; - var isRef = currentBranch.Contains("refs"); - var isBranch = currentBranch.Contains("refs/heads"); - var localCanonicalName = !isRef - ? "refs/heads/" + currentBranch - : isBranch + var referencePrefix = "refs/"; + var isLocalBranch = currentBranch.StartsWith(ReferenceName.LocalBranchPrefix); + var localCanonicalName = !currentBranch.StartsWith(referencePrefix) + ? ReferenceName.LocalBranchPrefix + currentBranch + : isLocalBranch ? currentBranch - : currentBranch.Replace("refs/", "refs/heads/"); + : ReferenceName.LocalBranchPrefix + currentBranch[referencePrefix.Length..]; var repoTip = this.repository.Head.Tip; @@ -387,14 +387,14 @@ public void EnsureLocalBranchExistsForCurrentBranch(IRemote? remote, string? cur var referenceName = ReferenceName.Parse(localCanonicalName); if (this.repository.Branches.All(b => !b.Name.Equals(referenceName))) { - this.log.Info(isBranch + this.log.Info(isLocalBranch ? $"Creating local branch {referenceName}" : $"Creating local branch {referenceName} pointing at {repoTipId}"); this.repository.Refs.Add(localCanonicalName, repoTipId.Sha); } else { - this.log.Info(isBranch + this.log.Info(isLocalBranch ? $"Updating local branch {referenceName} to point at {repoTipId}" : $"Updating local branch {referenceName} to match ref {currentBranch}"); var localRef = this.repository.Refs[localCanonicalName]; diff --git a/src/GitVersion.Core/Core/GitVersionCalculateTool.cs b/src/GitVersion.Core/Core/GitVersionCalculateTool.cs index 013792c032..b97b444f5c 100644 --- a/src/GitVersion.Core/Core/GitVersionCalculateTool.cs +++ b/src/GitVersion.Core/Core/GitVersionCalculateTool.cs @@ -7,7 +7,7 @@ namespace GitVersion; -public class GitVersionCalculateTool : IGitVersionCalculateTool +internal class GitVersionCalculateTool : IGitVersionCalculateTool { private readonly ILog log; private readonly IGitVersionCache gitVersionCache; @@ -38,7 +38,7 @@ public GitVersionCalculateTool(ILog log, INextVersionCalculator nextVersionCalcu this.versionContext = versionContext.NotNull(); } - public VersionVariables CalculateVersionVariables() + public GitVersionVariables CalculateVersionVariables() { this.gitPreparer.Prepare(); //we need to prepare the repository before using it for version calculation diff --git a/src/GitVersion.Core/Core/GitVersionContextFactory.cs b/src/GitVersion.Core/Core/GitVersionContextFactory.cs index b37658f95c..7048214846 100644 --- a/src/GitVersion.Core/Core/GitVersionContextFactory.cs +++ b/src/GitVersion.Core/Core/GitVersionContextFactory.cs @@ -5,7 +5,7 @@ namespace GitVersion; -public class GitVersionContextFactory : IGitVersionContextFactory +internal class GitVersionContextFactory : IGitVersionContextFactory { private readonly IConfigurationProvider configurationProvider; private readonly IRepositoryStore repositoryStore; diff --git a/src/GitVersion.Core/Core/GitVersionModule.cs b/src/GitVersion.Core/Core/GitVersionModule.cs deleted file mode 100644 index f9b24a65e0..0000000000 --- a/src/GitVersion.Core/Core/GitVersionModule.cs +++ /dev/null @@ -1,17 +0,0 @@ -using GitVersion.Extensions; -using Microsoft.Extensions.DependencyInjection; - -namespace GitVersion; - -public abstract class GitVersionModule : IGitVersionModule -{ - public abstract void RegisterTypes(IServiceCollection services); - - protected static IEnumerable FindAllDerivedTypes(Assembly? assembly) - { - assembly.NotNull(); - - var derivedType = typeof(T); - return assembly.GetTypes().Where(t => t != derivedType && derivedType.IsAssignableFrom(t)); - } -} diff --git a/src/GitVersion.Core/Core/RepositoryStore.cs b/src/GitVersion.Core/Core/RepositoryStore.cs index 683bab2255..e958147d78 100644 --- a/src/GitVersion.Core/Core/RepositoryStore.cs +++ b/src/GitVersion.Core/Core/RepositoryStore.cs @@ -6,7 +6,7 @@ namespace GitVersion; -public class RepositoryStore : IRepositoryStore +internal class RepositoryStore : IRepositoryStore { private readonly ILog log; private readonly IGitRepository repository; diff --git a/src/GitVersion.Core/Extensions/StringExtensions.cs b/src/GitVersion.Core/Extensions/StringExtensions.cs index 0f9615b8be..95b41e8349 100644 --- a/src/GitVersion.Core/Extensions/StringExtensions.cs +++ b/src/GitVersion.Core/Extensions/StringExtensions.cs @@ -20,7 +20,7 @@ public static bool IsValidPath(this string? path) try { - _ = Path.GetFullPath(path); + _ = PathHelper.GetFullPath(path); } catch { @@ -28,7 +28,7 @@ public static bool IsValidPath(this string? path) try { - _ = Path.GetFullPath(path); + _ = PathHelper.GetFullPath(path); } catch { diff --git a/src/GitVersion.Core/GitVersion.Core.csproj b/src/GitVersion.Core/GitVersion.Core.csproj index 22801622af..1f31030fbb 100644 --- a/src/GitVersion.Core/GitVersion.Core.csproj +++ b/src/GitVersion.Core/GitVersion.Core.csproj @@ -27,9 +27,11 @@ + + - + diff --git a/src/GitVersion.Core/Logging/ConsoleAdapter.cs b/src/GitVersion.Core/Logging/ConsoleAdapter.cs index 18df5a066c..1fe87c09fe 100644 --- a/src/GitVersion.Core/Logging/ConsoleAdapter.cs +++ b/src/GitVersion.Core/Logging/ConsoleAdapter.cs @@ -1,6 +1,6 @@ namespace GitVersion.Logging; -public class ConsoleAdapter : IConsole +internal class ConsoleAdapter : IConsole { public void WriteLine(string? msg) => Console.WriteLine(msg); diff --git a/src/GitVersion.Core/Logging/ConsoleAppender.cs b/src/GitVersion.Core/Logging/ConsoleAppender.cs index d75e9b1be8..a168a830c1 100644 --- a/src/GitVersion.Core/Logging/ConsoleAppender.cs +++ b/src/GitVersion.Core/Logging/ConsoleAppender.cs @@ -1,6 +1,6 @@ namespace GitVersion.Logging; -public class ConsoleAppender : ILogAppender +internal class ConsoleAppender : ILogAppender { private readonly object locker; private readonly IDictionary palettes; diff --git a/src/GitVersion.Core/Logging/FileAppender.cs b/src/GitVersion.Core/Logging/FileAppender.cs index 0675915cc5..4a930834e2 100644 --- a/src/GitVersion.Core/Logging/FileAppender.cs +++ b/src/GitVersion.Core/Logging/FileAppender.cs @@ -1,6 +1,6 @@ namespace GitVersion.Logging; -public class FileAppender : ILogAppender +internal class FileAppender : ILogAppender { private readonly string filePath; diff --git a/src/GitVersion.Core/Logging/Log.cs b/src/GitVersion.Core/Logging/Log.cs index 279cbf34f4..c6e382c929 100644 --- a/src/GitVersion.Core/Logging/Log.cs +++ b/src/GitVersion.Core/Logging/Log.cs @@ -3,7 +3,7 @@ namespace GitVersion.Logging; -public sealed class Log : ILog +internal sealed class Log : ILog { private IEnumerable appenders; private readonly Regex obscurePasswordRegex = new("(https?://)(.+)(:.+@)", RegexOptions.Compiled); diff --git a/src/GitVersion.Core/Logging/NullLog.cs b/src/GitVersion.Core/Logging/NullLog.cs index fb9ced94da..6905115f8c 100644 --- a/src/GitVersion.Core/Logging/NullLog.cs +++ b/src/GitVersion.Core/Logging/NullLog.cs @@ -1,6 +1,6 @@ namespace GitVersion.Logging; -public sealed class NullLog : ILog +internal sealed class NullLog : ILog { public Verbosity Verbosity { get; set; } diff --git a/src/GitVersion.Core/Output/IVersionConverter.cs b/src/GitVersion.Core/Output/IVersionConverter.cs index 03cbf71626..34d34a8454 100644 --- a/src/GitVersion.Core/Output/IVersionConverter.cs +++ b/src/GitVersion.Core/Output/IVersionConverter.cs @@ -4,5 +4,5 @@ namespace GitVersion; public interface IVersionConverter : IDisposable where T : IConverterContext { - public void Execute(VersionVariables variables, T context); + public void Execute(GitVersionVariables variables, T context); } diff --git a/src/GitVersion.Core/OutputVariables/GitVersionVariables.cs b/src/GitVersion.Core/OutputVariables/GitVersionVariables.cs new file mode 100644 index 0000000000..e2c5adfccf --- /dev/null +++ b/src/GitVersion.Core/OutputVariables/GitVersionVariables.cs @@ -0,0 +1,97 @@ +namespace GitVersion.OutputVariables; + +public record GitVersionVariables(string Major, + string Minor, + string Patch, + string? BuildMetaData, + string? FullBuildMetaData, + string? BranchName, + string? EscapedBranchName, + string? Sha, + string? ShortSha, + string MajorMinorPatch, + string SemVer, + string FullSemVer, + string? AssemblySemVer, + string? AssemblySemFileVer, + string? PreReleaseTag, + string? PreReleaseTagWithDash, + string? PreReleaseLabel, + string? PreReleaseLabelWithDash, + string? PreReleaseNumber, + string WeightedPreReleaseNumber, + string? InformationalVersion, + string? CommitDate, + string? VersionSourceSha, + string? CommitsSinceVersionSource, + string? UncommittedChanges) : IEnumerable> +{ + public static readonly List AvailableVariables = new() + { + nameof(Major), + nameof(Minor), + nameof(Patch), + nameof(BuildMetaData), + nameof(FullBuildMetaData), + nameof(BranchName), + nameof(EscapedBranchName), + nameof(Sha), + nameof(ShortSha), + nameof(MajorMinorPatch), + nameof(SemVer), + nameof(FullSemVer), + nameof(AssemblySemVer), + nameof(AssemblySemFileVer), + nameof(PreReleaseTag), + nameof(PreReleaseTagWithDash), + nameof(PreReleaseLabel), + nameof(PreReleaseLabelWithDash), + nameof(PreReleaseNumber), + nameof(WeightedPreReleaseNumber), + nameof(InformationalVersion), + nameof(CommitDate), + nameof(VersionSourceSha), + nameof(CommitsSinceVersionSource), + nameof(UncommittedChanges), + }; + + private Dictionary Instance => new() + { + { nameof(Major), Major }, + { nameof(Minor), Minor }, + { nameof(Patch), Patch }, + { nameof(BuildMetaData), BuildMetaData }, + { nameof(FullBuildMetaData), FullBuildMetaData }, + { nameof(BranchName), BranchName }, + { nameof(EscapedBranchName), EscapedBranchName }, + { nameof(Sha), Sha }, + { nameof(ShortSha), ShortSha }, + { nameof(MajorMinorPatch), MajorMinorPatch }, + { nameof(SemVer), SemVer }, + { nameof(FullSemVer), FullSemVer }, + { nameof(AssemblySemVer), AssemblySemVer }, + { nameof(AssemblySemFileVer), AssemblySemFileVer }, + { nameof(PreReleaseTag), PreReleaseTag }, + { nameof(PreReleaseTagWithDash), PreReleaseTagWithDash }, + { nameof(PreReleaseLabel), PreReleaseLabel }, + { nameof(PreReleaseLabelWithDash), PreReleaseLabelWithDash }, + { nameof(PreReleaseNumber), PreReleaseNumber }, + { nameof(WeightedPreReleaseNumber), WeightedPreReleaseNumber }, + { nameof(InformationalVersion), InformationalVersion }, + { nameof(CommitDate), CommitDate }, + { nameof(VersionSourceSha), VersionSourceSha }, + { nameof(CommitsSinceVersionSource), CommitsSinceVersionSource }, + { nameof(UncommittedChanges), UncommittedChanges } + }; + + public IEnumerator> GetEnumerator() => Instance.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => Instance.GetEnumerator(); + + public bool TryGetValue(string variable, out string? variableValue) + { + if (Instance.TryGetValue(variable, out variableValue)) return true; + variableValue = null; + return false; + } +} diff --git a/src/GitVersion.Core/OutputVariables/VersionVariables.cs b/src/GitVersion.Core/OutputVariables/VersionVariables.cs deleted file mode 100644 index 600b6f1114..0000000000 --- a/src/GitVersion.Core/OutputVariables/VersionVariables.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System.Text.Encodings.Web; -using GitVersion.Extensions; -using GitVersion.Helpers; -using YamlDotNet.Serialization; -using static GitVersion.Extensions.ObjectExtensions; - -namespace GitVersion.OutputVariables; - -public class VersionVariables : IEnumerable> -{ - public VersionVariables(string major, - string minor, - string patch, - string? buildMetaData, - string? fullBuildMetaData, - string? branchName, - string? escapedBranchName, - string? sha, - string? shortSha, - string majorMinorPatch, - string semVer, - string fullSemVer, - string? assemblySemVer, - string? assemblySemFileVer, - string? preReleaseTag, - string? preReleaseTagWithDash, - string? preReleaseLabel, - string? preReleaseLabelWithDash, - string? preReleaseNumber, - string weightedPreReleaseNumber, - string? informationalVersion, - string? commitDate, - string? versionSourceSha, - string? commitsSinceVersionSource, - string? uncommittedChanges) - { - Major = major; - Minor = minor; - Patch = patch; - BuildMetaData = buildMetaData; - FullBuildMetaData = fullBuildMetaData; - BranchName = branchName; - EscapedBranchName = escapedBranchName; - Sha = sha; - ShortSha = shortSha; - MajorMinorPatch = majorMinorPatch; - SemVer = semVer; - FullSemVer = fullSemVer; - AssemblySemVer = assemblySemVer; - AssemblySemFileVer = assemblySemFileVer; - PreReleaseTag = preReleaseTag; - PreReleaseTagWithDash = preReleaseTagWithDash; - PreReleaseLabel = preReleaseLabel; - PreReleaseLabelWithDash = preReleaseLabelWithDash; - PreReleaseNumber = preReleaseNumber; - WeightedPreReleaseNumber = weightedPreReleaseNumber; - InformationalVersion = informationalVersion; - CommitDate = commitDate; - VersionSourceSha = versionSourceSha; - CommitsSinceVersionSource = commitsSinceVersionSource; - UncommittedChanges = uncommittedChanges; - } - - public string Major { get; } - public string Minor { get; } - public string Patch { get; } - public string? PreReleaseTag { get; } - public string? PreReleaseTagWithDash { get; } - public string? PreReleaseLabel { get; } - public string? PreReleaseLabelWithDash { get; } - public string? PreReleaseNumber { get; } - public string WeightedPreReleaseNumber { get; } - public string? BuildMetaData { get; } - public string? FullBuildMetaData { get; } - public string MajorMinorPatch { get; } - public string SemVer { get; } - public string? AssemblySemVer { get; } - public string? AssemblySemFileVer { get; } - public string FullSemVer { get; } - public string? InformationalVersion { get; } - public string? BranchName { get; } - public string? EscapedBranchName { get; } - public string? Sha { get; } - public string? ShortSha { get; } - public string? VersionSourceSha { get; } - public string? CommitsSinceVersionSource { get; } - public string? CommitDate { get; set; } - public string? UncommittedChanges { get; } - - [ReflectionIgnore] - public static IEnumerable AvailableVariables => typeof(VersionVariables) - .GetProperties() - .Where(p => !p.GetCustomAttributes(typeof(ReflectionIgnoreAttribute), false).Any()) - .Select(p => p.Name) - .OrderBy(a => a, StringComparer.Ordinal); - - [ReflectionIgnore] - public string? FileName { get; set; } - - [ReflectionIgnore] - public string? this[string variable] => typeof(VersionVariables).GetProperty(variable)?.GetValue(this, null) as string; - - public IEnumerator> GetEnumerator() => this.GetProperties().GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); - - // FIX ME: Shall we return an instance with no ctorArgs or explicitly fail when properties is null? - private static VersionVariables FromDictionary(IEnumerable>? properties) - { - var type = typeof(VersionVariables); - var constructors = type.GetConstructors(); - - var ctor = constructors.Single(); - var ctorArgs = ctor.GetParameters() - .Select(p => properties?.Single(v => string.Equals(v.Key, p.Name, StringComparison.InvariantCultureIgnoreCase)).Value) - .Cast() - .ToArray(); - var instance = Activator.CreateInstance(type, ctorArgs).NotNull(); - return (VersionVariables)instance; - } - - public static VersionVariables FromJson(string json) - { - var serializeOptions = JsonSerializerOptions(); - var variablePairs = JsonSerializer.Deserialize>(json, serializeOptions); - return FromDictionary(variablePairs); - } - - public static VersionVariables FromFile(string filePath, IFileSystem fileSystem) - { - try - { - var retryAction = new RetryAction(); - return retryAction.Execute(() => FromFileInternal(filePath, fileSystem)); - } - catch (AggregateException ex) - { - var lastException = ex.InnerExceptions.LastOrDefault() ?? ex.InnerException; - if (lastException != null) - { - throw lastException; - } - throw; - } - } - private static VersionVariables FromFileInternal(string filePath, IFileSystem fileSystem) - { - using var stream = fileSystem.OpenRead(filePath); - using var reader = new StreamReader(stream); - var dictionary = new Deserializer().Deserialize>(reader); - var versionVariables = FromDictionary(dictionary); - versionVariables.FileName = filePath; - return versionVariables; - } - - public bool TryGetValue(string variable, out string? variableValue) - { - if (ContainsKey(variable)) - { - variableValue = this[variable]; - return true; - } - - variableValue = null; - return false; - } - - private static bool ContainsKey(string variable) => typeof(VersionVariables).GetProperty(variable) != null; - - public override string ToString() - { - var variablesType = typeof(VersionVariablesJsonModel); - var variables = new VersionVariablesJsonModel(); - - foreach (var (key, value) in this.GetProperties()) - { - var propertyInfo = variablesType.GetProperty(key); - propertyInfo?.SetValue(variables, ChangeType(value, propertyInfo.PropertyType)); - } - - var serializeOptions = JsonSerializerOptions(); - - return JsonSerializer.Serialize(variables, serializeOptions); - } - - private static JsonSerializerOptions JsonSerializerOptions() - { - var serializeOptions = new JsonSerializerOptions - { - WriteIndented = true, - Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, - Converters = { new VersionVariablesJsonStringConverter() } - }; - return serializeOptions; - } - - private static object? ChangeType(object? value, Type type) - { - if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) - { - if (value == null || value.ToString()?.Length == 0) - { - return null; - } - - type = Nullable.GetUnderlyingType(type)!; - } - - return Convert.ChangeType(value, type); - } -} diff --git a/src/GitVersion.Core/OutputVariables/VersionVariablesHelper.cs b/src/GitVersion.Core/OutputVariables/VersionVariablesHelper.cs new file mode 100644 index 0000000000..5a41df3a74 --- /dev/null +++ b/src/GitVersion.Core/OutputVariables/VersionVariablesHelper.cs @@ -0,0 +1,95 @@ +using System.Text.Encodings.Web; +using GitVersion.Extensions; +using GitVersion.Helpers; +using YamlDotNet.Serialization; + +namespace GitVersion.OutputVariables; + +public static class VersionVariablesHelper +{ + public static GitVersionVariables FromJson(string json) + { + var serializeOptions = JsonSerializerOptions(); + var variablePairs = JsonSerializer.Deserialize>(json, serializeOptions); + return FromDictionary(variablePairs); + } + + public static GitVersionVariables FromFile(string filePath, IFileSystem fileSystem) + { + try + { + var retryAction = new RetryAction(); + return retryAction.Execute(() => FromFileInternal(filePath, fileSystem)); + } + catch (AggregateException ex) + { + var lastException = ex.InnerExceptions.LastOrDefault() ?? ex.InnerException; + if (lastException != null) + { + throw lastException; + } + + throw; + } + } + + public static string ToJsonString(this GitVersionVariables gitVersionVariables) + { + var variablesType = typeof(VersionVariablesJsonModel); + var variables = new VersionVariablesJsonModel(); + + foreach (var (key, value) in gitVersionVariables.OrderBy(x => x.Key)) + { + var propertyInfo = variablesType.GetProperty(key); + propertyInfo?.SetValue(variables, ChangeType(value, propertyInfo.PropertyType)); + } + + var serializeOptions = JsonSerializerOptions(); + + return JsonSerializer.Serialize(variables, serializeOptions); + } + + private static GitVersionVariables FromDictionary(IEnumerable>? properties) + { + var type = typeof(GitVersionVariables); + var constructors = type.GetConstructors(); + + var ctor = constructors.Single(); + var ctorArgs = ctor.GetParameters() + .Select(p => properties?.Single(v => string.Equals(v.Key, p.Name, StringComparison.InvariantCultureIgnoreCase)).Value) + .Cast() + .ToArray(); + var instance = Activator.CreateInstance(type, ctorArgs).NotNull(); + return (GitVersionVariables)instance; + } + + private static GitVersionVariables FromFileInternal(string filePath, IFileSystem fileSystem) + { + using var stream = fileSystem.OpenRead(filePath); + using var reader = new StreamReader(stream); + var dictionary = new Deserializer().Deserialize>(reader); + var versionVariables = FromDictionary(dictionary); + return versionVariables; + } + + private static JsonSerializerOptions JsonSerializerOptions() + { + var serializeOptions = new JsonSerializerOptions { WriteIndented = true, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, Converters = { new VersionVariablesJsonStringConverter() } }; + return serializeOptions; + } + + private static object? ChangeType(object? value, Type type) + { + if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + if (value == null || value.ToString()?.Length == 0) + { + return null; + } + + type = Nullable.GetUnderlyingType(type)!; + } + + return Convert.ChangeType(value, type); + } +} diff --git a/src/GitVersion.Core/OutputVariables/VersionVariablesJsonModel.cs b/src/GitVersion.Core/OutputVariables/VersionVariablesJsonModel.cs index cddeb87e7d..b720dc7883 100644 --- a/src/GitVersion.Core/OutputVariables/VersionVariablesJsonModel.cs +++ b/src/GitVersion.Core/OutputVariables/VersionVariablesJsonModel.cs @@ -4,21 +4,48 @@ namespace GitVersion.OutputVariables; public class VersionVariablesJsonModel { + [JsonPropertyDescription("Suitable for .NET AssemblyFileVersion. Defaults to Major.Minor.Patch.0.")] + public string? AssemblySemFileVer { get; set; } + + [JsonPropertyDescription("Suitable for .NET AssemblyVersion. Defaults to Major.Minor.0.0")] + public string? AssemblySemVer { get; set; } + + [JsonPropertyDescription("The name of the checked out Git branch.")] + public string? BranchName { get; set; } + + [JsonPropertyDescription("The build metadata, usually representing number of commits since the VersionSourceSha.")] + public int? BuildMetaData { get; set; } + + [JsonPropertyDescription("The ISO-8601 formatted date of the commit identified by Sha.")] + public string? CommitDate { set; get; } + + [JsonPropertyDescription("The number of commits since the version source.")] + public int? CommitsSinceVersionSource { get; set; } + + [JsonPropertyDescription("Equal to BranchName, but with / replaced with -.")] + public string? EscapedBranchName { get; set; } + + [JsonPropertyDescription("The BuildMetaData suffixed with BranchName and Sha.")] + public string? FullBuildMetaData { get; set; } + + [JsonPropertyDescription("The full, SemVer 2.0 compliant version number.")] + public string? FullSemVer { get; set; } + + [JsonPropertyDescription("Suitable for .NET AssemblyInformationalVersion. Defaults to FullSemVer suffixed by FullBuildMetaData.")] + public string? InformationalVersion { get; set; } + [JsonPropertyDescription("The major version. Should be incremented on breaking changes.")] public int? Major { get; set; } + [JsonPropertyDescription("Major, Minor and Patch joined together, separated by '.'.")] + public string? MajorMinorPatch { get; set; } + [JsonPropertyDescription("The minor version. Should be incremented on new features.")] public int? Minor { get; set; } [JsonPropertyDescription("The patch version. Should be incremented on bug fixes.")] public int? Patch { get; set; } - [JsonPropertyDescription("The pre-release tag is the pre-release label suffixed by the PreReleaseNumber.")] - public string? PreReleaseTag { get; set; } - - [JsonPropertyDescription("The pre-release tag prefixed with a dash.")] - public string? PreReleaseTagWithDash { get; set; } - [JsonPropertyDescription("The pre-release label is the name of the pre-release.")] public string? PreReleaseLabel { get; set; } @@ -28,38 +55,14 @@ public class VersionVariablesJsonModel [JsonPropertyDescription("The pre-release number is the number of commits since the last version bump.")] public int? PreReleaseNumber { get; set; } - [JsonPropertyDescription("A summation of branch specific pre-release-weight and the PreReleaseNumber. Can be used to obtain a monotonically increasing version number across the branches.")] - public int? WeightedPreReleaseNumber { get; set; } - - [JsonPropertyDescription("The build metadata, usually representing number of commits since the VersionSourceSha.")] - public int? BuildMetaData { get; set; } - - [JsonPropertyDescription("The BuildMetaData suffixed with BranchName and Sha.")] - public string? FullBuildMetaData { get; set; } + [JsonPropertyDescription("The pre-release tag is the pre-release label suffixed by the PreReleaseNumber.")] + public string? PreReleaseTag { get; set; } - [JsonPropertyDescription("Major, Minor and Patch joined together, separated by '.'.")] - public string? MajorMinorPatch { get; set; } + [JsonPropertyDescription("The pre-release tag prefixed with a dash.")] + public string? PreReleaseTagWithDash { get; set; } [JsonPropertyDescription("The semantic version number, including PreReleaseTagWithDash for pre-release version numbers.")] - public string? SemVer { get; set; } - - [JsonPropertyDescription("Suitable for .NET AssemblyVersion. Defaults to Major.Minor.0.0")] - public string? AssemblySemVer { get; set; } - - [JsonPropertyDescription("Suitable for .NET AssemblyFileVersion. Defaults to Major.Minor.Patch.0.")] - public string? AssemblySemFileVer { get; set; } - - [JsonPropertyDescription("The full, SemVer 2.0 compliant version number.")] - public string? FullSemVer { get; set; } - - [JsonPropertyDescription("Suitable for .NET AssemblyInformationalVersion. Defaults to FullSemVer suffixed by FullBuildMetaData.")] - public string? InformationalVersion { get; set; } - - [JsonPropertyDescription("The name of the checked out Git branch.")] - public string? BranchName { get; set; } - - [JsonPropertyDescription("Equal to BranchName, but with / replaced with -.")] - public string? EscapedBranchName { get; set; } + public string? SemVer { set; get; } [JsonPropertyDescription("The SHA of the Git commit.")] public string? Sha { get; set; } @@ -67,15 +70,12 @@ public class VersionVariablesJsonModel [JsonPropertyDescription("The Sha limited to 7 characters.")] public string? ShortSha { get; set; } + [JsonPropertyDescription("The number of uncommitted changes present in the repository.")] + public int? UncommittedChanges { get; set; } + [JsonPropertyDescription("The SHA of the commit used as version source.")] public string? VersionSourceSha { get; set; } - [JsonPropertyDescription("The number of commits since the version source.")] - public int? CommitsSinceVersionSource { get; set; } - - [JsonPropertyDescription("The ISO-8601 formatted date of the commit identified by Sha.")] - public string? CommitDate { set; get; } - - [JsonPropertyDescription("The number of uncommitted changes present in the repository.")] - public int? UncommittedChanges { get; set; } + [JsonPropertyDescription("A summation of branch specific pre-release-weight and the PreReleaseNumber. Can be used to obtain a monotonically increasing version number across the branches.")] + public int? WeightedPreReleaseNumber { get; set; } } diff --git a/src/GitVersion.Core/PublicAPI.Unshipped.txt b/src/GitVersion.Core/PublicAPI.Unshipped.txt index 653b071699..6e3b993774 100644 --- a/src/GitVersion.Core/PublicAPI.Unshipped.txt +++ b/src/GitVersion.Core/PublicAPI.Unshipped.txt @@ -1,21 +1,15 @@ #nullable enable -abstract GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! GitVersion.Agents.BuildAgentBase GitVersion.Agents.BuildAgentBase.BuildAgentBase(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void GitVersion.Agents.BuildAgentBase.Environment.get -> GitVersion.IEnvironment! -GitVersion.Agents.BuildAgentBase.GenerateBuildLogOutput(GitVersion.OutputVariables.VersionVariables! variables) -> System.Collections.Generic.IEnumerable! -GitVersion.Agents.BuildAgentResolver -GitVersion.Agents.BuildAgentResolver.BuildAgentResolver(System.Collections.Generic.IEnumerable! buildAgents, GitVersion.Logging.ILog! log) -> void -GitVersion.Agents.BuildAgentResolver.Resolve() -> GitVersion.Agents.ICurrentBuildAgent! +GitVersion.Agents.BuildAgentBase.GenerateBuildLogOutput(GitVersion.OutputVariables.GitVersionVariables! variables) -> System.Collections.Generic.IEnumerable! GitVersion.Agents.IBuildAgent GitVersion.Agents.IBuildAgent.CanApplyToCurrentContext() -> bool GitVersion.Agents.IBuildAgent.GetCurrentBranch(bool usingDynamicRepos) -> string? GitVersion.Agents.IBuildAgent.IsDefault.get -> bool GitVersion.Agents.IBuildAgent.PreventFetch() -> bool GitVersion.Agents.IBuildAgent.ShouldCleanUpRemotes() -> bool -GitVersion.Agents.IBuildAgent.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber = true) -> void -GitVersion.Agents.IBuildAgentResolver -GitVersion.Agents.IBuildAgentResolver.Resolve() -> GitVersion.Agents.ICurrentBuildAgent! +GitVersion.Agents.IBuildAgent.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.GitVersionVariables! variables, bool updateBuildNumber = true) -> void GitVersion.Agents.ICurrentBuildAgent GitVersion.Agents.LocalBuild GitVersion.Agents.LocalBuild.LocalBuild(GitVersion.IEnvironment! environment, GitVersion.Logging.ILog! log) -> void @@ -71,9 +65,9 @@ GitVersion.CommitSortStrategies.Topological = 1 -> GitVersion.CommitSortStrategi GitVersion.Common.IRepositoryStore GitVersion.Common.IRepositoryStore.ExcludingBranches(System.Collections.Generic.IEnumerable! branchesToExclude) -> System.Collections.Generic.IEnumerable! GitVersion.Common.IRepositoryStore.FindBranch(string? branchName) -> GitVersion.IBranch? -GitVersion.Common.IRepositoryStore.FindCommitBranchesWasBranchedFrom(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, params GitVersion.IBranch![]! excludedBranches) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.FindCommitBranchesWasBranchedFrom(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, System.Collections.Generic.IEnumerable! excludedBranches) -> System.Collections.Generic.IEnumerable! GitVersion.Common.IRepositoryStore.FindCommitBranchWasBranchedFrom(GitVersion.IBranch? branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, params GitVersion.IBranch![]! excludedBranches) -> GitVersion.BranchCommit +GitVersion.Common.IRepositoryStore.FindCommitBranchesWasBranchedFrom(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, System.Collections.Generic.IEnumerable! excludedBranches) -> System.Collections.Generic.IEnumerable! +GitVersion.Common.IRepositoryStore.FindCommitBranchesWasBranchedFrom(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, params GitVersion.IBranch![]! excludedBranches) -> System.Collections.Generic.IEnumerable! GitVersion.Common.IRepositoryStore.FindMainBranch(GitVersion.Configuration.IGitVersionConfiguration! configuration) -> GitVersion.IBranch? GitVersion.Common.IRepositoryStore.FindMainlineBranches(GitVersion.Configuration.IGitVersionConfiguration! configuration) -> System.Collections.Generic.IEnumerable! GitVersion.Common.IRepositoryStore.FindMergeBase(GitVersion.IBranch? branch, GitVersion.IBranch? otherBranch) -> GitVersion.ICommit? @@ -87,52 +81,22 @@ GitVersion.Common.IRepositoryStore.GetMainlineCommitLog(GitVersion.ICommit? base GitVersion.Common.IRepositoryStore.GetMergeBaseCommits(GitVersion.ICommit? mergeCommit, GitVersion.ICommit? mergedHead, GitVersion.ICommit? findMergeBase) -> System.Collections.Generic.IEnumerable! GitVersion.Common.IRepositoryStore.GetNumberOfUncommittedChanges() -> int GitVersion.Common.IRepositoryStore.GetReleaseBranches(System.Collections.Generic.IEnumerable>! releaseBranchConfig) -> System.Collections.Generic.IEnumerable! -GitVersion.Common.IRepositoryStore.GetSourceBranches(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, params GitVersion.IBranch![]! excludedBranches) -> System.Collections.Generic.IEnumerable! GitVersion.Common.IRepositoryStore.GetSourceBranches(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, System.Collections.Generic.IEnumerable! excludedBranches) -> System.Collections.Generic.IEnumerable! +GitVersion.Common.IRepositoryStore.GetSourceBranches(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, params GitVersion.IBranch![]! excludedBranches) -> System.Collections.Generic.IEnumerable! GitVersion.Common.IRepositoryStore.GetTaggedSemanticVersions(string? labelPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IReadOnlyList! GitVersion.Common.IRepositoryStore.GetTaggedSemanticVersionsOnBranch(GitVersion.IBranch! branch, string? labelPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IReadOnlyList! GitVersion.Common.IRepositoryStore.GetTargetBranch(string? targetBranchName) -> GitVersion.IBranch! GitVersion.Common.IRepositoryStore.GetVersionTagsOnBranch(GitVersion.IBranch! branch, string? labelPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IEnumerable! GitVersion.Common.IRepositoryStore.IsCommitOnBranch(GitVersion.ICommit? baseVersionSource, GitVersion.IBranch! branch, GitVersion.ICommit! firstMatchingCommit) -> bool -GitVersion.Configuration.BranchConfiguration -GitVersion.Configuration.BranchConfiguration.CommitMessageIncrementing.get -> GitVersion.VersionCalculation.CommitMessageIncrementMode? -GitVersion.Configuration.BranchConfiguration.Increment.get -> GitVersion.IncrementStrategy -GitVersion.Configuration.BranchConfiguration.IsMainline.get -> bool? -GitVersion.Configuration.BranchConfiguration.IsReleaseBranch.get -> bool? -GitVersion.Configuration.BranchConfiguration.IsSourceBranchFor.get -> System.Collections.Generic.HashSet! -GitVersion.Configuration.BranchConfiguration.Label.get -> string? -GitVersion.Configuration.BranchConfiguration.LabelNumberPattern.get -> string? -GitVersion.Configuration.BranchConfiguration.PreReleaseWeight.get -> int? -GitVersion.Configuration.BranchConfiguration.PreventIncrementOfMergedBranchVersion.get -> bool? -GitVersion.Configuration.BranchConfiguration.RegularExpression.get -> string? -GitVersion.Configuration.BranchConfiguration.SourceBranches.get -> System.Collections.Generic.HashSet! -GitVersion.Configuration.BranchConfiguration.TrackMergeMessage.get -> bool? -GitVersion.Configuration.BranchConfiguration.TrackMergeTarget.get -> bool? -GitVersion.Configuration.BranchConfiguration.TracksReleaseBranches.get -> bool? -GitVersion.Configuration.BranchConfiguration.VersioningMode.get -> GitVersion.VersionCalculation.VersioningMode? -GitVersion.Configuration.BranchConfigurationBuilder -GitVersion.Configuration.BranchConfigurationBuilder.Build() -> GitVersion.Configuration.BranchConfiguration! -GitVersion.Configuration.ConfigurationConstants GitVersion.Configuration.ConfigurationException GitVersion.Configuration.ConfigurationException.ConfigurationException() -> void GitVersion.Configuration.ConfigurationException.ConfigurationException(string! message, System.Exception! innerException) -> void GitVersion.Configuration.ConfigurationException.ConfigurationException(string! messageFormat, params object![]! args) -> void GitVersion.Configuration.ConfigurationException.ConfigurationException(string! msg) -> void GitVersion.Configuration.ConfigurationExtensions -GitVersion.Configuration.ConfigurationFileLocator -GitVersion.Configuration.ConfigurationFileLocator.ConfigurationFileLocator(GitVersion.IFileSystem! fileSystem, Microsoft.Extensions.Options.IOptions! options) -> void -GitVersion.Configuration.ConfigurationFileLocator.ReadConfiguration(string? configFilePath) -> GitVersion.Configuration.GitVersionConfiguration! -GitVersion.Configuration.ConfigurationFileLocator.ReadOverrideConfiguration(string? configFilePath) -> System.Collections.Generic.IReadOnlyDictionary? -GitVersion.Configuration.ConfigurationFileLocator.TryGetConfigurationFile(string? workingDirectory, string? projectRootDirectory, out string? configFilePath) -> bool -GitVersion.Configuration.ConfigurationFileLocator.Verify(string? workingDirectory, string? projectRootDirectory) -> void GitVersion.Configuration.ConfigurationModule GitVersion.Configuration.ConfigurationModule.ConfigurationModule() -> void GitVersion.Configuration.ConfigurationModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -GitVersion.Configuration.ConfigurationProvider -GitVersion.Configuration.ConfigurationProvider.ConfigurationProvider(GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.IConfigurationFileLocator! configFileLocator, Microsoft.Extensions.Options.IOptions! options, GitVersion.Configuration.Init.Wizard.IConfigInitWizard! configInitWizard) -> void -GitVersion.Configuration.ConfigurationProvider.Init(string! workingDirectory) -> void -GitVersion.Configuration.ConfigurationProvider.Provide(System.Collections.Generic.IReadOnlyDictionary? overrideConfiguration) -> GitVersion.Configuration.IGitVersionConfiguration! -GitVersion.Configuration.ConfigurationSerializer GitVersion.Configuration.EffectiveBranchConfiguration GitVersion.Configuration.EffectiveBranchConfiguration.Branch.get -> GitVersion.IBranch! GitVersion.Configuration.EffectiveBranchConfiguration.CreateNextVersion(GitVersion.VersionCalculation.BaseVersion! baseVersion, GitVersion.SemanticVersion! incrementedVersion) -> GitVersion.VersionCalculation.NextVersion! @@ -171,26 +135,6 @@ GitVersion.Configuration.EffectiveConfiguration.TracksReleaseBranches.get -> boo GitVersion.Configuration.EffectiveConfiguration.UpdateBuildNumber.get -> bool GitVersion.Configuration.EffectiveConfiguration.VersionFilters.get -> System.Collections.Generic.IEnumerable! GitVersion.Configuration.EffectiveConfiguration.VersioningMode.get -> GitVersion.VersionCalculation.VersioningMode -GitVersion.Configuration.GitVersionConfiguration -GitVersion.Configuration.GitVersionConfiguration.AssemblyFileVersioningFormat.get -> string? -GitVersion.Configuration.GitVersionConfiguration.AssemblyFileVersioningScheme.get -> GitVersion.Extensions.AssemblyFileVersioningScheme? -GitVersion.Configuration.GitVersionConfiguration.AssemblyInformationalFormat.get -> string? -GitVersion.Configuration.GitVersionConfiguration.AssemblyVersioningFormat.get -> string? -GitVersion.Configuration.GitVersionConfiguration.AssemblyVersioningScheme.get -> GitVersion.Extensions.AssemblyVersioningScheme? -GitVersion.Configuration.GitVersionConfiguration.Branches.get -> System.Collections.Generic.Dictionary! -GitVersion.Configuration.GitVersionConfiguration.CommitDateFormat.get -> string? -GitVersion.Configuration.GitVersionConfiguration.Ignore.get -> GitVersion.Configuration.IgnoreConfiguration! -GitVersion.Configuration.GitVersionConfiguration.LabelPreReleaseWeight.get -> int? -GitVersion.Configuration.GitVersionConfiguration.LabelPrefix.get -> string? -GitVersion.Configuration.GitVersionConfiguration.MajorVersionBumpMessage.get -> string? -GitVersion.Configuration.GitVersionConfiguration.MergeMessageFormats.get -> System.Collections.Generic.Dictionary! -GitVersion.Configuration.GitVersionConfiguration.MinorVersionBumpMessage.get -> string? -GitVersion.Configuration.GitVersionConfiguration.NextVersion.get -> string? -GitVersion.Configuration.GitVersionConfiguration.NoBumpMessage.get -> string? -GitVersion.Configuration.GitVersionConfiguration.PatchVersionBumpMessage.get -> string? -GitVersion.Configuration.GitVersionConfiguration.SemanticVersionFormat.get -> GitVersion.SemanticVersionFormat -GitVersion.Configuration.GitVersionConfiguration.UpdateBuildNumber.get -> bool -GitVersion.Configuration.GitVersionConfiguration.Workflow.get -> string? GitVersion.Configuration.IBranchConfiguration GitVersion.Configuration.IBranchConfiguration.CommitMessageIncrementing.get -> GitVersion.VersionCalculation.CommitMessageIncrementMode? GitVersion.Configuration.IBranchConfiguration.Increment.get -> GitVersion.IncrementStrategy @@ -210,7 +154,7 @@ GitVersion.Configuration.IBranchConfiguration.TrackMergeTarget.get -> bool? GitVersion.Configuration.IBranchConfiguration.TracksReleaseBranches.get -> bool? GitVersion.Configuration.IBranchConfiguration.VersioningMode.get -> GitVersion.VersionCalculation.VersioningMode? GitVersion.Configuration.IConfigurationFileLocator -GitVersion.Configuration.IConfigurationFileLocator.ReadConfiguration(string? configFilePath) -> GitVersion.Configuration.GitVersionConfiguration! +GitVersion.Configuration.IConfigurationFileLocator.ReadConfiguration(string? configFilePath) -> GitVersion.Configuration.IGitVersionConfiguration! GitVersion.Configuration.IConfigurationFileLocator.ReadOverrideConfiguration(string? configFilePath) -> System.Collections.Generic.IReadOnlyDictionary? GitVersion.Configuration.IConfigurationFileLocator.TryGetConfigurationFile(string? workingDirectory, string? projectRootDirectory, out string? configFilePath) -> bool GitVersion.Configuration.IConfigurationFileLocator.Verify(string? workingDirectory, string? projectRootDirectory) -> void @@ -226,8 +170,8 @@ GitVersion.Configuration.IGitVersionConfiguration.AssemblyVersioningScheme.get - GitVersion.Configuration.IGitVersionConfiguration.Branches.get -> System.Collections.Generic.IReadOnlyDictionary! GitVersion.Configuration.IGitVersionConfiguration.CommitDateFormat.get -> string? GitVersion.Configuration.IGitVersionConfiguration.Ignore.get -> GitVersion.Configuration.IIgnoreConfiguration! -GitVersion.Configuration.IGitVersionConfiguration.LabelPrefix.get -> string? GitVersion.Configuration.IGitVersionConfiguration.LabelPreReleaseWeight.get -> int? +GitVersion.Configuration.IGitVersionConfiguration.LabelPrefix.get -> string? GitVersion.Configuration.IGitVersionConfiguration.MajorVersionBumpMessage.get -> string? GitVersion.Configuration.IGitVersionConfiguration.MergeMessageFormats.get -> System.Collections.Generic.IReadOnlyDictionary! GitVersion.Configuration.IGitVersionConfiguration.MinorVersionBumpMessage.get -> string? @@ -237,79 +181,18 @@ GitVersion.Configuration.IGitVersionConfiguration.PatchVersionBumpMessage.get -> GitVersion.Configuration.IGitVersionConfiguration.SemanticVersionFormat.get -> GitVersion.SemanticVersionFormat GitVersion.Configuration.IGitVersionConfiguration.UpdateBuildNumber.get -> bool GitVersion.Configuration.IGitVersionConfiguration.Workflow.get -> string? -GitVersion.Configuration.IgnoreConfiguration -GitVersion.Configuration.IgnoreConfiguration.Before.get -> System.DateTimeOffset? -GitVersion.Configuration.IgnoreConfiguration.Before.init -> void -GitVersion.Configuration.IgnoreConfiguration.Shas.get -> System.Collections.Generic.HashSet! -GitVersion.Configuration.IgnoreConfiguration.Shas.init -> void -GitVersion.Configuration.IgnoreConfigurationExtensions GitVersion.Configuration.IIgnoreConfiguration GitVersion.Configuration.IIgnoreConfiguration.Before.get -> System.DateTimeOffset? GitVersion.Configuration.IIgnoreConfiguration.IsEmpty.get -> bool GitVersion.Configuration.IIgnoreConfiguration.Shas.get -> System.Collections.Generic.IReadOnlyCollection! -GitVersion.Configuration.Init.EditConfigStep -GitVersion.Configuration.Init.EditConfigStep.EditConfigStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void GitVersion.Configuration.Init.GitVersionInitModule GitVersion.Configuration.Init.GitVersionInitModule.GitVersionInitModule() -> void -GitVersion.Configuration.Init.SetConfig.AssemblyVersioningSchemeSetting -GitVersion.Configuration.Init.SetConfig.AssemblyVersioningSchemeSetting.AssemblyVersioningSchemeSetting(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.ConfigureBranch -GitVersion.Configuration.Init.SetConfig.ConfigureBranch.ConfigureBranch(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.ConfigureBranch.WithData(string! configName, GitVersion.Configuration.BranchConfiguration! configuration) -> GitVersion.Configuration.Init.SetConfig.ConfigureBranch! -GitVersion.Configuration.Init.SetConfig.ConfigureBranches -GitVersion.Configuration.Init.SetConfig.ConfigureBranches.ConfigureBranches(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.GlobalModeSetting -GitVersion.Configuration.Init.SetConfig.GlobalModeSetting.GlobalModeSetting(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.GlobalModeSetting.WithData(GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep! returnStep, bool isPartOfTheWizard) -> GitVersion.Configuration.Init.SetConfig.GlobalModeSetting! -GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode -GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode.SetBranchIncrementMode(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode.WithData(string! configName, GitVersion.Configuration.BranchConfiguration! configuration) -> GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode! -GitVersion.Configuration.Init.SetConfig.SetBranchTag -GitVersion.Configuration.Init.SetConfig.SetBranchTag.SetBranchTag(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.SetConfig.SetBranchTag.WithData(string! configName, GitVersion.Configuration.BranchConfiguration! configuration) -> GitVersion.Configuration.Init.SetConfig.SetBranchTag! -GitVersion.Configuration.Init.SetNextVersion -GitVersion.Configuration.Init.SetNextVersion.SetNextVersion(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.StepResult -GitVersion.Configuration.Init.StepResult.Exit.get -> bool -GitVersion.Configuration.Init.StepResult.InvalidResponse.get -> bool -GitVersion.Configuration.Init.StepResult.Save.get -> bool -GitVersion.Configuration.Init.Wizard.ConfigInitStepFactory -GitVersion.Configuration.Init.Wizard.ConfigInitStepFactory.ConfigInitStepFactory() -> void -GitVersion.Configuration.Init.Wizard.ConfigInitStepFactory.ConfigInitStepFactory(System.IServiceProvider! sp) -> void -GitVersion.Configuration.Init.Wizard.ConfigInitStepFactory.CreateStep() -> T -GitVersion.Configuration.Init.Wizard.ConfigInitWizard -GitVersion.Configuration.Init.Wizard.ConfigInitWizard.ConfigInitWizard(GitVersion.Logging.IConsole! console, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.ConfigInitWizard.Run(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.GitVersionConfiguration? -GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep -GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.Apply(System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> bool -GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.ConfigInitWizardStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.FinishedSetupStep -GitVersion.Configuration.Init.Wizard.FinishedSetupStep.FinishedSetupStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.GitFlowSetupStep -GitVersion.Configuration.Init.Wizard.GitFlowSetupStep.GitFlowSetupStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.GitHubFlowStep -GitVersion.Configuration.Init.Wizard.GitHubFlowStep.GitHubFlowStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory -GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory.CreateStep() -> T -GitVersion.Configuration.Init.Wizard.IConfigInitWizard -GitVersion.Configuration.Init.Wizard.IConfigInitWizard.Run(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.GitVersionConfiguration? -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy1Step -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy1Step.PickBranchingStrategy1Step(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy2Step -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy2Step.PickBranchingStrategy2Step(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step -GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step.PickBranchingStrategy3Step(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void -GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep -GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep.PickBranchingStrategyStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void +GitVersion.Configuration.Init.GitVersionInitModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void GitVersion.ConfigurationInfo GitVersion.ConfigurationInfo.ConfigurationFile -> string? GitVersion.ConfigurationInfo.ConfigurationInfo() -> void GitVersion.ConfigurationInfo.OverrideConfiguration -> System.Collections.Generic.IReadOnlyDictionary? GitVersion.ConfigurationInfo.ShowConfiguration -> bool -GitVersion.Environment -GitVersion.Environment.Environment() -> void -GitVersion.Environment.GetEnvironmentVariable(string! variableName) -> string? -GitVersion.Environment.SetEnvironmentVariable(string! variableName, string? value) -> void GitVersion.Extensions.AssemblyFileVersioningScheme GitVersion.Extensions.AssemblyFileVersioningScheme.Major = 3 -> GitVersion.Extensions.AssemblyFileVersioningScheme GitVersion.Extensions.AssemblyFileVersioningScheme.MajorMinor = 2 -> GitVersion.Extensions.AssemblyFileVersioningScheme @@ -331,39 +214,16 @@ GitVersion.Extensions.ObjectExtensions GitVersion.Extensions.ReadEmbeddedResourceExtensions GitVersion.Extensions.ServiceCollectionExtensions GitVersion.Extensions.StringExtensions -GitVersion.FileSystem -GitVersion.FileSystem.Copy(string! from, string! to, bool overwrite) -> void -GitVersion.FileSystem.CreateDirectory(string! path) -> void -GitVersion.FileSystem.Delete(string! path) -> void -GitVersion.FileSystem.DirectoryEnumerateFiles(string? directory, string! searchPattern, System.IO.SearchOption searchOption) -> System.Collections.Generic.IEnumerable! -GitVersion.FileSystem.DirectoryExists(string! path) -> bool -GitVersion.FileSystem.Exists(string! file) -> bool -GitVersion.FileSystem.FileSystem() -> void -GitVersion.FileSystem.GetLastDirectoryWrite(string! path) -> long -GitVersion.FileSystem.Move(string! from, string! to) -> void -GitVersion.FileSystem.OpenRead(string! path) -> System.IO.Stream! -GitVersion.FileSystem.OpenWrite(string! path) -> System.IO.Stream! -GitVersion.FileSystem.PathsEqual(string? path, string? otherPath) -> bool -GitVersion.FileSystem.ReadAllText(string! path) -> string! -GitVersion.FileSystem.WriteAllText(string? file, string! fileContents) -> void -GitVersion.FileSystem.WriteAllText(string? file, string! fileContents, System.Text.Encoding! encoding) -> void GitVersion.FileWriteInfo GitVersion.FileWriteInfo.FileExtension.get -> string! GitVersion.FileWriteInfo.FileName.get -> string! GitVersion.FileWriteInfo.FileWriteInfo(string! workingDirectory, string! fileName, string! fileExtension) -> void GitVersion.FileWriteInfo.WorkingDirectory.get -> string! -GitVersion.GitPreparer -GitVersion.GitPreparer.EnsureLocalBranchExistsForCurrentBranch(GitVersion.IRemote? remote, string? currentBranch) -> void -GitVersion.GitPreparer.GitPreparer(GitVersion.Logging.ILog! log, GitVersion.IEnvironment! environment, GitVersion.Agents.ICurrentBuildAgent! buildAgent, Microsoft.Extensions.Options.IOptions! options, GitVersion.IMutatingGitRepository! repository, GitVersion.IGitRepositoryInfo! repositoryInfo, System.Lazy! versionContext) -> void -GitVersion.GitPreparer.Prepare() -> void GitVersion.GitToolsException GitVersion.GitToolsException.GitToolsException() -> void GitVersion.GitToolsException.GitToolsException(string! message, System.Exception! innerException) -> void GitVersion.GitToolsException.GitToolsException(string! messageFormat, params object![]! args) -> void GitVersion.GitToolsException.GitToolsException(string? message) -> void -GitVersion.GitVersionCalculateTool -GitVersion.GitVersionCalculateTool.CalculateVersionVariables() -> GitVersion.OutputVariables.VersionVariables! -GitVersion.GitVersionCalculateTool.GitVersionCalculateTool(GitVersion.Logging.ILog! log, GitVersion.VersionCalculation.INextVersionCalculator! nextVersionCalculator, GitVersion.VersionCalculation.IVariableProvider! variableProvider, GitVersion.IGitPreparer! gitPreparer, GitVersion.VersionCalculation.Caching.IGitVersionCache! gitVersionCache, GitVersion.VersionCalculation.Caching.IGitVersionCacheKeyFactory! cacheKeyFactory, Microsoft.Extensions.Options.IOptions! options, System.Lazy! versionContext) -> void GitVersion.GitVersionCommonModule GitVersion.GitVersionCommonModule.GitVersionCommonModule() -> void GitVersion.GitVersionCommonModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void @@ -375,9 +235,6 @@ GitVersion.GitVersionContext.CurrentCommitTaggedVersion.get -> GitVersion.Semant GitVersion.GitVersionContext.GitVersionContext(GitVersion.IBranch! currentBranch, GitVersion.ICommit? currentCommit, GitVersion.Configuration.IGitVersionConfiguration! configuration, GitVersion.SemanticVersion? currentCommitTaggedVersion, int numberOfUncommittedChanges) -> void GitVersion.GitVersionContext.IsCurrentCommitTagged.get -> bool GitVersion.GitVersionContext.NumberOfUncommittedChanges.get -> int -GitVersion.GitVersionContextFactory -GitVersion.GitVersionContextFactory.Create(GitVersion.GitVersionOptions! gitVersionOptions) -> GitVersion.GitVersionContext! -GitVersion.GitVersionContextFactory.GitVersionContextFactory(GitVersion.Configuration.IConfigurationProvider! configurationProvider, GitVersion.Common.IRepositoryStore! repositoryStore, Microsoft.Extensions.Options.IOptions! options) -> void GitVersion.GitVersionCoreModule GitVersion.GitVersionCoreModule.GitVersionCoreModule() -> void GitVersion.GitVersionCoreModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void @@ -386,8 +243,6 @@ GitVersion.GitVersionException.GitVersionException() -> void GitVersion.GitVersionException.GitVersionException(string! message) -> void GitVersion.GitVersionException.GitVersionException(string! message, System.Exception! innerException) -> void GitVersion.GitVersionException.GitVersionException(string! messageFormat, params object![]! args) -> void -GitVersion.GitVersionModule -GitVersion.GitVersionModule.GitVersionModule() -> void GitVersion.GitVersionOptions GitVersion.GitVersionOptions.AssemblySettingsInfo.get -> GitVersion.AssemblySettingsInfo! GitVersion.GitVersionOptions.AuthenticationInfo.get -> GitVersion.AuthenticationInfo! @@ -487,16 +342,12 @@ GitVersion.IGitRepositoryInfo.DynamicGitRepositoryPath.get -> string? GitVersion.IGitRepositoryInfo.GitRootPath.get -> string? GitVersion.IGitRepositoryInfo.ProjectRootDirectory.get -> string? GitVersion.IGitVersionCalculateTool -GitVersion.IGitVersionCalculateTool.CalculateVersionVariables() -> GitVersion.OutputVariables.VersionVariables! +GitVersion.IGitVersionCalculateTool.CalculateVersionVariables() -> GitVersion.OutputVariables.GitVersionVariables! GitVersion.IGitVersionContextFactory GitVersion.IGitVersionContextFactory.Create(GitVersion.GitVersionOptions! gitVersionOptions) -> GitVersion.GitVersionContext! GitVersion.IGitVersionModule +GitVersion.IGitVersionModule.FindAllDerivedTypes(System.Reflection.Assembly? assembly) -> System.Collections.Generic.IEnumerable! GitVersion.IGitVersionModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -GitVersion.IGitVersionOutputTool -GitVersion.IGitVersionOutputTool.GenerateGitVersionInformation(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.FileWriteInfo! fileWriteInfo) -> void -GitVersion.IGitVersionOutputTool.OutputVariables(GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber) -> void -GitVersion.IGitVersionOutputTool.UpdateAssemblyInfo(GitVersion.OutputVariables.VersionVariables! variables) -> void -GitVersion.IGitVersionOutputTool.UpdateWixVersionFile(GitVersion.OutputVariables.VersionVariables! variables) -> void GitVersion.IMutatingGitRepository GitVersion.IMutatingGitRepository.Checkout(string! commitOrBranchSpec) -> void GitVersion.IMutatingGitRepository.Clone(string? sourceUrl, string? workdirPath, GitVersion.AuthenticationInfo! auth) -> void @@ -538,7 +389,7 @@ GitVersion.ITag.Commit.get -> GitVersion.ICommit! GitVersion.ITag.TargetSha.get -> string? GitVersion.ITagCollection GitVersion.IVersionConverter -GitVersion.IVersionConverter.Execute(GitVersion.OutputVariables.VersionVariables! variables, T context) -> void +GitVersion.IVersionConverter.Execute(GitVersion.OutputVariables.GitVersionVariables! variables, T context) -> void GitVersion.IncrementStrategy GitVersion.IncrementStrategy.Inherit = 4 -> GitVersion.IncrementStrategy GitVersion.IncrementStrategy.Major = 1 -> GitVersion.IncrementStrategy @@ -551,20 +402,7 @@ GitVersion.LockedFileException.LockedFileException() -> void GitVersion.LockedFileException.LockedFileException(System.Exception! inner) -> void GitVersion.LockedFileException.LockedFileException(string? message) -> void GitVersion.LockedFileException.LockedFileException(string? message, System.Exception? innerException) -> void -GitVersion.Logging.ConsoleAdapter -GitVersion.Logging.ConsoleAdapter.ConsoleAdapter() -> void -GitVersion.Logging.ConsoleAdapter.ReadLine() -> string? -GitVersion.Logging.ConsoleAdapter.UseColor(System.ConsoleColor consoleColor) -> System.IDisposable! -GitVersion.Logging.ConsoleAdapter.Write(string? msg) -> void -GitVersion.Logging.ConsoleAdapter.WriteLine() -> void -GitVersion.Logging.ConsoleAdapter.WriteLine(string? msg) -> void -GitVersion.Logging.ConsoleAppender -GitVersion.Logging.ConsoleAppender.ConsoleAppender() -> void -GitVersion.Logging.ConsoleAppender.WriteTo(GitVersion.Logging.LogLevel level, string! message) -> void GitVersion.Logging.Disposable -GitVersion.Logging.FileAppender -GitVersion.Logging.FileAppender.FileAppender(string! filePath) -> void -GitVersion.Logging.FileAppender.WriteTo(GitVersion.Logging.LogLevel level, string! message) -> void GitVersion.Logging.IConsole GitVersion.Logging.IConsole.ReadLine() -> string? GitVersion.Logging.IConsole.UseColor(System.ConsoleColor consoleColor) -> System.IDisposable! @@ -579,14 +417,6 @@ GitVersion.Logging.ILog.Verbosity.set -> void GitVersion.Logging.ILog.Write(GitVersion.Logging.Verbosity verbosity, GitVersion.Logging.LogLevel level, string! format, params object![]! args) -> void GitVersion.Logging.ILogAppender GitVersion.Logging.ILogAppender.WriteTo(GitVersion.Logging.LogLevel level, string! message) -> void -GitVersion.Logging.Log -GitVersion.Logging.Log.AddLogAppender(GitVersion.Logging.ILogAppender! logAppender) -> void -GitVersion.Logging.Log.IndentLog(string! operationDescription) -> System.IDisposable! -GitVersion.Logging.Log.Log() -> void -GitVersion.Logging.Log.Log(params GitVersion.Logging.ILogAppender![]! appenders) -> void -GitVersion.Logging.Log.Verbosity.get -> GitVersion.Logging.Verbosity -GitVersion.Logging.Log.Verbosity.set -> void -GitVersion.Logging.Log.Write(GitVersion.Logging.Verbosity verbosity, GitVersion.Logging.LogLevel level, string! format, params object![]! args) -> void GitVersion.Logging.LogAction GitVersion.Logging.LogActionEntry GitVersion.Logging.LogExtensions @@ -597,15 +427,6 @@ GitVersion.Logging.LogLevel.Fatal = 0 -> GitVersion.Logging.LogLevel GitVersion.Logging.LogLevel.Info = 3 -> GitVersion.Logging.LogLevel GitVersion.Logging.LogLevel.Verbose = 4 -> GitVersion.Logging.LogLevel GitVersion.Logging.LogLevel.Warn = 2 -> GitVersion.Logging.LogLevel -GitVersion.Logging.NullLog -GitVersion.Logging.NullLog.AddLogAppender(GitVersion.Logging.ILogAppender! logAppender) -> void -GitVersion.Logging.NullLog.Indent.get -> string? -GitVersion.Logging.NullLog.Indent.set -> void -GitVersion.Logging.NullLog.IndentLog(string! operationDescription) -> System.IDisposable! -GitVersion.Logging.NullLog.NullLog() -> void -GitVersion.Logging.NullLog.Verbosity.get -> GitVersion.Logging.Verbosity -GitVersion.Logging.NullLog.Verbosity.set -> void -GitVersion.Logging.NullLog.Write(GitVersion.Logging.Verbosity verbosity, GitVersion.Logging.LogLevel level, string! format, params object![]! args) -> void GitVersion.Logging.Verbosity GitVersion.Logging.Verbosity.Diagnostic = 4 -> GitVersion.Logging.Verbosity GitVersion.Logging.Verbosity.Minimal = 1 -> GitVersion.Logging.Verbosity @@ -615,8 +436,8 @@ GitVersion.Logging.Verbosity.Verbose = 3 -> GitVersion.Logging.Verbosity GitVersion.MergeMessage GitVersion.MergeMessage.FormatName.get -> string? GitVersion.MergeMessage.IsMergedPullRequest.get -> bool -GitVersion.MergeMessage.MergedBranch.get -> GitVersion.ReferenceName? GitVersion.MergeMessage.MergeMessage(string! mergeMessage, GitVersion.Configuration.IGitVersionConfiguration! configuration) -> void +GitVersion.MergeMessage.MergedBranch.get -> GitVersion.ReferenceName? GitVersion.MergeMessage.PullRequestNumber.get -> int? GitVersion.MergeMessage.TargetBranch.get -> string? GitVersion.MergeMessage.Version.get -> GitVersion.SemanticVersion? @@ -624,39 +445,61 @@ GitVersion.OutputType GitVersion.OutputType.BuildServer = 0 -> GitVersion.OutputType GitVersion.OutputType.File = 2 -> GitVersion.OutputType GitVersion.OutputType.Json = 1 -> GitVersion.OutputType -GitVersion.OutputVariables.VersionVariables -GitVersion.OutputVariables.VersionVariables.AssemblySemFileVer.get -> string? -GitVersion.OutputVariables.VersionVariables.AssemblySemVer.get -> string? -GitVersion.OutputVariables.VersionVariables.BranchName.get -> string? -GitVersion.OutputVariables.VersionVariables.BuildMetaData.get -> string? -GitVersion.OutputVariables.VersionVariables.CommitDate.get -> string? -GitVersion.OutputVariables.VersionVariables.CommitDate.set -> void -GitVersion.OutputVariables.VersionVariables.CommitsSinceVersionSource.get -> string? -GitVersion.OutputVariables.VersionVariables.EscapedBranchName.get -> string? -GitVersion.OutputVariables.VersionVariables.FileName.get -> string? -GitVersion.OutputVariables.VersionVariables.FileName.set -> void -GitVersion.OutputVariables.VersionVariables.FullBuildMetaData.get -> string? -GitVersion.OutputVariables.VersionVariables.FullSemVer.get -> string! -GitVersion.OutputVariables.VersionVariables.GetEnumerator() -> System.Collections.Generic.IEnumerator>! -GitVersion.OutputVariables.VersionVariables.InformationalVersion.get -> string? -GitVersion.OutputVariables.VersionVariables.Major.get -> string! -GitVersion.OutputVariables.VersionVariables.MajorMinorPatch.get -> string! -GitVersion.OutputVariables.VersionVariables.Minor.get -> string! -GitVersion.OutputVariables.VersionVariables.Patch.get -> string! -GitVersion.OutputVariables.VersionVariables.PreReleaseLabel.get -> string? -GitVersion.OutputVariables.VersionVariables.PreReleaseLabelWithDash.get -> string? -GitVersion.OutputVariables.VersionVariables.PreReleaseNumber.get -> string? -GitVersion.OutputVariables.VersionVariables.PreReleaseTag.get -> string? -GitVersion.OutputVariables.VersionVariables.PreReleaseTagWithDash.get -> string? -GitVersion.OutputVariables.VersionVariables.SemVer.get -> string! -GitVersion.OutputVariables.VersionVariables.Sha.get -> string? -GitVersion.OutputVariables.VersionVariables.ShortSha.get -> string? -GitVersion.OutputVariables.VersionVariables.TryGetValue(string! variable, out string? variableValue) -> bool -GitVersion.OutputVariables.VersionVariables.UncommittedChanges.get -> string? -GitVersion.OutputVariables.VersionVariables.VersionSourceSha.get -> string? -GitVersion.OutputVariables.VersionVariables.VersionVariables(string! major, string! minor, string! patch, string? buildMetaData, string? fullBuildMetaData, string? branchName, string? escapedBranchName, string? sha, string? shortSha, string! majorMinorPatch, string! semVer, string! fullSemVer, string? assemblySemVer, string? assemblySemFileVer, string? preReleaseTag, string? preReleaseTagWithDash, string? preReleaseLabel, string? preReleaseLabelWithDash, string? preReleaseNumber, string! weightedPreReleaseNumber, string? informationalVersion, string? commitDate, string? versionSourceSha, string? commitsSinceVersionSource, string? uncommittedChanges) -> void -GitVersion.OutputVariables.VersionVariables.WeightedPreReleaseNumber.get -> string! -GitVersion.OutputVariables.VersionVariables.this[string! variable].get -> string? +GitVersion.OutputVariables.GitVersionVariables +GitVersion.OutputVariables.GitVersionVariables.AssemblySemFileVer.get -> string? +GitVersion.OutputVariables.GitVersionVariables.AssemblySemFileVer.init -> void +GitVersion.OutputVariables.GitVersionVariables.AssemblySemVer.get -> string? +GitVersion.OutputVariables.GitVersionVariables.AssemblySemVer.init -> void +GitVersion.OutputVariables.GitVersionVariables.BranchName.get -> string? +GitVersion.OutputVariables.GitVersionVariables.BranchName.init -> void +GitVersion.OutputVariables.GitVersionVariables.BuildMetaData.get -> string? +GitVersion.OutputVariables.GitVersionVariables.BuildMetaData.init -> void +GitVersion.OutputVariables.GitVersionVariables.CommitDate.get -> string? +GitVersion.OutputVariables.GitVersionVariables.CommitDate.init -> void +GitVersion.OutputVariables.GitVersionVariables.CommitsSinceVersionSource.get -> string? +GitVersion.OutputVariables.GitVersionVariables.CommitsSinceVersionSource.init -> void +GitVersion.OutputVariables.GitVersionVariables.EscapedBranchName.get -> string? +GitVersion.OutputVariables.GitVersionVariables.EscapedBranchName.init -> void +GitVersion.OutputVariables.GitVersionVariables.FullBuildMetaData.get -> string? +GitVersion.OutputVariables.GitVersionVariables.FullBuildMetaData.init -> void +GitVersion.OutputVariables.GitVersionVariables.FullSemVer.get -> string! +GitVersion.OutputVariables.GitVersionVariables.FullSemVer.init -> void +GitVersion.OutputVariables.GitVersionVariables.GetEnumerator() -> System.Collections.Generic.IEnumerator>! +GitVersion.OutputVariables.GitVersionVariables.GitVersionVariables(string! Major, string! Minor, string! Patch, string? BuildMetaData, string? FullBuildMetaData, string? BranchName, string? EscapedBranchName, string? Sha, string? ShortSha, string! MajorMinorPatch, string! SemVer, string! FullSemVer, string? AssemblySemVer, string? AssemblySemFileVer, string? PreReleaseTag, string? PreReleaseTagWithDash, string? PreReleaseLabel, string? PreReleaseLabelWithDash, string? PreReleaseNumber, string! WeightedPreReleaseNumber, string? InformationalVersion, string? CommitDate, string? VersionSourceSha, string? CommitsSinceVersionSource, string? UncommittedChanges) -> void +GitVersion.OutputVariables.GitVersionVariables.InformationalVersion.get -> string? +GitVersion.OutputVariables.GitVersionVariables.InformationalVersion.init -> void +GitVersion.OutputVariables.GitVersionVariables.Major.get -> string! +GitVersion.OutputVariables.GitVersionVariables.Major.init -> void +GitVersion.OutputVariables.GitVersionVariables.MajorMinorPatch.get -> string! +GitVersion.OutputVariables.GitVersionVariables.MajorMinorPatch.init -> void +GitVersion.OutputVariables.GitVersionVariables.Minor.get -> string! +GitVersion.OutputVariables.GitVersionVariables.Minor.init -> void +GitVersion.OutputVariables.GitVersionVariables.Patch.get -> string! +GitVersion.OutputVariables.GitVersionVariables.Patch.init -> void +GitVersion.OutputVariables.GitVersionVariables.PreReleaseLabel.get -> string? +GitVersion.OutputVariables.GitVersionVariables.PreReleaseLabel.init -> void +GitVersion.OutputVariables.GitVersionVariables.PreReleaseLabelWithDash.get -> string? +GitVersion.OutputVariables.GitVersionVariables.PreReleaseLabelWithDash.init -> void +GitVersion.OutputVariables.GitVersionVariables.PreReleaseNumber.get -> string? +GitVersion.OutputVariables.GitVersionVariables.PreReleaseNumber.init -> void +GitVersion.OutputVariables.GitVersionVariables.PreReleaseTag.get -> string? +GitVersion.OutputVariables.GitVersionVariables.PreReleaseTag.init -> void +GitVersion.OutputVariables.GitVersionVariables.PreReleaseTagWithDash.get -> string? +GitVersion.OutputVariables.GitVersionVariables.PreReleaseTagWithDash.init -> void +GitVersion.OutputVariables.GitVersionVariables.SemVer.get -> string! +GitVersion.OutputVariables.GitVersionVariables.SemVer.init -> void +GitVersion.OutputVariables.GitVersionVariables.Sha.get -> string? +GitVersion.OutputVariables.GitVersionVariables.Sha.init -> void +GitVersion.OutputVariables.GitVersionVariables.ShortSha.get -> string? +GitVersion.OutputVariables.GitVersionVariables.ShortSha.init -> void +GitVersion.OutputVariables.GitVersionVariables.TryGetValue(string! variable, out string? variableValue) -> bool +GitVersion.OutputVariables.GitVersionVariables.UncommittedChanges.get -> string? +GitVersion.OutputVariables.GitVersionVariables.UncommittedChanges.init -> void +GitVersion.OutputVariables.GitVersionVariables.VersionSourceSha.get -> string? +GitVersion.OutputVariables.GitVersionVariables.VersionSourceSha.init -> void +GitVersion.OutputVariables.GitVersionVariables.WeightedPreReleaseNumber.get -> string! +GitVersion.OutputVariables.GitVersionVariables.WeightedPreReleaseNumber.init -> void +GitVersion.OutputVariables.VersionVariablesHelper GitVersion.OutputVariables.VersionVariablesJsonModel GitVersion.OutputVariables.VersionVariablesJsonModel.AssemblySemFileVer.get -> string? GitVersion.OutputVariables.VersionVariablesJsonModel.AssemblySemFileVer.set -> void @@ -732,33 +575,6 @@ GitVersion.RepositoryInfo.CommitId -> string? GitVersion.RepositoryInfo.RepositoryInfo() -> void GitVersion.RepositoryInfo.TargetBranch -> string? GitVersion.RepositoryInfo.TargetUrl -> string? -GitVersion.RepositoryStore -GitVersion.RepositoryStore.ExcludingBranches(System.Collections.Generic.IEnumerable! branchesToExclude) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.FindBranch(string? branchName) -> GitVersion.IBranch? -GitVersion.RepositoryStore.FindCommitBranchesWasBranchedFrom(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, params GitVersion.IBranch![]! excludedBranches) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.FindCommitBranchesWasBranchedFrom(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, System.Collections.Generic.IEnumerable! excludedBranches) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.FindCommitBranchWasBranchedFrom(GitVersion.IBranch? branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, params GitVersion.IBranch![]! excludedBranches) -> GitVersion.BranchCommit -GitVersion.RepositoryStore.FindMainBranch(GitVersion.Configuration.IGitVersionConfiguration! configuration) -> GitVersion.IBranch? -GitVersion.RepositoryStore.FindMainlineBranches(GitVersion.Configuration.IGitVersionConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.FindMergeBase(GitVersion.IBranch? branch, GitVersion.IBranch? otherBranch) -> GitVersion.ICommit? -GitVersion.RepositoryStore.FindMergeBase(GitVersion.ICommit! commit, GitVersion.ICommit! mainlineTip) -> GitVersion.ICommit? -GitVersion.RepositoryStore.GetBranchesContainingCommit(GitVersion.ICommit? commit, System.Collections.Generic.IEnumerable? branches = null, bool onlyTrackedBranches = false) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetCommitLog(GitVersion.ICommit? baseVersionSource, GitVersion.ICommit? currentCommit) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetCurrentCommit(GitVersion.IBranch! currentBranch, string? commitId) -> GitVersion.ICommit? -GitVersion.RepositoryStore.GetCurrentCommitTaggedVersion(GitVersion.ICommit? commit, string? tagPrefix, GitVersion.SemanticVersionFormat format, bool handleDetachedBranch) -> GitVersion.SemanticVersion? -GitVersion.RepositoryStore.GetMainlineBranches(GitVersion.ICommit! commit, GitVersion.Configuration.IGitVersionConfiguration! configuration) -> System.Collections.Generic.IDictionary!>! -GitVersion.RepositoryStore.GetMainlineCommitLog(GitVersion.ICommit? baseVersionSource, GitVersion.ICommit? mainlineTip) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetMergeBaseCommits(GitVersion.ICommit? mergeCommit, GitVersion.ICommit? mergedHead, GitVersion.ICommit? findMergeBase) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetNumberOfUncommittedChanges() -> int -GitVersion.RepositoryStore.GetReleaseBranches(System.Collections.Generic.IEnumerable>! releaseBranchConfig) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetSourceBranches(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, params GitVersion.IBranch![]! excludedBranches) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetSourceBranches(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration, System.Collections.Generic.IEnumerable! excludedBranches) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.GetTaggedSemanticVersions(string? labelPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IReadOnlyList! -GitVersion.RepositoryStore.GetTaggedSemanticVersionsOnBranch(GitVersion.IBranch! branch, string? labelPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IReadOnlyList! -GitVersion.RepositoryStore.GetTargetBranch(string? targetBranchName) -> GitVersion.IBranch! -GitVersion.RepositoryStore.GetVersionTagsOnBranch(GitVersion.IBranch! branch, string? labelPrefix, GitVersion.SemanticVersionFormat format) -> System.Collections.Generic.IEnumerable! -GitVersion.RepositoryStore.IsCommitOnBranch(GitVersion.ICommit? baseVersionSource, GitVersion.IBranch! branch, GitVersion.ICommit! firstMatchingCommit) -> bool -GitVersion.RepositoryStore.RepositoryStore(GitVersion.Logging.ILog! log, GitVersion.IGitRepository! repository) -> void GitVersion.SemanticVersion GitVersion.SemanticVersion.BuildMetaData.get -> GitVersion.SemanticVersionBuildMetaData! GitVersion.SemanticVersion.BuildMetaData.init -> void @@ -878,29 +694,22 @@ GitVersion.VersionCalculation.BaseVersion.Source.get -> string! GitVersion.VersionCalculation.BaseVersion.Source.init -> void GitVersion.VersionCalculation.Caching.GitVersionCache GitVersion.VersionCalculation.Caching.GitVersionCache.GetCacheDirectory() -> string! +GitVersion.VersionCalculation.Caching.GitVersionCache.GetCacheFileName(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! cacheKey) -> string! GitVersion.VersionCalculation.Caching.GitVersionCache.GitVersionCache(GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.IGitRepositoryInfo! repositoryInfo) -> void -GitVersion.VersionCalculation.Caching.GitVersionCache.LoadVersionVariablesFromDiskCache(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! key) -> GitVersion.OutputVariables.VersionVariables? -GitVersion.VersionCalculation.Caching.GitVersionCache.WriteVariablesToDiskCache(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! cacheKey, GitVersion.OutputVariables.VersionVariables! variablesFromCache) -> void +GitVersion.VersionCalculation.Caching.GitVersionCache.LoadVersionVariablesFromDiskCache(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! key) -> GitVersion.OutputVariables.GitVersionVariables? +GitVersion.VersionCalculation.Caching.GitVersionCache.WriteVariablesToDiskCache(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! cacheKey, GitVersion.OutputVariables.GitVersionVariables! variablesFromCache) -> void GitVersion.VersionCalculation.Caching.GitVersionCacheKey GitVersion.VersionCalculation.Caching.GitVersionCacheKey.GitVersionCacheKey(string! value) -> void GitVersion.VersionCalculation.Caching.GitVersionCacheKey.Value.get -> string! -GitVersion.VersionCalculation.Caching.GitVersionCacheKeyFactory -GitVersion.VersionCalculation.Caching.GitVersionCacheKeyFactory.Create(System.Collections.Generic.IReadOnlyDictionary? overrideConfiguration) -> GitVersion.VersionCalculation.Caching.GitVersionCacheKey! -GitVersion.VersionCalculation.Caching.GitVersionCacheKeyFactory.GitVersionCacheKeyFactory(GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, Microsoft.Extensions.Options.IOptions! options, GitVersion.Configuration.IConfigurationFileLocator! configFileLocator, GitVersion.IGitRepository! gitRepository, GitVersion.IGitRepositoryInfo! repositoryInfo) -> void GitVersion.VersionCalculation.Caching.IGitVersionCache GitVersion.VersionCalculation.Caching.IGitVersionCache.GetCacheDirectory() -> string! -GitVersion.VersionCalculation.Caching.IGitVersionCache.LoadVersionVariablesFromDiskCache(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! key) -> GitVersion.OutputVariables.VersionVariables? -GitVersion.VersionCalculation.Caching.IGitVersionCache.WriteVariablesToDiskCache(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! cacheKey, GitVersion.OutputVariables.VersionVariables! variablesFromCache) -> void -GitVersion.VersionCalculation.Caching.IGitVersionCacheKeyFactory -GitVersion.VersionCalculation.Caching.IGitVersionCacheKeyFactory.Create(System.Collections.Generic.IReadOnlyDictionary? overrideConfiguration) -> GitVersion.VersionCalculation.Caching.GitVersionCacheKey! +GitVersion.VersionCalculation.Caching.IGitVersionCache.GetCacheFileName(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! cacheKey) -> string! +GitVersion.VersionCalculation.Caching.IGitVersionCache.LoadVersionVariablesFromDiskCache(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! key) -> GitVersion.OutputVariables.GitVersionVariables? +GitVersion.VersionCalculation.Caching.IGitVersionCache.WriteVariablesToDiskCache(GitVersion.VersionCalculation.Caching.GitVersionCacheKey! cacheKey, GitVersion.OutputVariables.GitVersionVariables! variablesFromCache) -> void GitVersion.VersionCalculation.CommitMessageIncrementMode GitVersion.VersionCalculation.CommitMessageIncrementMode.Disabled = 1 -> GitVersion.VersionCalculation.CommitMessageIncrementMode GitVersion.VersionCalculation.CommitMessageIncrementMode.Enabled = 0 -> GitVersion.VersionCalculation.CommitMessageIncrementMode GitVersion.VersionCalculation.CommitMessageIncrementMode.MergeMessageOnly = 2 -> GitVersion.VersionCalculation.CommitMessageIncrementMode -GitVersion.VersionCalculation.ConfigNextVersionVersionStrategy -GitVersion.VersionCalculation.ConfigNextVersionVersionStrategy.ConfigNextVersionVersionStrategy(System.Lazy! versionContext) -> void -GitVersion.VersionCalculation.EffectiveBranchConfigurationFinder -GitVersion.VersionCalculation.EffectiveBranchConfigurationFinder.EffectiveBranchConfigurationFinder(GitVersion.Logging.ILog! log, GitVersion.Common.IRepositoryStore! repositoryStore) -> void GitVersion.VersionCalculation.IEffectiveBranchConfigurationFinder GitVersion.VersionCalculation.IEffectiveBranchConfigurationFinder.GetConfigurations(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration) -> System.Collections.Generic.IEnumerable! GitVersion.VersionCalculation.IIncrementStrategyFinder @@ -909,23 +718,14 @@ GitVersion.VersionCalculation.IIncrementStrategyFinder.GetIncrementForCommits(st GitVersion.VersionCalculation.IMainlineVersionCalculator GitVersion.VersionCalculation.IMainlineVersionCalculator.CreateVersionBuildMetaData(GitVersion.ICommit? baseVersionSource) -> GitVersion.SemanticVersionBuildMetaData! GitVersion.VersionCalculation.IMainlineVersionCalculator.FindMainlineModeVersion(GitVersion.VersionCalculation.NextVersion! nextVersion) -> GitVersion.SemanticVersion! -GitVersion.VersionCalculation.IncrementStrategyFinder.DetermineIncrementedField(GitVersion.ICommit? currentCommit, GitVersion.VersionCalculation.BaseVersion! baseVersion, GitVersion.Configuration.EffectiveConfiguration! configuration) -> GitVersion.VersionField -GitVersion.VersionCalculation.IncrementStrategyFinder.GetIncrementForCommits(string? majorVersionBumpMessage, string? minorVersionBumpMessage, string? patchVersionBumpMessage, string? noBumpMessage, System.Collections.Generic.IEnumerable! commits) -> GitVersion.VersionField? GitVersion.VersionCalculation.INextVersionCalculator GitVersion.VersionCalculation.INextVersionCalculator.FindVersion() -> GitVersion.VersionCalculation.NextVersion! GitVersion.VersionCalculation.IVariableProvider -GitVersion.VersionCalculation.IVariableProvider.GetVariablesFor(GitVersion.SemanticVersion! semanticVersion, GitVersion.Configuration.EffectiveConfiguration! configuration, GitVersion.SemanticVersion? currentCommitTaggedVersion) -> GitVersion.OutputVariables.VersionVariables! +GitVersion.VersionCalculation.IVariableProvider.GetVariablesFor(GitVersion.SemanticVersion! semanticVersion, GitVersion.Configuration.EffectiveConfiguration! configuration, GitVersion.SemanticVersion? currentCommitTaggedVersion) -> GitVersion.OutputVariables.GitVersionVariables! GitVersion.VersionCalculation.IVersionFilter GitVersion.VersionCalculation.IVersionFilter.Exclude(GitVersion.VersionCalculation.BaseVersion! version, out string? reason) -> bool GitVersion.VersionCalculation.IVersionStrategy GitVersion.VersionCalculation.IVersionStrategy.GetBaseVersions(GitVersion.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -GitVersion.VersionCalculation.IncrementStrategyFinder -GitVersion.VersionCalculation.IncrementStrategyFinder.IncrementStrategyFinder(GitVersion.IGitRepository! repository) -> void -GitVersion.VersionCalculation.MergeMessageVersionStrategy -GitVersion.VersionCalculation.MergeMessageVersionStrategy.MergeMessageVersionStrategy(GitVersion.Logging.ILog! log, System.Lazy! versionContext, GitVersion.Common.IRepositoryStore! repositoryStore) -> void -GitVersion.VersionCalculation.MinDateVersionFilter -GitVersion.VersionCalculation.MinDateVersionFilter.Exclude(GitVersion.VersionCalculation.BaseVersion? version, out string? reason) -> bool -GitVersion.VersionCalculation.MinDateVersionFilter.MinDateVersionFilter(System.DateTimeOffset minimum) -> void GitVersion.VersionCalculation.NextVersion GitVersion.VersionCalculation.NextVersion.BaseVersion.get -> GitVersion.VersionCalculation.BaseVersion! GitVersion.VersionCalculation.NextVersion.Branch.get -> GitVersion.IBranch! @@ -935,27 +735,14 @@ GitVersion.VersionCalculation.NextVersion.Equals(GitVersion.VersionCalculation.N GitVersion.VersionCalculation.NextVersion.IncrementedVersion.get -> GitVersion.SemanticVersion! GitVersion.VersionCalculation.NextVersion.NextVersion(GitVersion.SemanticVersion! incrementedVersion, GitVersion.VersionCalculation.BaseVersion! baseVersion, GitVersion.Configuration.EffectiveBranchConfiguration! configuration) -> void GitVersion.VersionCalculation.NextVersion.NextVersion(GitVersion.SemanticVersion! incrementedVersion, GitVersion.VersionCalculation.BaseVersion! baseVersion, GitVersion.IBranch! branch, GitVersion.Configuration.EffectiveConfiguration! configuration) -> void -GitVersion.VersionCalculation.NextVersionCalculator -GitVersion.VersionCalculation.NextVersionCalculator.NextVersionCalculator(GitVersion.Logging.ILog! log, GitVersion.VersionCalculation.IMainlineVersionCalculator! mainlineVersionCalculator, GitVersion.Common.IRepositoryStore! repositoryStore, System.Lazy! versionContext, System.Collections.Generic.IEnumerable! versionStrategies, GitVersion.VersionCalculation.IEffectiveBranchConfigurationFinder! effectiveBranchConfigurationFinder, GitVersion.VersionCalculation.IIncrementStrategyFinder! incrementStrategyFinder) -> void -GitVersion.VersionCalculation.ShaVersionFilter -GitVersion.VersionCalculation.ShaVersionFilter.Exclude(GitVersion.VersionCalculation.BaseVersion? version, out string? reason) -> bool -GitVersion.VersionCalculation.ShaVersionFilter.ShaVersionFilter(System.Collections.Generic.IEnumerable! shas) -> void -GitVersion.VersionCalculation.TaggedCommitVersionStrategy -GitVersion.VersionCalculation.TaggedCommitVersionStrategy.TaggedCommitVersionStrategy(GitVersion.Common.IRepositoryStore! repositoryStore, System.Lazy! versionContext) -> void -GitVersion.VersionCalculation.TrackReleaseBranchesVersionStrategy -GitVersion.VersionCalculation.TrackReleaseBranchesVersionStrategy.TrackReleaseBranchesVersionStrategy(GitVersion.Common.IRepositoryStore! repositoryStore, System.Lazy! versionContext) -> void -GitVersion.VersionCalculation.VariableProvider -GitVersion.VersionCalculation.VariableProvider.GetVariablesFor(GitVersion.SemanticVersion! semanticVersion, GitVersion.Configuration.EffectiveConfiguration! configuration, GitVersion.SemanticVersion? currentCommitTaggedVersion) -> GitVersion.OutputVariables.VersionVariables! -GitVersion.VersionCalculation.VariableProvider.VariableProvider(GitVersion.IEnvironment! environment) -> void GitVersion.VersionCalculation.VersionCalculationModule GitVersion.VersionCalculation.VersionCalculationModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void GitVersion.VersionCalculation.VersionCalculationModule.VersionCalculationModule() -> void -GitVersion.VersionCalculation.VersionInBranchNameVersionStrategy -GitVersion.VersionCalculation.VersionInBranchNameVersionStrategy.VersionInBranchNameVersionStrategy(GitVersion.Common.IRepositoryStore! repositoryStore, System.Lazy! versionContext) -> void GitVersion.VersionCalculation.VersionStrategyBase GitVersion.VersionCalculation.VersionStrategyBase.Context.get -> GitVersion.GitVersionContext! GitVersion.VersionCalculation.VersionStrategyBase.VersionStrategyBase(System.Lazy! versionContext) -> void GitVersion.VersionCalculation.VersionStrategyModule +GitVersion.VersionCalculation.VersionStrategyModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void GitVersion.VersionCalculation.VersionStrategyModule.VersionStrategyModule() -> void GitVersion.VersionCalculation.VersioningMode GitVersion.VersionCalculation.VersioningMode.ContinuousDelivery = 0 -> GitVersion.VersionCalculation.VersioningMode @@ -974,93 +761,21 @@ GitVersion.WixInfo GitVersion.WixInfo.UpdateWixVersionFile -> bool GitVersion.WixInfo.WixInfo() -> void abstract GitVersion.Agents.BuildAgentBase.EnvironmentVariable.get -> string! -abstract GitVersion.Agents.BuildAgentBase.GenerateSetParameterMessage(string! name, string! value) -> string![]! -abstract GitVersion.Agents.BuildAgentBase.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string? -abstract GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.DefaultResult.get -> string? -abstract GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -abstract GitVersion.GitVersionModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void +abstract GitVersion.Agents.BuildAgentBase.GenerateSetParameterMessage(string! name, string? value) -> string![]! +abstract GitVersion.Agents.BuildAgentBase.GenerateSetVersionMessage(GitVersion.OutputVariables.GitVersionVariables! variables) -> string? abstract GitVersion.VersionCalculation.VersionStrategyBase.GetBaseVersions(GitVersion.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -const GitVersion.Configuration.ConfigurationConstants.BranchNamePlaceholder = "{BranchName}" -> string! -const GitVersion.Configuration.ConfigurationConstants.DefaultLabelPrefix = "[vV]?" -> string! -const GitVersion.Configuration.ConfigurationConstants.DevelopBranchKey = "develop" -> string! -const GitVersion.Configuration.ConfigurationConstants.DevelopBranchRegex = "^dev(elop)?(ment)?$" -> string! -const GitVersion.Configuration.ConfigurationConstants.FeatureBranchKey = "feature" -> string! -const GitVersion.Configuration.ConfigurationConstants.FeatureBranchRegex = "^features?[/-]" -> string! -const GitVersion.Configuration.ConfigurationConstants.HotfixBranchKey = "hotfix" -> string! -const GitVersion.Configuration.ConfigurationConstants.HotfixBranchRegex = "^hotfix(es)?[/-]" -> string! -const GitVersion.Configuration.ConfigurationConstants.MainBranchKey = "main" -> string! -const GitVersion.Configuration.ConfigurationConstants.MainBranchRegex = "^master$|^main$" -> string! -const GitVersion.Configuration.ConfigurationConstants.MasterBranchKey = "master" -> string! -const GitVersion.Configuration.ConfigurationConstants.PullRequestBranchKey = "pull-request" -> string! -const GitVersion.Configuration.ConfigurationConstants.PullRequestBranchRegex = "^(pull|pull\\-requests|pr)[/-]" -> string! -const GitVersion.Configuration.ConfigurationConstants.ReleaseBranchKey = "release" -> string! -const GitVersion.Configuration.ConfigurationConstants.ReleaseBranchRegex = "^releases?[/-]" -> string! -const GitVersion.Configuration.ConfigurationConstants.SupportBranchKey = "support" -> string! -const GitVersion.Configuration.ConfigurationConstants.SupportBranchRegex = "^support[/-]" -> string! -const GitVersion.Configuration.ConfigurationConstants.UnknownBranchKey = "unknown" -> string! -const GitVersion.Configuration.ConfigurationConstants.UnknownBranchRegex = ".*" -> string! -const GitVersion.Configuration.ConfigurationFileLocator.DefaultAlternativeFileName = "GitVersion.yaml" -> string! -const GitVersion.Configuration.ConfigurationFileLocator.DefaultFileName = "GitVersion.yml" -> string! const GitVersion.ReferenceName.LocalBranchPrefix = "refs/heads/" -> string! const GitVersion.ReferenceName.OriginPrefix = "origin/" -> string! const GitVersion.ReferenceName.RemoteTrackingBranchPrefix = "refs/remotes/" -> string! const GitVersion.ReferenceName.TagPrefix = "refs/tags/" -> string! -const GitVersion.VersionCalculation.IncrementStrategyFinder.DefaultMajorPattern = "\\+semver:\\s?(breaking|major)" -> string! -const GitVersion.VersionCalculation.IncrementStrategyFinder.DefaultMinorPattern = "\\+semver:\\s?(feature|minor)" -> string! -const GitVersion.VersionCalculation.IncrementStrategyFinder.DefaultNoBumpPattern = "\\+semver:\\s?(none|skip)" -> string! -const GitVersion.VersionCalculation.IncrementStrategyFinder.DefaultPatchPattern = "\\+semver:\\s?(fix|patch)" -> string! override GitVersion.Agents.LocalBuild.CanApplyToCurrentContext() -> bool override GitVersion.Agents.LocalBuild.EnvironmentVariable.get -> string! -override GitVersion.Agents.LocalBuild.GenerateSetParameterMessage(string! name, string! value) -> string![]! -override GitVersion.Agents.LocalBuild.GenerateSetVersionMessage(GitVersion.OutputVariables.VersionVariables! variables) -> string? +override GitVersion.Agents.LocalBuild.GenerateSetParameterMessage(string! name, string? value) -> string![]! +override GitVersion.Agents.LocalBuild.GenerateSetVersionMessage(GitVersion.OutputVariables.GitVersionVariables! variables) -> string? override GitVersion.Agents.LocalBuild.IsDefault.get -> bool override GitVersion.BranchCommit.Equals(object? obj) -> bool override GitVersion.BranchCommit.GetHashCode() -> int -override GitVersion.Configuration.GitVersionConfiguration.Inherit(GitVersion.Configuration.IBranchConfiguration! configuration) -> GitVersion.Configuration.IBranchConfiguration! -override GitVersion.Configuration.GitVersionConfiguration.ToString() -> string! -override GitVersion.Configuration.Init.EditConfigStep.DefaultResult.get -> string? -override GitVersion.Configuration.Init.EditConfigStep.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.EditConfigStep.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.GitVersionInitModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -override GitVersion.Configuration.Init.SetConfig.AssemblyVersioningSchemeSetting.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.AssemblyVersioningSchemeSetting.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.AssemblyVersioningSchemeSetting.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranch.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranch.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranch.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranches.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranches.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.ConfigureBranches.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetConfig.GlobalModeSetting.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.GlobalModeSetting.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.GlobalModeSetting.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.SetBranchIncrementMode.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetConfig.SetBranchTag.DefaultResult.get -> string! -override GitVersion.Configuration.Init.SetConfig.SetBranchTag.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetConfig.SetBranchTag.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.SetNextVersion.DefaultResult.get -> string? -override GitVersion.Configuration.Init.SetNextVersion.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.SetNextVersion.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.Wizard.FinishedSetupStep.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.GitFlowSetupStep.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.GitHubFlowStep.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy1Step.DefaultResult.get -> string? -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy1Step.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy1Step.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy2Step.DefaultResult.get -> string? -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy2Step.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy2Step.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step.DefaultResult.get -> string? -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep.DefaultResult.get -> string? -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep.GetPrompt(GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> string! -override GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep.HandleResult(string? result, System.Collections.Generic.Queue! steps, GitVersion.Configuration.GitVersionConfiguration! configuration, string! workingDirectory) -> GitVersion.Configuration.Init.StepResult! override GitVersion.Helpers.LambdaKeyComparer.Compare(TSource? x, TSource? y) -> int -override GitVersion.Logging.Log.ToString() -> string! -override GitVersion.OutputVariables.VersionVariables.ToString() -> string! override GitVersion.OutputVariables.VersionVariablesJsonStringConverter.CanConvert(System.Type! typeToConvert) -> bool override GitVersion.OutputVariables.VersionVariablesJsonStringConverter.HandleNull.get -> bool override GitVersion.OutputVariables.VersionVariablesJsonStringConverter.Read(ref System.Text.Json.Utf8JsonReader reader, System.Type! typeToConvert, System.Text.Json.JsonSerializerOptions! options) -> string! @@ -1079,23 +794,12 @@ override GitVersion.SemanticVersionPreReleaseTag.GetHashCode() -> int override GitVersion.SemanticVersionPreReleaseTag.ToString() -> string! override GitVersion.SemanticVersionWithTag.ToString() -> string! override GitVersion.VersionCalculation.BaseVersion.ToString() -> string! -override GitVersion.VersionCalculation.ConfigNextVersionVersionStrategy.GetBaseVersions(GitVersion.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -override GitVersion.VersionCalculation.MergeMessageVersionStrategy.GetBaseVersions(GitVersion.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! override GitVersion.VersionCalculation.NextVersion.Equals(object? other) -> bool override GitVersion.VersionCalculation.NextVersion.GetHashCode() -> int override GitVersion.VersionCalculation.NextVersion.ToString() -> string! -override GitVersion.VersionCalculation.TaggedCommitVersionStrategy.GetBaseVersions(GitVersion.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -override GitVersion.VersionCalculation.TrackReleaseBranchesVersionStrategy.GetBaseVersions(GitVersion.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -override GitVersion.VersionCalculation.VersionInBranchNameVersionStrategy.GetBaseVersions(GitVersion.Configuration.EffectiveBranchConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -override GitVersion.VersionCalculation.VersionStrategyModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void readonly GitVersion.Agents.BuildAgentBase.Log -> GitVersion.Logging.ILog! -readonly GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.Console -> GitVersion.Logging.IConsole! -readonly GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.FileSystem -> GitVersion.IFileSystem! -readonly GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.Log -> GitVersion.Logging.ILog! -readonly GitVersion.Configuration.Init.Wizard.ConfigInitWizardStep.StepFactory -> GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! static GitVersion.BranchCommit.operator !=(GitVersion.BranchCommit left, GitVersion.BranchCommit right) -> bool static GitVersion.BranchCommit.operator ==(GitVersion.BranchCommit left, GitVersion.BranchCommit right) -> bool -static GitVersion.Configuration.BranchConfigurationBuilder.New.get -> GitVersion.Configuration.BranchConfigurationBuilder! static GitVersion.Configuration.ConfigurationExtensions.FindGitDir(this string! path) -> (string! GitDirectory, string! WorkingTreeDirectory)? static GitVersion.Configuration.ConfigurationExtensions.GetBranchConfiguration(this GitVersion.Configuration.IGitVersionConfiguration! configuration, GitVersion.IBranch! branch) -> GitVersion.Configuration.IBranchConfiguration! static GitVersion.Configuration.ConfigurationExtensions.GetBranchConfiguration(this GitVersion.Configuration.IGitVersionConfiguration! configuration, GitVersion.ReferenceName! branchName) -> GitVersion.Configuration.IBranchConfiguration! @@ -1106,15 +810,6 @@ static GitVersion.Configuration.ConfigurationExtensions.GetFallbackBranchConfigu static GitVersion.Configuration.ConfigurationExtensions.GetReleaseBranchConfiguration(this GitVersion.Configuration.IGitVersionConfiguration! configuration) -> System.Collections.Generic.List>! static GitVersion.Configuration.ConfigurationExtensions.IsReleaseBranch(this GitVersion.Configuration.IGitVersionConfiguration! configuration, GitVersion.IBranch! branch) -> bool static GitVersion.Configuration.ConfigurationExtensions.IsReleaseBranch(this GitVersion.Configuration.IGitVersionConfiguration! configuration, GitVersion.ReferenceName! branchName) -> bool -static GitVersion.Configuration.ConfigurationSerializer.Deserialize(string! input) -> T -static GitVersion.Configuration.ConfigurationSerializer.Read(System.IO.TextReader! reader) -> GitVersion.Configuration.GitVersionConfiguration! -static GitVersion.Configuration.ConfigurationSerializer.Serialize(object! graph) -> string! -static GitVersion.Configuration.ConfigurationSerializer.Write(GitVersion.Configuration.IGitVersionConfiguration! configuration, System.IO.TextWriter! writer) -> void -static GitVersion.Configuration.IgnoreConfigurationExtensions.ToFilters(this GitVersion.Configuration.IIgnoreConfiguration! source) -> System.Collections.Generic.IEnumerable! -static GitVersion.Configuration.Init.StepResult.ExitWithoutSaving() -> GitVersion.Configuration.Init.StepResult! -static GitVersion.Configuration.Init.StepResult.InvalidResponseSelected() -> GitVersion.Configuration.Init.StepResult! -static GitVersion.Configuration.Init.StepResult.Ok() -> GitVersion.Configuration.Init.StepResult! -static GitVersion.Configuration.Init.StepResult.SaveAndExit() -> GitVersion.Configuration.Init.StepResult! static GitVersion.Extensions.AssemblyVersionsGeneratorExtensions.GetAssemblyFileVersion(this GitVersion.SemanticVersion! sv, GitVersion.Extensions.AssemblyFileVersioningScheme scheme) -> string? static GitVersion.Extensions.AssemblyVersionsGeneratorExtensions.GetAssemblyVersion(this GitVersion.SemanticVersion! sv, GitVersion.Extensions.AssemblyVersioningScheme scheme) -> string? static GitVersion.Extensions.CommonExtensions.NotNull(this T? value, string! name = "") -> T! @@ -1144,7 +839,6 @@ static GitVersion.Extensions.StringExtensions.IsSwitchArgument(this string? valu static GitVersion.Extensions.StringExtensions.IsTrue(this string? value) -> bool static GitVersion.Extensions.StringExtensions.IsValidPath(this string? path) -> bool static GitVersion.Extensions.StringExtensions.RegexReplace(this string! input, string! pattern, string! replace, System.Text.RegularExpressions.RegexOptions options = System.Text.RegularExpressions.RegexOptions.None) -> string! -static GitVersion.GitVersionModule.FindAllDerivedTypes(System.Reflection.Assembly? assembly) -> System.Collections.Generic.IEnumerable! static GitVersion.Helpers.EncodingHelper.DetectEncoding(System.Collections.Generic.IList! bytes) -> System.Text.Encoding? static GitVersion.Helpers.EncodingHelper.DetectEncoding(string? filename) -> System.Text.Encoding? static GitVersion.Helpers.PathHelper.Combine(string? path1) -> string! @@ -1183,9 +877,9 @@ static GitVersion.Logging.LogExtensions.Warning(this GitVersion.Logging.ILog! lo static GitVersion.Logging.LogExtensions.Warning(this GitVersion.Logging.ILog! log, GitVersion.Logging.Verbosity verbosity, string! format, params object![]! args) -> void static GitVersion.Logging.LogExtensions.Warning(this GitVersion.Logging.ILog! log, string! format, params object![]! args) -> void static GitVersion.Logging.LogExtensions.Write(this GitVersion.Logging.ILog! log, GitVersion.Logging.LogLevel level, string! format, params object![]! args) -> void -static GitVersion.OutputVariables.VersionVariables.AvailableVariables.get -> System.Collections.Generic.IEnumerable! -static GitVersion.OutputVariables.VersionVariables.FromFile(string! filePath, GitVersion.IFileSystem! fileSystem) -> GitVersion.OutputVariables.VersionVariables! -static GitVersion.OutputVariables.VersionVariables.FromJson(string! json) -> GitVersion.OutputVariables.VersionVariables! +static GitVersion.OutputVariables.VersionVariablesHelper.FromFile(string! filePath, GitVersion.IFileSystem! fileSystem) -> GitVersion.OutputVariables.GitVersionVariables! +static GitVersion.OutputVariables.VersionVariablesHelper.FromJson(string! json) -> GitVersion.OutputVariables.GitVersionVariables! +static GitVersion.OutputVariables.VersionVariablesHelper.ToJsonString(this GitVersion.OutputVariables.GitVersionVariables! gitVersionVariables) -> string! static GitVersion.ReferenceName.FromBranchName(string! branchName) -> GitVersion.ReferenceName! static GitVersion.ReferenceName.Parse(string! canonicalName) -> GitVersion.ReferenceName! static GitVersion.ReferenceName.TryParse(out GitVersion.ReferenceName? value, string! canonicalName) -> bool @@ -1222,6 +916,7 @@ static readonly GitVersion.Helpers.StringComparerUtils.IgnoreCaseComparer -> Sys static readonly GitVersion.Helpers.StringComparerUtils.OsDependentComparer -> System.StringComparer! static readonly GitVersion.Helpers.StringComparerUtils.OsDependentComparison -> System.StringComparison static readonly GitVersion.Logging.Disposable.Empty -> System.IDisposable! +static readonly GitVersion.OutputVariables.GitVersionVariables.AvailableVariables -> System.Collections.Generic.List! static readonly GitVersion.SemanticVersion.Empty -> GitVersion.SemanticVersion! static readonly GitVersion.SemanticVersionBuildMetaData.Empty -> GitVersion.SemanticVersionBuildMetaData! static readonly GitVersion.SemanticVersionPreReleaseTag.Empty -> GitVersion.SemanticVersionPreReleaseTag! @@ -1230,25 +925,4 @@ virtual GitVersion.Agents.BuildAgentBase.GetCurrentBranch(bool usingDynamicRepos virtual GitVersion.Agents.BuildAgentBase.IsDefault.get -> bool virtual GitVersion.Agents.BuildAgentBase.PreventFetch() -> bool virtual GitVersion.Agents.BuildAgentBase.ShouldCleanUpRemotes() -> bool -virtual GitVersion.Agents.BuildAgentBase.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber = true) -> void -virtual GitVersion.Configuration.BranchConfiguration.Inherit(GitVersion.Configuration.IBranchConfiguration! configuration) -> GitVersion.Configuration.IBranchConfiguration! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithCommitMessageIncrementing(GitVersion.VersionCalculation.CommitMessageIncrementMode? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithConfiguration(GitVersion.Configuration.IBranchConfiguration! value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithIncrement(GitVersion.IncrementStrategy value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithIsMainline(bool? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithIsReleaseBranch(bool? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithIsSourceBranchFor(params string![]! values) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithIsSourceBranchFor(System.Collections.Generic.IEnumerable! values) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithLabel(string? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithLabelNumberPattern(string? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithPreReleaseWeight(int? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithPreventIncrementOfMergedBranchVersion(bool? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithRegularExpression(string? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithSourceBranches(params string![]! values) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithSourceBranches(System.Collections.Generic.IEnumerable! values) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithTrackMergeMessage(bool? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithTrackMergeTarget(bool? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithTracksReleaseBranches(bool? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.Configuration.BranchConfigurationBuilder.WithVersioningMode(GitVersion.VersionCalculation.VersioningMode? value) -> GitVersion.Configuration.BranchConfigurationBuilder! -virtual GitVersion.VersionCalculation.EffectiveBranchConfigurationFinder.GetConfigurations(GitVersion.IBranch! branch, GitVersion.Configuration.IGitVersionConfiguration! configuration) -> System.Collections.Generic.IEnumerable! -virtual GitVersion.VersionCalculation.NextVersionCalculator.FindVersion() -> GitVersion.VersionCalculation.NextVersion! +virtual GitVersion.Agents.BuildAgentBase.WriteIntegration(System.Action! writer, GitVersion.OutputVariables.GitVersionVariables! variables, bool updateBuildNumber = true) -> void diff --git a/src/GitVersion.Core/VersionCalculation/Abstractions/IVariableProvider.cs b/src/GitVersion.Core/VersionCalculation/Abstractions/IVariableProvider.cs index 58f3e4d2e9..7276ffe793 100644 --- a/src/GitVersion.Core/VersionCalculation/Abstractions/IVariableProvider.cs +++ b/src/GitVersion.Core/VersionCalculation/Abstractions/IVariableProvider.cs @@ -5,7 +5,7 @@ namespace GitVersion.VersionCalculation; public interface IVariableProvider { - VersionVariables GetVariablesFor( + GitVersionVariables GetVariablesFor( SemanticVersion semanticVersion, EffectiveConfiguration configuration, SemanticVersion? currentCommitTaggedVersion ); } diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/ConfigNextVersionVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/ConfigNextVersionVersionStrategy.cs index d9e2f1b491..17643930e3 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/ConfigNextVersionVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/ConfigNextVersionVersionStrategy.cs @@ -8,7 +8,7 @@ namespace GitVersion.VersionCalculation; /// BaseVersionSource is null. /// Does not increment. /// -public class ConfigNextVersionVersionStrategy : VersionStrategyBase +internal class ConfigNextVersionVersionStrategy : VersionStrategyBase { public ConfigNextVersionVersionStrategy(Lazy versionContext) : base(versionContext) { diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/MergeMessageVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/MergeMessageVersionStrategy.cs index 31a05ad737..6d3c83dc16 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/MergeMessageVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/MergeMessageVersionStrategy.cs @@ -11,7 +11,7 @@ namespace GitVersion.VersionCalculation; /// BaseVersionSource is the commit where the message was found. /// Increments if PreventIncrementOfMergedBranchVersion (from the branch configuration) is false. /// -public class MergeMessageVersionStrategy : VersionStrategyBase +internal class MergeMessageVersionStrategy : VersionStrategyBase { private readonly ILog log; private readonly IRepositoryStore repositoryStore; diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs index e440f2ba0d..d777e22f46 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs @@ -9,7 +9,7 @@ namespace GitVersion.VersionCalculation; /// BaseVersionSource is the tag's commit. /// Increments if the tag is not the current commit. /// -public sealed class TaggedCommitVersionStrategy : VersionStrategyBase +internal sealed class TaggedCommitVersionStrategy : VersionStrategyBase { private readonly IRepositoryStore repositoryStore; diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TrackReleaseBranchesVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TrackReleaseBranchesVersionStrategy.cs index 1d6f6609af..935dff7c2d 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TrackReleaseBranchesVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/TrackReleaseBranchesVersionStrategy.cs @@ -20,7 +20,7 @@ namespace GitVersion.VersionCalculation; /// Increments if the tag is not the current commit (same as base strategy). /// /// -public class TrackReleaseBranchesVersionStrategy : VersionStrategyBase +internal class TrackReleaseBranchesVersionStrategy : VersionStrategyBase { private readonly VersionInBranchNameVersionStrategy releaseVersionStrategy; diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs index 8013d1dd95..93596a8b00 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionInBranchNameVersionStrategy.cs @@ -9,7 +9,7 @@ namespace GitVersion.VersionCalculation; /// BaseVersionSource is the commit where the branch was branched from its parent. /// Does not increment. /// -public class VersionInBranchNameVersionStrategy : VersionStrategyBase +internal class VersionInBranchNameVersionStrategy : VersionStrategyBase { private readonly IRepositoryStore repositoryStore; diff --git a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionStrategyModule.cs b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionStrategyModule.cs index 1721e51100..23d0580365 100644 --- a/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionStrategyModule.cs +++ b/src/GitVersion.Core/VersionCalculation/BaseVersionCalculators/VersionStrategyModule.cs @@ -2,11 +2,11 @@ namespace GitVersion.VersionCalculation; -public class VersionStrategyModule : GitVersionModule +public class VersionStrategyModule : IGitVersionModule { - public override void RegisterTypes(IServiceCollection services) + public void RegisterTypes(IServiceCollection services) { - var versionStrategies = FindAllDerivedTypes(Assembly.GetAssembly(GetType())) + var versionStrategies = IGitVersionModule.FindAllDerivedTypes(Assembly.GetAssembly(GetType())) .Where(x => x is { IsAbstract: false, IsInterface: false }); foreach (var versionStrategy in versionStrategies) diff --git a/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCache.cs b/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCache.cs index 1671b17617..7a53d414d3 100644 --- a/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCache.cs +++ b/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCache.cs @@ -19,14 +19,11 @@ public GitVersionCache(IFileSystem fileSystem, ILog log, IGitRepositoryInfo repo this.repositoryInfo = repositoryInfo.NotNull(); } - public void WriteVariablesToDiskCache(GitVersionCacheKey cacheKey, VersionVariables variablesFromCache) + public void WriteVariablesToDiskCache(GitVersionCacheKey cacheKey, GitVersionVariables variablesFromCache) { - var cacheDir = PrepareCacheDirectory(); - var cacheFileName = GetCacheFileName(cacheKey, cacheDir); + var cacheFileName = GetCacheFileName(cacheKey); - variablesFromCache.FileName = cacheFileName; - - Dictionary dictionary; + Dictionary dictionary; using (this.log.IndentLog("Creating dictionary")) { dictionary = variablesFromCache.ToDictionary(x => x.Key, x => x.Value); @@ -47,13 +44,20 @@ void WriteCacheOperation() retryOperation.Execute(WriteCacheOperation); } + public string GetCacheFileName(GitVersionCacheKey cacheKey) + { + var cacheDir = PrepareCacheDirectory(); + var cacheFileName = GetCacheFileName(cacheKey, cacheDir); + return cacheFileName; + } + public string GetCacheDirectory() { var gitDir = this.repositoryInfo.DotGitDirectory; return PathHelper.Combine(gitDir, "gitversion_cache"); } - public VersionVariables? LoadVersionVariablesFromDiskCache(GitVersionCacheKey key) + public GitVersionVariables? LoadVersionVariablesFromDiskCache(GitVersionCacheKey key) { using (this.log.IndentLog("Loading version variables from disk cache")) { @@ -70,7 +74,7 @@ public string GetCacheDirectory() { try { - var loadedVariables = VersionVariables.FromFile(cacheFileName, this.fileSystem); + var loadedVariables = VersionVariablesHelper.FromFile(cacheFileName, this.fileSystem); return loadedVariables; } catch (Exception ex) diff --git a/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCacheKeyFactory.cs b/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCacheKeyFactory.cs index c8bfadcb8f..0ae7e4fd3a 100644 --- a/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCacheKeyFactory.cs +++ b/src/GitVersion.Core/VersionCalculation/Caching/GitVersionCacheKeyFactory.cs @@ -7,7 +7,7 @@ namespace GitVersion.VersionCalculation.Caching; -public class GitVersionCacheKeyFactory : IGitVersionCacheKeyFactory +internal class GitVersionCacheKeyFactory : IGitVersionCacheKeyFactory { private readonly IFileSystem fileSystem; private readonly ILog log; diff --git a/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCache.cs b/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCache.cs index 1f03b4bc45..e94986023f 100644 --- a/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCache.cs +++ b/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCache.cs @@ -4,7 +4,8 @@ namespace GitVersion.VersionCalculation.Caching; public interface IGitVersionCache { - void WriteVariablesToDiskCache(GitVersionCacheKey cacheKey, VersionVariables variablesFromCache); + void WriteVariablesToDiskCache(GitVersionCacheKey cacheKey, GitVersionVariables variablesFromCache); string GetCacheDirectory(); - VersionVariables? LoadVersionVariablesFromDiskCache(GitVersionCacheKey key); + GitVersionVariables? LoadVersionVariablesFromDiskCache(GitVersionCacheKey key); + string GetCacheFileName(GitVersionCacheKey cacheKey); } diff --git a/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCacheKeyFactory.cs b/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCacheKeyFactory.cs index 8a958359d6..55edf3c8fe 100644 --- a/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCacheKeyFactory.cs +++ b/src/GitVersion.Core/VersionCalculation/Caching/IGitVersionCacheKeyFactory.cs @@ -1,6 +1,6 @@ namespace GitVersion.VersionCalculation.Caching; -public interface IGitVersionCacheKeyFactory +internal interface IGitVersionCacheKeyFactory { GitVersionCacheKey Create(IReadOnlyDictionary? overrideConfiguration); } diff --git a/src/GitVersion.Core/VersionCalculation/EffectiveBranchConfigurationFinder.cs b/src/GitVersion.Core/VersionCalculation/EffectiveBranchConfigurationFinder.cs index 136387932b..51bd4a9e13 100644 --- a/src/GitVersion.Core/VersionCalculation/EffectiveBranchConfigurationFinder.cs +++ b/src/GitVersion.Core/VersionCalculation/EffectiveBranchConfigurationFinder.cs @@ -5,7 +5,7 @@ namespace GitVersion.VersionCalculation; -public class EffectiveBranchConfigurationFinder : IEffectiveBranchConfigurationFinder +internal class EffectiveBranchConfigurationFinder : IEffectiveBranchConfigurationFinder { private readonly ILog log; private readonly IRepositoryStore repositoryStore; diff --git a/src/GitVersion.Core/VersionCalculation/IncrementStrategyFinder.cs b/src/GitVersion.Core/VersionCalculation/IncrementStrategyFinder.cs index 30fb208e60..7519614147 100644 --- a/src/GitVersion.Core/VersionCalculation/IncrementStrategyFinder.cs +++ b/src/GitVersion.Core/VersionCalculation/IncrementStrategyFinder.cs @@ -5,7 +5,7 @@ namespace GitVersion.VersionCalculation; -public class IncrementStrategyFinder : IIncrementStrategyFinder +internal class IncrementStrategyFinder : IIncrementStrategyFinder { public const string DefaultMajorPattern = @"\+semver:\s?(breaking|major)"; public const string DefaultMinorPattern = @"\+semver:\s?(feature|minor)"; diff --git a/src/GitVersion.Core/VersionCalculation/MinDateVersionFilter.cs b/src/GitVersion.Core/VersionCalculation/MinDateVersionFilter.cs index 2136ad5ee6..8973f87815 100644 --- a/src/GitVersion.Core/VersionCalculation/MinDateVersionFilter.cs +++ b/src/GitVersion.Core/VersionCalculation/MinDateVersionFilter.cs @@ -3,7 +3,7 @@ namespace GitVersion.VersionCalculation; -public class MinDateVersionFilter : IVersionFilter +internal class MinDateVersionFilter : IVersionFilter { private readonly DateTimeOffset minimum; diff --git a/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs b/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs index 760527802b..9f0298739b 100644 --- a/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs +++ b/src/GitVersion.Core/VersionCalculation/NextVersionCalculator.cs @@ -6,7 +6,7 @@ namespace GitVersion.VersionCalculation; -public class NextVersionCalculator : INextVersionCalculator +internal class NextVersionCalculator : INextVersionCalculator { private readonly ILog log; private readonly IMainlineVersionCalculator mainlineVersionCalculator; diff --git a/src/GitVersion.Core/VersionCalculation/ShaVersionFilter.cs b/src/GitVersion.Core/VersionCalculation/ShaVersionFilter.cs index 7820f94f3d..c5b904160a 100644 --- a/src/GitVersion.Core/VersionCalculation/ShaVersionFilter.cs +++ b/src/GitVersion.Core/VersionCalculation/ShaVersionFilter.cs @@ -3,7 +3,7 @@ namespace GitVersion.VersionCalculation; -public class ShaVersionFilter : IVersionFilter +internal class ShaVersionFilter : IVersionFilter { private readonly IEnumerable shas; diff --git a/src/GitVersion.Core/VersionCalculation/VariableProvider.cs b/src/GitVersion.Core/VersionCalculation/VariableProvider.cs index 7b8f0ca190..d710c5ef64 100644 --- a/src/GitVersion.Core/VersionCalculation/VariableProvider.cs +++ b/src/GitVersion.Core/VersionCalculation/VariableProvider.cs @@ -6,13 +6,13 @@ namespace GitVersion.VersionCalculation; -public class VariableProvider : IVariableProvider +internal class VariableProvider : IVariableProvider { private readonly IEnvironment environment; public VariableProvider(IEnvironment environment) => this.environment = environment.NotNull(); - public VersionVariables GetVariablesFor( + public GitVersionVariables GetVariablesFor( SemanticVersion semanticVersion, EffectiveConfiguration configuration, SemanticVersion? currentCommitTaggedVersion) { semanticVersion.NotNull(); @@ -77,7 +77,7 @@ public VersionVariables GetVariablesFor( var assemblySemVer = CheckAndFormatString(configuration.AssemblyVersioningFormat, semverFormatValues, semverFormatValues.AssemblySemVer, "AssemblyVersioningFormat"); - return new VersionVariables( + return new GitVersionVariables( semverFormatValues.Major, semverFormatValues.Minor, semverFormatValues.Patch, diff --git a/src/GitVersion.LibGit2Sharp/Git/GitRepository.extended.cs b/src/GitVersion.LibGit2Sharp/Git/GitRepository.extended.cs index 8eb35ecc5f..494db200c3 100644 --- a/src/GitVersion.LibGit2Sharp/Git/GitRepository.extended.cs +++ b/src/GitVersion.LibGit2Sharp/Git/GitRepository.extended.cs @@ -92,7 +92,7 @@ private DirectReference GetPullRequestReference(AuthenticationInfo auth, LibGit2 : network.ListReferences(remote)) .Select(r => r.ResolveToDirectReference()).ToList(); - this.log.Info($"Remote Refs:{System.Environment.NewLine}" + string.Join(System.Environment.NewLine, remoteTips.Select(r => r.CanonicalName))); + this.log.Info($"Remote Refs:{Environment.NewLine}" + string.Join(Environment.NewLine, remoteTips.Select(r => r.CanonicalName))); var refs = remoteTips.Where(r => r.TargetIdentifier == headTipSha).ToList(); switch (refs.Count) diff --git a/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs b/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs index 97e0f8c4d2..f8ea12343d 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/GenerateGitVersionInformationTest.cs @@ -22,11 +22,11 @@ public void GenerateGitVersionInformationTaskShouldCreateFile() result.Task.GitVersionInformationFilePath.ShouldNotBeNull(); var fileContent = File.ReadAllText(result.Task.GitVersionInformationFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""2"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.2.4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.2.4+1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Major)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Minor)} = ""2"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Patch)} = ""4"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.MajorMinorPatch)} = ""1.2.4"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.FullSemVer)} = ""1.2.4+1"""); } [Test] @@ -41,11 +41,11 @@ public void GenerateGitVersionInformationTaskShouldCreateFileInBuildServer() result.Task.GitVersionInformationFilePath.ShouldNotBeNull(); var fileContent = File.ReadAllText(result.Task.GitVersionInformationFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""0"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.0.1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.0.1+1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Major)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Minor)} = ""0"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Patch)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.MajorMinorPatch)} = ""1.0.1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.FullSemVer)} = ""1.0.1+1"""); } [Test] @@ -66,11 +66,11 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuild( result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""2"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.2.4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.2.4+1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Major)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Minor)} = ""2"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Patch)} = ""4"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.MajorMinorPatch)} = ""1.2.4"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.FullSemVer)} = ""1.2.4+1"""); } [Test] @@ -91,11 +91,11 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildI result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""0"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.0.1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.0.1+1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Major)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Minor)} = ""0"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Patch)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.MajorMinorPatch)} = ""1.0.1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.FullSemVer)} = ""1.0.1+1"""); } [Test] @@ -110,11 +110,11 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenIntermediateOut result.Task.GitVersionInformationFilePath.ShouldNotBeNull(); var fileContent = File.ReadAllText(result.Task.GitVersionInformationFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""2"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.2.4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.2.4+1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Major)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Minor)} = ""2"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Patch)} = ""4"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.MajorMinorPatch)} = ""1.2.4"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.FullSemVer)} = ""1.2.4+1"""); } [Test] @@ -129,11 +129,11 @@ public void GenerateGitVersionInformationTaskShouldCreateFileInBuildServerWhenIn result.Task.GitVersionInformationFilePath.ShouldNotBeNull(); var fileContent = File.ReadAllText(result.Task.GitVersionInformationFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""0"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.0.1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.0.1+1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Major)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Minor)} = ""0"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Patch)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.MajorMinorPatch)} = ""1.0.1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.FullSemVer)} = ""1.0.1+1"""); } [Test] @@ -155,11 +155,11 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildA result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""2"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.2.4"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.2.4+1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Major)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Minor)} = ""2"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Patch)} = ""4"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.MajorMinorPatch)} = ""1.2.4"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.FullSemVer)} = ""1.2.4+1"""); } [Test] @@ -181,11 +181,11 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildA result.Output.ShouldContain($"{outputProperty}: {generatedFilePath}"); var fileContent = File.ReadAllText(generatedFilePath); - fileContent.ShouldContain($@"{nameof(VersionVariables.Major)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Minor)} = ""0"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.Patch)} = ""1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.MajorMinorPatch)} = ""1.0.1"""); - fileContent.ShouldContain($@"{nameof(VersionVariables.FullSemVer)} = ""1.0.1+1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Major)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Minor)} = ""0"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.Patch)} = ""1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.MajorMinorPatch)} = ""1.0.1"""); + fileContent.ShouldContain($@"{nameof(GitVersionVariables.FullSemVer)} = ""1.0.1+1"""); } private static void AddGenerateGitVersionInformationTask(ProjectCreator project, string targetToRun, string taskName, string outputProperty, string intermediateOutputPath = "$(MSBuildProjectDirectory)") diff --git a/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs b/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs index 34b99fdabd..303e42e6e7 100644 --- a/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs +++ b/src/GitVersion.MsBuild.Tests/Tasks/GetVersionTaskTests.cs @@ -17,7 +17,7 @@ public void OutputsShouldMatchVariableProvider() .Where(p => p.GetCustomAttributes(typeof(OutputAttribute), false).Any()) .Select(p => p.Name); - var variablesProperties = VersionVariables.AvailableVariables; + var variablesProperties = GitVersionVariables.AvailableVariables; taskProperties.ShouldBe(variablesProperties, true); } @@ -54,11 +54,11 @@ public void GetVersionTaskShouldReturnVersionOutputVariablesForBuildServer() result.Task.FullSemVer.ShouldBe("1.0.1+1"); } - [TestCase(nameof(VersionVariables.Major), "1")] - [TestCase(nameof(VersionVariables.Minor), "2")] - [TestCase(nameof(VersionVariables.Patch), "4")] - [TestCase(nameof(VersionVariables.MajorMinorPatch), "1.2.4")] - [TestCase(nameof(VersionVariables.FullSemVer), "1.2.4+1")] + [TestCase(nameof(GitVersionVariables.Major), "1")] + [TestCase(nameof(GitVersionVariables.Minor), "2")] + [TestCase(nameof(GitVersionVariables.Patch), "4")] + [TestCase(nameof(GitVersionVariables.MajorMinorPatch), "1.2.4")] + [TestCase(nameof(GitVersionVariables.FullSemVer), "1.2.4+1")] public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuild(string outputProperty, string version) { const string taskName = nameof(GetVersion); @@ -73,11 +73,11 @@ public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuild(s result.Output.ShouldContain($"GitVersion_{outputProperty}: {version}"); } - [TestCase(nameof(VersionVariables.Major), "1")] - [TestCase(nameof(VersionVariables.Minor), "0")] - [TestCase(nameof(VersionVariables.Patch), "1")] - [TestCase(nameof(VersionVariables.MajorMinorPatch), "1.0.1")] - [TestCase(nameof(VersionVariables.FullSemVer), "1.0.1+1")] + [TestCase(nameof(GitVersionVariables.Major), "1")] + [TestCase(nameof(GitVersionVariables.Minor), "0")] + [TestCase(nameof(GitVersionVariables.Patch), "1")] + [TestCase(nameof(GitVersionVariables.MajorMinorPatch), "1.0.1")] + [TestCase(nameof(GitVersionVariables.FullSemVer), "1.0.1+1")] public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuildInBuildServer(string outputProperty, string version) { const string taskName = nameof(GetVersion); diff --git a/src/GitVersion.MsBuild/GitVersion.MsBuild.csproj b/src/GitVersion.MsBuild/GitVersion.MsBuild.csproj index 7717f6a543..7120379edb 100644 --- a/src/GitVersion.MsBuild/GitVersion.MsBuild.csproj +++ b/src/GitVersion.MsBuild/GitVersion.MsBuild.csproj @@ -22,6 +22,10 @@ + + + + diff --git a/src/GitVersion.MsBuild/GitVersionTaskExecutor.cs b/src/GitVersion.MsBuild/GitVersionTaskExecutor.cs index 04412e21cf..dc28c41b76 100644 --- a/src/GitVersion.MsBuild/GitVersionTaskExecutor.cs +++ b/src/GitVersion.MsBuild/GitVersionTaskExecutor.cs @@ -7,7 +7,7 @@ namespace GitVersion.MsBuild; -public class GitVersionTaskExecutor : IGitVersionTaskExecutor +internal class GitVersionTaskExecutor : IGitVersionTaskExecutor { private readonly IFileSystem fileSystem; private readonly IGitVersionOutputTool gitVersionOutputTool; @@ -25,7 +25,7 @@ public GitVersionTaskExecutor(IFileSystem fileSystem, IGitVersionOutputTool gitV public void GetVersion(GetVersion task) { - var versionVariables = VersionVariables.FromFile(task.VersionFile, fileSystem); + var versionVariables = VersionVariablesHelper.FromFile(task.VersionFile, fileSystem); var outputType = typeof(GetVersion); foreach (var (key, value) in versionVariables) { @@ -35,7 +35,7 @@ public void GetVersion(GetVersion task) public void UpdateAssemblyInfo(UpdateAssemblyInfo task) { - var versionVariables = VersionVariables.FromFile(task.VersionFile, fileSystem); + var versionVariables = VersionVariablesHelper.FromFile(task.VersionFile, fileSystem); FileHelper.DeleteTempFiles(); FileHelper.CheckForInvalidFiles(task.CompileFiles, task.ProjectFile); @@ -59,7 +59,7 @@ public void UpdateAssemblyInfo(UpdateAssemblyInfo task) public void GenerateGitVersionInformation(GenerateGitVersionInformation task) { - var versionVariables = VersionVariables.FromFile(task.VersionFile, fileSystem); + var versionVariables = VersionVariablesHelper.FromFile(task.VersionFile, fileSystem); if (!string.IsNullOrEmpty(task.IntermediateOutputPath)) { @@ -78,7 +78,7 @@ public void GenerateGitVersionInformation(GenerateGitVersionInformation task) public void WriteVersionInfoToBuildLog(WriteVersionInfoToBuildLog task) { - var versionVariables = VersionVariables.FromFile(task.VersionFile, fileSystem); + var versionVariables = VersionVariablesHelper.FromFile(task.VersionFile, fileSystem); var gitVersionOptions = this.options.Value; var configuration = this.configurationProvider.Provide(gitVersionOptions.ConfigurationInfo.OverrideConfiguration); diff --git a/src/GitVersion.MsBuild/GitVersionTasks.cs b/src/GitVersion.MsBuild/GitVersionTasks.cs index 7d24d88aac..ef681f1a33 100644 --- a/src/GitVersion.MsBuild/GitVersionTasks.cs +++ b/src/GitVersion.MsBuild/GitVersionTasks.cs @@ -8,7 +8,7 @@ namespace GitVersion.MsBuild; -public static class GitVersionTasks +internal static class GitVersionTasks { public static bool GetVersion(GetVersion task) => ExecuteGitVersionTask(task, executor => executor.GetVersion(task)); diff --git a/src/GitVersion.MsBuild/Helpers/FileHelper.cs b/src/GitVersion.MsBuild/Helpers/FileHelper.cs index dee009e256..94cab42142 100644 --- a/src/GitVersion.MsBuild/Helpers/FileHelper.cs +++ b/src/GitVersion.MsBuild/Helpers/FileHelper.cs @@ -4,7 +4,7 @@ namespace GitVersion.MsBuild; -public static class FileHelper +internal static class FileHelper { private static readonly Dictionary> VersionAttributeFinders = new() { @@ -76,7 +76,7 @@ private static bool CSharpFileContainsVersionAttribute(string compileFile, strin var combine = PathHelper.Combine(Path.GetDirectoryName(projectFile), compileFile); var allText = File.ReadAllText(combine); - allText += System.Environment.NewLine; // Always add a new line, this handles the case for when a file ends with the EOF marker and no new line. If you don't have this newline, the regex will match commented out Assembly*Version tags on the last line. + allText += Environment.NewLine; // Always add a new line, this handles the case for when a file ends with the EOF marker and no new line. If you don't have this newline, the regex will match commented out Assembly*Version tags on the last line. const string blockComments = @"/\*(.*?)\*/"; const string lineComments = @"//(.*?)\r?\n"; @@ -85,7 +85,7 @@ private static bool CSharpFileContainsVersionAttribute(string compileFile, strin var noCommentsOrStrings = Regex.Replace(allText, blockComments + "|" + lineComments + "|" + strings + "|" + verbatimStrings, - me => me.Value.StartsWith("//") ? System.Environment.NewLine : string.Empty, + me => me.Value.StartsWith("//") ? Environment.NewLine : string.Empty, RegexOptions.Singleline); return Regex.IsMatch(noCommentsOrStrings, @"(?x) # IgnorePatternWhitespace @@ -104,14 +104,14 @@ private static bool VisualBasicFileContainsVersionAttribute(string compileFile, var combine = PathHelper.Combine(Path.GetDirectoryName(projectFile), compileFile); var allText = File.ReadAllText(combine); - allText += System.Environment.NewLine; // Always add a new line, this handles the case for when a file ends with the EOF marker and no new line. If you don't have this newline, the regex will match commented out Assembly*Version tags on the last line. + allText += Environment.NewLine; // Always add a new line, this handles the case for when a file ends with the EOF marker and no new line. If you don't have this newline, the regex will match commented out Assembly*Version tags on the last line. const string lineComments = @"'(.*?)\r?\n"; const string strings = @"""((\\[^\n]|[^""\n])*)"""; var noCommentsOrStrings = Regex.Replace(allText, lineComments + "|" + strings, - me => me.Value.StartsWith("'") ? System.Environment.NewLine : string.Empty, + me => me.Value.StartsWith("'") ? Environment.NewLine : string.Empty, RegexOptions.Singleline); return Regex.IsMatch(noCommentsOrStrings, @"(?x) # IgnorePatternWhitespace diff --git a/src/GitVersion.MsBuild/Helpers/MsBuildAppender.cs b/src/GitVersion.MsBuild/Helpers/MsBuildAppender.cs index 18975fa816..fa33e1cd7d 100644 --- a/src/GitVersion.MsBuild/Helpers/MsBuildAppender.cs +++ b/src/GitVersion.MsBuild/Helpers/MsBuildAppender.cs @@ -3,7 +3,7 @@ namespace GitVersion.MsBuild; -public class MsBuildAppender : ILogAppender +internal class MsBuildAppender : ILogAppender { private readonly TaskLoggingHelper taskLog; @@ -23,7 +23,7 @@ public void WriteTo(LogLevel level, string message) private void WriteLogEntry(LogLevel level, string str) { - var contents = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}\t\t{str}{System.Environment.NewLine}"; + var contents = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}\t\t{str}{Environment.NewLine}"; switch (level) { case LogLevel.Fatal: diff --git a/src/GitVersion.MsBuild/IGitVersionTaskExecutor.cs b/src/GitVersion.MsBuild/IGitVersionTaskExecutor.cs index 520496d583..9d27348723 100644 --- a/src/GitVersion.MsBuild/IGitVersionTaskExecutor.cs +++ b/src/GitVersion.MsBuild/IGitVersionTaskExecutor.cs @@ -2,7 +2,7 @@ namespace GitVersion.MsBuild; -public interface IGitVersionTaskExecutor +internal interface IGitVersionTaskExecutor { void GetVersion(GetVersion task); void UpdateAssemblyInfo(UpdateAssemblyInfo task); diff --git a/src/GitVersion.MsBuild/PublicAPI.Unshipped.txt b/src/GitVersion.MsBuild/PublicAPI.Unshipped.txt index 4644d7b1bf..4735527d08 100644 --- a/src/GitVersion.MsBuild/PublicAPI.Unshipped.txt +++ b/src/GitVersion.MsBuild/PublicAPI.Unshipped.txt @@ -1,5 +1,4 @@ #nullable enable -GitVersion.MsBuild.FileHelper GitVersion.MsBuild.GitVersionMsBuildModule GitVersion.MsBuild.GitVersionMsBuildModule.GitVersionMsBuildModule() -> void GitVersion.MsBuild.GitVersionMsBuildModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void @@ -18,21 +17,6 @@ GitVersion.MsBuild.GitVersionTaskBase.SolutionDirectory.set -> void GitVersion.MsBuild.GitVersionTaskBase.VersionFile.get -> string! GitVersion.MsBuild.GitVersionTaskBase.VersionFile.set -> void GitVersion.MsBuild.GitVersionTaskBase.WithOverrides(System.Action! overrides) -> void -GitVersion.MsBuild.GitVersionTaskExecutor -GitVersion.MsBuild.GitVersionTaskExecutor.GenerateGitVersionInformation(GitVersion.MsBuild.Tasks.GenerateGitVersionInformation! task) -> void -GitVersion.MsBuild.GitVersionTaskExecutor.GetVersion(GitVersion.MsBuild.Tasks.GetVersion! task) -> void -GitVersion.MsBuild.GitVersionTaskExecutor.GitVersionTaskExecutor(GitVersion.IFileSystem! fileSystem, GitVersion.IGitVersionOutputTool! gitVersionOutputTool, GitVersion.Configuration.IConfigurationProvider! configurationProvider, Microsoft.Extensions.Options.IOptions! options) -> void -GitVersion.MsBuild.GitVersionTaskExecutor.UpdateAssemblyInfo(GitVersion.MsBuild.Tasks.UpdateAssemblyInfo! task) -> void -GitVersion.MsBuild.GitVersionTaskExecutor.WriteVersionInfoToBuildLog(GitVersion.MsBuild.Tasks.WriteVersionInfoToBuildLog! task) -> void -GitVersion.MsBuild.GitVersionTasks -GitVersion.MsBuild.IGitVersionTaskExecutor -GitVersion.MsBuild.IGitVersionTaskExecutor.GenerateGitVersionInformation(GitVersion.MsBuild.Tasks.GenerateGitVersionInformation! task) -> void -GitVersion.MsBuild.IGitVersionTaskExecutor.GetVersion(GitVersion.MsBuild.Tasks.GetVersion! task) -> void -GitVersion.MsBuild.IGitVersionTaskExecutor.UpdateAssemblyInfo(GitVersion.MsBuild.Tasks.UpdateAssemblyInfo! task) -> void -GitVersion.MsBuild.IGitVersionTaskExecutor.WriteVersionInfoToBuildLog(GitVersion.MsBuild.Tasks.WriteVersionInfoToBuildLog! task) -> void -GitVersion.MsBuild.MsBuildAppender -GitVersion.MsBuild.MsBuildAppender.MsBuildAppender(Microsoft.Build.Utilities.TaskLoggingHelper! taskLog) -> void -GitVersion.MsBuild.MsBuildAppender.WriteTo(GitVersion.Logging.LogLevel level, string! message) -> void GitVersion.MsBuild.Tasks.GenerateGitVersionInformation GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.GenerateGitVersionInformation() -> void GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.GitVersionInformationFilePath.get -> string! @@ -114,12 +98,3 @@ override GitVersion.MsBuild.Tasks.GenerateGitVersionInformation.OnExecute() -> b override GitVersion.MsBuild.Tasks.GetVersion.OnExecute() -> bool override GitVersion.MsBuild.Tasks.UpdateAssemblyInfo.OnExecute() -> bool override GitVersion.MsBuild.Tasks.WriteVersionInfoToBuildLog.OnExecute() -> bool -static GitVersion.MsBuild.FileHelper.CheckForInvalidFiles(System.Collections.Generic.IEnumerable! compileFiles, string! projectFile) -> void -static GitVersion.MsBuild.FileHelper.DeleteTempFiles() -> void -static GitVersion.MsBuild.FileHelper.GetFileExtension(string! language) -> string! -static GitVersion.MsBuild.FileHelper.GetFileWriteInfo(this string? intermediateOutputPath, string! language, string! projectFile, string! outputFileName) -> GitVersion.FileWriteInfo! -static GitVersion.MsBuild.GitVersionTasks.GenerateGitVersionInformation(GitVersion.MsBuild.Tasks.GenerateGitVersionInformation! task) -> bool -static GitVersion.MsBuild.GitVersionTasks.GetVersion(GitVersion.MsBuild.Tasks.GetVersion! task) -> bool -static GitVersion.MsBuild.GitVersionTasks.UpdateAssemblyInfo(GitVersion.MsBuild.Tasks.UpdateAssemblyInfo! task) -> bool -static GitVersion.MsBuild.GitVersionTasks.WriteVersionInfoToBuildLog(GitVersion.MsBuild.Tasks.WriteVersionInfoToBuildLog! task) -> bool -static readonly GitVersion.MsBuild.FileHelper.TempPath -> string! diff --git a/src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt index 865ed03b6d..9c6b2b9a43 100644 --- a/src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt +++ b/src/GitVersion.Output.Tests/Output/Approved/cs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt @@ -28,29 +28,29 @@ namespace System.Diagnostics.CodeAnalysis [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] static class GitVersionInformation { + public const string AssemblySemFileVer = "1.2.3.0"; + public const string AssemblySemVer = "1.2.3.0"; + public const string BranchName = "feature1"; + public const string BuildMetaData = "5"; + public const string CommitDate = "2014-03-06"; + public const string CommitsSinceVersionSource = "5"; + public const string EscapedBranchName = "feature1"; + public const string FullBuildMetaData = "5.Branch.feature1.Sha.commitSha"; + public const string FullSemVer = "1.2.3-unstable.4+5"; + public const string InformationalVersion = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha"; public const string Major = "1"; + public const string MajorMinorPatch = "1.2.3"; public const string Minor = "2"; public const string Patch = "3"; - public const string PreReleaseTag = "unstable.4"; - public const string PreReleaseTagWithDash = "-unstable.4"; public const string PreReleaseLabel = "unstable"; public const string PreReleaseLabelWithDash = "-unstable"; public const string PreReleaseNumber = "4"; - public const string WeightedPreReleaseNumber = "4"; - public const string BuildMetaData = "5"; - public const string FullBuildMetaData = "5.Branch.feature1.Sha.commitSha"; - public const string MajorMinorPatch = "1.2.3"; + public const string PreReleaseTag = "unstable.4"; + public const string PreReleaseTagWithDash = "-unstable.4"; public const string SemVer = "1.2.3-unstable.4"; - public const string AssemblySemVer = "1.2.3.0"; - public const string AssemblySemFileVer = "1.2.3.0"; - public const string FullSemVer = "1.2.3-unstable.4+5"; - public const string InformationalVersion = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha"; - public const string BranchName = "feature1"; - public const string EscapedBranchName = "feature1"; public const string Sha = "commitSha"; public const string ShortSha = "commitShortSha"; - public const string VersionSourceSha = "versionSourceSha"; - public const string CommitsSinceVersionSource = "5"; - public const string CommitDate = "2014-03-06"; public const string UncommittedChanges = "0"; + public const string VersionSourceSha = "versionSourceSha"; + public const string WeightedPreReleaseNumber = "4"; } diff --git a/src/GitVersion.Output.Tests/Output/Approved/fs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/fs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt index 8d00ec5665..52f2f04d87 100644 --- a/src/GitVersion.Output.Tests/Output/Approved/fs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt +++ b/src/GitVersion.Output.Tests/Output/Approved/fs/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt @@ -30,28 +30,28 @@ namespace global [] [] type GitVersionInformation = + static member AssemblySemFileVer = "1.2.3.0" + static member AssemblySemVer = "1.2.3.0" + static member BranchName = "feature1" + static member BuildMetaData = "5" + static member CommitDate = "2014-03-06" + static member CommitsSinceVersionSource = "5" + static member EscapedBranchName = "feature1" + static member FullBuildMetaData = "5.Branch.feature1.Sha.commitSha" + static member FullSemVer = "1.2.3-unstable.4+5" + static member InformationalVersion = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha" static member Major = "1" + static member MajorMinorPatch = "1.2.3" static member Minor = "2" static member Patch = "3" - static member PreReleaseTag = "unstable.4" - static member PreReleaseTagWithDash = "-unstable.4" static member PreReleaseLabel = "unstable" static member PreReleaseLabelWithDash = "-unstable" static member PreReleaseNumber = "4" - static member WeightedPreReleaseNumber = "4" - static member BuildMetaData = "5" - static member FullBuildMetaData = "5.Branch.feature1.Sha.commitSha" - static member MajorMinorPatch = "1.2.3" + static member PreReleaseTag = "unstable.4" + static member PreReleaseTagWithDash = "-unstable.4" static member SemVer = "1.2.3-unstable.4" - static member AssemblySemVer = "1.2.3.0" - static member AssemblySemFileVer = "1.2.3.0" - static member FullSemVer = "1.2.3-unstable.4+5" - static member InformationalVersion = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha" - static member BranchName = "feature1" - static member EscapedBranchName = "feature1" static member Sha = "commitSha" static member ShortSha = "commitShortSha" - static member VersionSourceSha = "versionSourceSha" - static member CommitsSinceVersionSource = "5" - static member CommitDate = "2014-03-06" static member UncommittedChanges = "0" + static member VersionSourceSha = "versionSourceSha" + static member WeightedPreReleaseNumber = "4" diff --git a/src/GitVersion.Output.Tests/Output/Approved/vb/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt b/src/GitVersion.Output.Tests/Output/Approved/vb/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt index 38a749150f..200b58a1e2 100644 --- a/src/GitVersion.Output.Tests/Output/Approved/vb/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt +++ b/src/GitVersion.Output.Tests/Output/Approved/vb/GitVersionInfoGeneratorTests.ShouldCreateFile.approved.txt @@ -31,31 +31,31 @@ Namespace Global NotInheritable Class GitVersionInformation Private Sub New() End Sub + Public Shared AssemblySemFileVer As String = "1.2.3.0" + Public Shared AssemblySemVer As String = "1.2.3.0" + Public Shared BranchName As String = "feature1" + Public Shared BuildMetaData As String = "5" + Public Shared CommitDate As String = "2014-03-06" + Public Shared CommitsSinceVersionSource As String = "5" + Public Shared EscapedBranchName As String = "feature1" + Public Shared FullBuildMetaData As String = "5.Branch.feature1.Sha.commitSha" + Public Shared FullSemVer As String = "1.2.3-unstable.4+5" + Public Shared InformationalVersion As String = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha" Public Shared Major As String = "1" + Public Shared MajorMinorPatch As String = "1.2.3" Public Shared Minor As String = "2" Public Shared Patch As String = "3" - Public Shared PreReleaseTag As String = "unstable.4" - Public Shared PreReleaseTagWithDash As String = "-unstable.4" Public Shared PreReleaseLabel As String = "unstable" Public Shared PreReleaseLabelWithDash As String = "-unstable" Public Shared PreReleaseNumber As String = "4" - Public Shared WeightedPreReleaseNumber As String = "4" - Public Shared BuildMetaData As String = "5" - Public Shared FullBuildMetaData As String = "5.Branch.feature1.Sha.commitSha" - Public Shared MajorMinorPatch As String = "1.2.3" + Public Shared PreReleaseTag As String = "unstable.4" + Public Shared PreReleaseTagWithDash As String = "-unstable.4" Public Shared SemVer As String = "1.2.3-unstable.4" - Public Shared AssemblySemVer As String = "1.2.3.0" - Public Shared AssemblySemFileVer As String = "1.2.3.0" - Public Shared FullSemVer As String = "1.2.3-unstable.4+5" - Public Shared InformationalVersion As String = "1.2.3-unstable.4+5.Branch.feature1.Sha.commitSha" - Public Shared BranchName As String = "feature1" - Public Shared EscapedBranchName As String = "feature1" Public Shared Sha As String = "commitSha" Public Shared ShortSha As String = "commitShortSha" - Public Shared VersionSourceSha As String = "versionSourceSha" - Public Shared CommitsSinceVersionSource As String = "5" - Public Shared CommitDate As String = "2014-03-06" Public Shared UncommittedChanges As String = "0" + Public Shared VersionSourceSha As String = "versionSourceSha" + Public Shared WeightedPreReleaseNumber As String = "4" End Class End Namespace diff --git a/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs b/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs index d1ecdc9315..91f7cbd564 100644 --- a/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs +++ b/src/GitVersion.Output.Tests/Output/AssemblyInfoFileUpdaterTests.cs @@ -431,7 +431,7 @@ private void VerifyAssemblyInfoFile( string assemblyFileContent, string fileName, AssemblyVersioningScheme versioningScheme = AssemblyVersioningScheme.MajorMinorPatch, - Action? verify = null) + Action? verify = null) { this.fileSystem = Substitute.For(); var version = new SemanticVersion diff --git a/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs b/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs index bc664ac7c2..047b1b1e6a 100644 --- a/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs +++ b/src/GitVersion.Output.Tests/Output/ProjectFileUpdaterTests.cs @@ -283,7 +283,7 @@ private void VerifyAssemblyInfoFile( string projectFileContent, string fileName, AssemblyVersioningScheme versioningScheme = AssemblyVersioningScheme.MajorMinorPatch, - Action? verify = null) + Action? verify = null) { this.fileSystem = Substitute.For(); var version = new SemanticVersion diff --git a/src/GitVersion.Output/AssemblyInfo/AssemblyInfoContext.cs b/src/GitVersion.Output/AssemblyInfo/AssemblyInfoContext.cs index deacb81c8f..cf6d430f50 100644 --- a/src/GitVersion.Output/AssemblyInfo/AssemblyInfoContext.cs +++ b/src/GitVersion.Output/AssemblyInfo/AssemblyInfoContext.cs @@ -1,6 +1,6 @@ namespace GitVersion.Output.AssemblyInfo; -public readonly struct AssemblyInfoContext : IConverterContext +internal readonly struct AssemblyInfoContext : IConverterContext { public AssemblyInfoContext(string workingDirectory, bool ensureAssemblyInfo, params string[] assemblyInfoFiles) { diff --git a/src/GitVersion.Output/AssemblyInfo/AssemblyInfoFileUpdater.cs b/src/GitVersion.Output/AssemblyInfo/AssemblyInfoFileUpdater.cs index daca77d9b8..87fae94e7a 100644 --- a/src/GitVersion.Output/AssemblyInfo/AssemblyInfoFileUpdater.cs +++ b/src/GitVersion.Output/AssemblyInfo/AssemblyInfoFileUpdater.cs @@ -6,11 +6,11 @@ namespace GitVersion.Output.AssemblyInfo; -public interface IAssemblyInfoFileUpdater : IVersionConverter +internal interface IAssemblyInfoFileUpdater : IVersionConverter { } -public sealed class AssemblyInfoFileUpdater : IAssemblyInfoFileUpdater +internal sealed class AssemblyInfoFileUpdater : IAssemblyInfoFileUpdater { private readonly List restoreBackupTasks = new(); private readonly List cleanupBackupTasks = new(); @@ -39,7 +39,7 @@ public AssemblyInfoFileUpdater(ILog log, IFileSystem fileSystem) this.templateManager = new TemplateManager(TemplateType.AssemblyInfo); } - public void Execute(VersionVariables variables, AssemblyInfoContext context) + public void Execute(GitVersionVariables variables, AssemblyInfoContext context) { var assemblyInfoFiles = GetAssemblyInfoFiles(context).ToList(); this.log.Info("Updating assembly info files"); diff --git a/src/GitVersion.Output/AssemblyInfo/ProjectFileUpdater.cs b/src/GitVersion.Output/AssemblyInfo/ProjectFileUpdater.cs index bde8620161..5048b8d1c3 100644 --- a/src/GitVersion.Output/AssemblyInfo/ProjectFileUpdater.cs +++ b/src/GitVersion.Output/AssemblyInfo/ProjectFileUpdater.cs @@ -6,12 +6,12 @@ namespace GitVersion.Output.AssemblyInfo; -public interface IProjectFileUpdater : IVersionConverter +internal interface IProjectFileUpdater : IVersionConverter { bool CanUpdateProjectFile(XElement xmlRoot); } -public sealed class ProjectFileUpdater : IProjectFileUpdater +internal sealed class ProjectFileUpdater : IProjectFileUpdater { internal const string AssemblyVersionElement = "AssemblyVersion"; private const string FileVersionElement = "FileVersion"; @@ -30,7 +30,7 @@ public ProjectFileUpdater(ILog log, IFileSystem fileSystem) this.log = log; } - public void Execute(VersionVariables variables, AssemblyInfoContext context) + public void Execute(GitVersionVariables variables, AssemblyInfoContext context) { if (context.EnsureAssemblyInfo) throw new WarningException($"Configuration setting {nameof(context.EnsureAssemblyInfo)} is not valid when updating project files!"); diff --git a/src/GitVersion.Output/GitVersion.Output.csproj b/src/GitVersion.Output/GitVersion.Output.csproj index dd353f5de9..da36e3d835 100644 --- a/src/GitVersion.Output/GitVersion.Output.csproj +++ b/src/GitVersion.Output/GitVersion.Output.csproj @@ -1,15 +1,16 @@ - + - - - - + + + + - + + diff --git a/src/GitVersion.Output/GitVersionInfo/GitVersionInfoContext.cs b/src/GitVersion.Output/GitVersionInfo/GitVersionInfoContext.cs index cc02b10f7e..87c779261d 100644 --- a/src/GitVersion.Output/GitVersionInfo/GitVersionInfoContext.cs +++ b/src/GitVersion.Output/GitVersionInfo/GitVersionInfoContext.cs @@ -1,6 +1,6 @@ namespace GitVersion.Output.GitVersionInfo; -public readonly struct GitVersionInfoContext : IConverterContext +internal readonly struct GitVersionInfoContext : IConverterContext { public GitVersionInfoContext(string workingDirectory, string fileName, string fileExtension) { diff --git a/src/GitVersion.Output/GitVersionInfo/GitVersionInfoGenerator.cs b/src/GitVersion.Output/GitVersionInfo/GitVersionInfoGenerator.cs index 002f045b57..ae925b51a5 100644 --- a/src/GitVersion.Output/GitVersionInfo/GitVersionInfoGenerator.cs +++ b/src/GitVersion.Output/GitVersionInfo/GitVersionInfoGenerator.cs @@ -4,11 +4,11 @@ namespace GitVersion.Output.GitVersionInfo; -public interface IGitVersionInfoGenerator : IVersionConverter +internal interface IGitVersionInfoGenerator : IVersionConverter { } -public sealed class GitVersionInfoGenerator : IGitVersionInfoGenerator +internal sealed class GitVersionInfoGenerator : IGitVersionInfoGenerator { private readonly IFileSystem fileSystem; private readonly TemplateManager templateManager; @@ -19,7 +19,7 @@ public GitVersionInfoGenerator(IFileSystem fileSystem) this.templateManager = new TemplateManager(TemplateType.GitVersionInfo); } - public void Execute(VersionVariables variables, GitVersionInfoContext context) + public void Execute(GitVersionVariables variables, GitVersionInfoContext context) { var fileName = context.FileName; var directory = context.WorkingDirectory; @@ -41,7 +41,8 @@ public void Execute(VersionVariables variables, GitVersionInfoContext context) var indentation = GetIndentation(fileExtension); - var members = string.Join(System.Environment.NewLine, variables.Select(v => string.Format(indentation + addFormat, v.Key, v.Value))); + var lines = variables.OrderBy(x => x.Key).Select(v => string.Format(indentation + addFormat, v.Key, v.Value)); + var members = string.Join(System.Environment.NewLine, lines); var fileContents = string.Format(template, members); diff --git a/src/GitVersion.Output/GitVersionOutputTool.cs b/src/GitVersion.Output/GitVersionOutputTool.cs index f1fada236c..246ed81b60 100644 --- a/src/GitVersion.Output/GitVersionOutputTool.cs +++ b/src/GitVersion.Output/GitVersionOutputTool.cs @@ -8,7 +8,7 @@ namespace GitVersion; -public class GitVersionOutputTool : IGitVersionOutputTool +internal class GitVersionOutputTool : IGitVersionOutputTool { private readonly GitVersionOptions gitVersionOptions; private readonly IOutputGenerator outputGenerator; @@ -32,7 +32,7 @@ public GitVersionOutputTool(IOptions options, this.projectFileUpdater = projectFileUpdater.NotNull(); } - public void OutputVariables(VersionVariables variables, bool updateBuildNumber) + public void OutputVariables(GitVersionVariables variables, bool updateBuildNumber) { using (this.outputGenerator) { @@ -40,7 +40,7 @@ public void OutputVariables(VersionVariables variables, bool updateBuildNumber) } } - public void UpdateAssemblyInfo(VersionVariables variables) + public void UpdateAssemblyInfo(GitVersionVariables variables) { var assemblyInfoContext = new AssemblyInfoContext(gitVersionOptions.WorkingDirectory, gitVersionOptions.AssemblySettingsInfo.EnsureAssemblyInfo, gitVersionOptions.AssemblySettingsInfo.Files.ToArray()); @@ -60,7 +60,7 @@ public void UpdateAssemblyInfo(VersionVariables variables) } } - public void UpdateWixVersionFile(VersionVariables variables) + public void UpdateWixVersionFile(GitVersionVariables variables) { if (gitVersionOptions.WixInfo.UpdateWixVersionFile) { @@ -71,7 +71,7 @@ public void UpdateWixVersionFile(VersionVariables variables) } } - public void GenerateGitVersionInformation(VersionVariables variables, FileWriteInfo fileWriteInfo) + public void GenerateGitVersionInformation(GitVersionVariables variables, FileWriteInfo fileWriteInfo) { using (this.gitVersionInfoGenerator) { diff --git a/src/GitVersion.Output/IGitVersionOutputTool.cs b/src/GitVersion.Output/IGitVersionOutputTool.cs new file mode 100644 index 0000000000..514c878150 --- /dev/null +++ b/src/GitVersion.Output/IGitVersionOutputTool.cs @@ -0,0 +1,11 @@ +using GitVersion.OutputVariables; + +namespace GitVersion; + +public interface IGitVersionOutputTool +{ + void OutputVariables(GitVersionVariables variables, bool updateBuildNumber); + void UpdateAssemblyInfo(GitVersionVariables variables); + void UpdateWixVersionFile(GitVersionVariables variables); + void GenerateGitVersionInformation(GitVersionVariables variables, FileWriteInfo fileWriteInfo); +} diff --git a/src/GitVersion.Output/OutputGenerator/OutputContext.cs b/src/GitVersion.Output/OutputGenerator/OutputContext.cs index 42de7bd00a..3d6525ea9a 100644 --- a/src/GitVersion.Output/OutputGenerator/OutputContext.cs +++ b/src/GitVersion.Output/OutputGenerator/OutputContext.cs @@ -1,6 +1,6 @@ namespace GitVersion.Output.OutputGenerator; -public readonly struct OutputContext : IConverterContext +internal readonly struct OutputContext : IConverterContext { public OutputContext(string workingDirectory, string? outputFile, bool? updateBuildNumber) { diff --git a/src/GitVersion.Output/OutputGenerator/OutputGenerator.cs b/src/GitVersion.Output/OutputGenerator/OutputGenerator.cs index 9322ab1c5d..bc94dd98a2 100644 --- a/src/GitVersion.Output/OutputGenerator/OutputGenerator.cs +++ b/src/GitVersion.Output/OutputGenerator/OutputGenerator.cs @@ -7,11 +7,11 @@ namespace GitVersion.Output.OutputGenerator; -public interface IOutputGenerator : IVersionConverter +internal interface IOutputGenerator : IVersionConverter { } -public sealed class OutputGenerator : IOutputGenerator +internal sealed class OutputGenerator : IOutputGenerator { private readonly IConsole console; private readonly IFileSystem fileSystem; @@ -28,7 +28,7 @@ public OutputGenerator(ICurrentBuildAgent buildAgent, IConsole console, IFileSys this.buildAgent = buildAgent.NotNull(); } - public void Execute(VersionVariables variables, OutputContext context) + public void Execute(GitVersionVariables variables, OutputContext context) { var gitVersionOptions = this.options.Value; if (gitVersionOptions.Output.Contains(OutputType.BuildServer)) @@ -38,14 +38,14 @@ public void Execute(VersionVariables variables, OutputContext context) if (gitVersionOptions.Output.Contains(OutputType.File)) { var retryOperation = new RetryAction(); - retryOperation.Execute(() => this.fileSystem.WriteAllText(context.OutputFile, variables.ToString())); + retryOperation.Execute(() => this.fileSystem.WriteAllText(context.OutputFile, variables.ToJsonString())); } if (!gitVersionOptions.Output.Contains(OutputType.Json)) return; if (gitVersionOptions.ShowVariable is null && gitVersionOptions.Format is null) { - this.console.WriteLine(variables.ToString()); + this.console.WriteLine(variables.ToJsonString()); return; } diff --git a/src/GitVersion.Output/PublicAPI.Unshipped.txt b/src/GitVersion.Output/PublicAPI.Unshipped.txt index 7f53efbd7b..5a492ac2d7 100644 --- a/src/GitVersion.Output/PublicAPI.Unshipped.txt +++ b/src/GitVersion.Output/PublicAPI.Unshipped.txt @@ -1,60 +1,9 @@ #nullable enable -GitVersion.GitVersionOutputTool -GitVersion.GitVersionOutputTool.GenerateGitVersionInformation(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.FileWriteInfo! fileWriteInfo) -> void -GitVersion.GitVersionOutputTool.GitVersionOutputTool(Microsoft.Extensions.Options.IOptions! options, GitVersion.Output.OutputGenerator.IOutputGenerator! outputGenerator, GitVersion.Output.WixUpdater.IWixVersionFileUpdater! wixVersionFileUpdater, GitVersion.Output.GitVersionInfo.IGitVersionInfoGenerator! gitVersionInfoGenerator, GitVersion.Output.AssemblyInfo.IAssemblyInfoFileUpdater! assemblyInfoFileUpdater, GitVersion.Output.AssemblyInfo.IProjectFileUpdater! projectFileUpdater) -> void -GitVersion.GitVersionOutputTool.OutputVariables(GitVersion.OutputVariables.VersionVariables! variables, bool updateBuildNumber) -> void -GitVersion.GitVersionOutputTool.UpdateAssemblyInfo(GitVersion.OutputVariables.VersionVariables! variables) -> void -GitVersion.GitVersionOutputTool.UpdateWixVersionFile(GitVersion.OutputVariables.VersionVariables! variables) -> void -GitVersion.Output.AssemblyInfo.AssemblyInfoContext -GitVersion.Output.AssemblyInfo.AssemblyInfoContext.AssemblyInfoContext() -> void -GitVersion.Output.AssemblyInfo.AssemblyInfoContext.AssemblyInfoContext(string! workingDirectory, bool ensureAssemblyInfo, params string![]! assemblyInfoFiles) -> void -GitVersion.Output.AssemblyInfo.AssemblyInfoContext.AssemblyInfoFiles.get -> string![]! -GitVersion.Output.AssemblyInfo.AssemblyInfoContext.EnsureAssemblyInfo.get -> bool -GitVersion.Output.AssemblyInfo.AssemblyInfoContext.WorkingDirectory.get -> string! -GitVersion.Output.AssemblyInfo.AssemblyInfoFileUpdater -GitVersion.Output.AssemblyInfo.AssemblyInfoFileUpdater.AssemblyInfoFileUpdater(GitVersion.Logging.ILog! log, GitVersion.IFileSystem! fileSystem) -> void -GitVersion.Output.AssemblyInfo.AssemblyInfoFileUpdater.Dispose() -> void -GitVersion.Output.AssemblyInfo.AssemblyInfoFileUpdater.Execute(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.Output.AssemblyInfo.AssemblyInfoContext context) -> void -GitVersion.Output.AssemblyInfo.IAssemblyInfoFileUpdater -GitVersion.Output.AssemblyInfo.IProjectFileUpdater -GitVersion.Output.AssemblyInfo.IProjectFileUpdater.CanUpdateProjectFile(System.Xml.Linq.XElement! xmlRoot) -> bool -GitVersion.Output.AssemblyInfo.ProjectFileUpdater -GitVersion.Output.AssemblyInfo.ProjectFileUpdater.CanUpdateProjectFile(System.Xml.Linq.XElement! xmlRoot) -> bool -GitVersion.Output.AssemblyInfo.ProjectFileUpdater.Dispose() -> void -GitVersion.Output.AssemblyInfo.ProjectFileUpdater.Execute(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.Output.AssemblyInfo.AssemblyInfoContext context) -> void -GitVersion.Output.AssemblyInfo.ProjectFileUpdater.ProjectFileUpdater(GitVersion.Logging.ILog! log, GitVersion.IFileSystem! fileSystem) -> void -GitVersion.Output.GitVersionInfo.GitVersionInfoContext -GitVersion.Output.GitVersionInfo.GitVersionInfoContext.FileExtension.get -> string! -GitVersion.Output.GitVersionInfo.GitVersionInfoContext.FileName.get -> string! -GitVersion.Output.GitVersionInfo.GitVersionInfoContext.GitVersionInfoContext() -> void -GitVersion.Output.GitVersionInfo.GitVersionInfoContext.GitVersionInfoContext(string! workingDirectory, string! fileName, string! fileExtension) -> void -GitVersion.Output.GitVersionInfo.GitVersionInfoContext.WorkingDirectory.get -> string! -GitVersion.Output.GitVersionInfo.GitVersionInfoGenerator -GitVersion.Output.GitVersionInfo.GitVersionInfoGenerator.Dispose() -> void -GitVersion.Output.GitVersionInfo.GitVersionInfoGenerator.Execute(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.Output.GitVersionInfo.GitVersionInfoContext context) -> void -GitVersion.Output.GitVersionInfo.GitVersionInfoGenerator.GitVersionInfoGenerator(GitVersion.IFileSystem! fileSystem) -> void -GitVersion.Output.GitVersionInfo.IGitVersionInfoGenerator +GitVersion.IGitVersionOutputTool +GitVersion.IGitVersionOutputTool.GenerateGitVersionInformation(GitVersion.OutputVariables.GitVersionVariables! variables, GitVersion.FileWriteInfo! fileWriteInfo) -> void +GitVersion.IGitVersionOutputTool.OutputVariables(GitVersion.OutputVariables.GitVersionVariables! variables, bool updateBuildNumber) -> void +GitVersion.IGitVersionOutputTool.UpdateAssemblyInfo(GitVersion.OutputVariables.GitVersionVariables! variables) -> void +GitVersion.IGitVersionOutputTool.UpdateWixVersionFile(GitVersion.OutputVariables.GitVersionVariables! variables) -> void GitVersion.Output.GitVersionOutputModule GitVersion.Output.GitVersionOutputModule.GitVersionOutputModule() -> void GitVersion.Output.GitVersionOutputModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void -GitVersion.Output.OutputGenerator.IOutputGenerator -GitVersion.Output.OutputGenerator.OutputContext -GitVersion.Output.OutputGenerator.OutputContext.OutputContext() -> void -GitVersion.Output.OutputGenerator.OutputContext.OutputContext(string! workingDirectory, string? outputFile, bool? updateBuildNumber) -> void -GitVersion.Output.OutputGenerator.OutputContext.OutputFile.get -> string? -GitVersion.Output.OutputGenerator.OutputContext.UpdateBuildNumber.get -> bool? -GitVersion.Output.OutputGenerator.OutputContext.WorkingDirectory.get -> string! -GitVersion.Output.OutputGenerator.OutputGenerator -GitVersion.Output.OutputGenerator.OutputGenerator.Dispose() -> void -GitVersion.Output.OutputGenerator.OutputGenerator.Execute(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.Output.OutputGenerator.OutputContext context) -> void -GitVersion.Output.OutputGenerator.OutputGenerator.OutputGenerator(GitVersion.Agents.ICurrentBuildAgent! buildAgent, GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.IEnvironment! environment, Microsoft.Extensions.Options.IOptions! options) -> void -GitVersion.Output.WixUpdater.IWixVersionFileUpdater -GitVersion.Output.WixUpdater.WixVersionContext -GitVersion.Output.WixUpdater.WixVersionContext.WixVersionContext() -> void -GitVersion.Output.WixUpdater.WixVersionContext.WixVersionContext(string! workingDirectory) -> void -GitVersion.Output.WixUpdater.WixVersionContext.WorkingDirectory.get -> string! -GitVersion.Output.WixUpdater.WixVersionFileUpdater -GitVersion.Output.WixUpdater.WixVersionFileUpdater.Dispose() -> void -GitVersion.Output.WixUpdater.WixVersionFileUpdater.Execute(GitVersion.OutputVariables.VersionVariables! variables, GitVersion.Output.WixUpdater.WixVersionContext context) -> void -GitVersion.Output.WixUpdater.WixVersionFileUpdater.WixVersionFileUpdater(GitVersion.Logging.ILog! log, GitVersion.IFileSystem! fileSystem) -> void -const GitVersion.Output.WixUpdater.WixVersionFileUpdater.WixVersionFileName = "GitVersion_WixVersion.wxi" -> string! diff --git a/src/GitVersion.Output/WixUpdater/WixVersionContext.cs b/src/GitVersion.Output/WixUpdater/WixVersionContext.cs index e8d2ad1700..31741daff1 100644 --- a/src/GitVersion.Output/WixUpdater/WixVersionContext.cs +++ b/src/GitVersion.Output/WixUpdater/WixVersionContext.cs @@ -1,6 +1,6 @@ namespace GitVersion.Output.WixUpdater; -public readonly struct WixVersionContext : IConverterContext +internal readonly struct WixVersionContext : IConverterContext { public WixVersionContext(string workingDirectory) => WorkingDirectory = workingDirectory; diff --git a/src/GitVersion.Output/WixUpdater/WixVersionFileUpdater.cs b/src/GitVersion.Output/WixUpdater/WixVersionFileUpdater.cs index 9e0b84664a..060923c11d 100644 --- a/src/GitVersion.Output/WixUpdater/WixVersionFileUpdater.cs +++ b/src/GitVersion.Output/WixUpdater/WixVersionFileUpdater.cs @@ -5,10 +5,10 @@ namespace GitVersion.Output.WixUpdater; -public interface IWixVersionFileUpdater : IVersionConverter +internal interface IWixVersionFileUpdater : IVersionConverter { } -public sealed class WixVersionFileUpdater : IWixVersionFileUpdater +internal sealed class WixVersionFileUpdater : IWixVersionFileUpdater { private readonly IFileSystem fileSystem; private readonly ILog log; @@ -21,7 +21,7 @@ public WixVersionFileUpdater(ILog log, IFileSystem fileSystem) this.log = log.NotNull(); } - public void Execute(VersionVariables variables, WixVersionContext context) + public void Execute(GitVersionVariables variables, WixVersionContext context) { this.wixVersionFile = PathHelper.Combine(context.WorkingDirectory, WixVersionFileName); this.log.Info("Updating GitVersion_WixVersion.wxi"); @@ -38,15 +38,13 @@ public void Execute(VersionVariables variables, WixVersionContext context) doc.Save(fs); } - private static string GetWixFormatFromVersionVariables(VersionVariables variables) + private static string GetWixFormatFromVersionVariables(GitVersionVariables variables) { var builder = new StringBuilder(); builder.Append("\n"); - var availableVariables = VersionVariables.AvailableVariables; - foreach (var variable in availableVariables) + foreach (var (key, value) in variables.OrderBy(x => x.Key)) { - variables.TryGetValue(variable, out var value); - builder.Append("\t\n"); + builder.Append("\t\n"); } builder.Append("\n"); return builder.ToString(); diff --git a/src/GitVersion.sln b/src/GitVersion.sln index e0db85c449..4215961ae3 100644 --- a/src/GitVersion.sln +++ b/src/GitVersion.sln @@ -1,26 +1,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28714.193 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33502.453 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.App", "GitVersion.App\GitVersion.App.csproj", "{C3578A7B-09A6-4444-9383-0DEAFA4958BD}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.Core.Tests", "GitVersion.Core.Tests\GitVersion.Core.Tests.csproj", "{BF905F84-382C-440D-92F5-C61108626D8D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3EFFC5D6-88D0-49D9-BB53-E1B7EB49DD45}" - ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props - Directory.Packages.props = Directory.Packages.props - ..\.editorconfig = ..\.editorconfig - ..\.gitattributes = ..\.gitattributes - ..\.gitignore = ..\.gitignore - ..\GitVersion.yml = ..\GitVersion.yml - ..\schemas\6.0\GitVersion.configuration.json = ..\schemas\6.0\GitVersion.configuration.json - ..\schemas\6.0\GitVersion.json = ..\schemas\6.0\GitVersion.json - ..\LICENSE = ..\LICENSE - ..\README.md = ..\README.md - ..\CONTRIBUTING.md = ..\CONTRIBUTING.md - EndProjectSection -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.Core", "GitVersion.Core\GitVersion.Core.csproj", "{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.App.Tests", "GitVersion.App.Tests\GitVersion.App.Tests.csproj", "{75C2BE85-1DAF-4E34-8305-B17AFAA982A6}" @@ -33,17 +18,38 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.Testing", "GitVe EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.LibGit2Sharp", "GitVersion.LibGit2Sharp\GitVersion.LibGit2Sharp.csproj", "{093AFCF2-68F4-49B1-8173-7CB88467E783}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersion.BuildAgents", "GitVersion.BuildAgents\GitVersion.BuildAgents.csproj", "{B1C486D2-2B07-42D6-86AE-3F9AD50F27C8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.BuildAgents", "GitVersion.BuildAgents\GitVersion.BuildAgents.csproj", "{B1C486D2-2B07-42D6-86AE-3F9AD50F27C8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersion.BuildAgents.Tests", "GitVersion.BuildAgents.Tests\GitVersion.BuildAgents.Tests.csproj", "{85060C01-6DAF-48E9-9D7E-AEDA8FFEB0DD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.BuildAgents.Tests", "GitVersion.BuildAgents.Tests\GitVersion.BuildAgents.Tests.csproj", "{85060C01-6DAF-48E9-9D7E-AEDA8FFEB0DD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersion.Output", "GitVersion.Output\GitVersion.Output.csproj", "{843450BC-3A6D-4DA6-8520-2D9A9C8218AC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.Output", "GitVersion.Output\GitVersion.Output.csproj", "{843450BC-3A6D-4DA6-8520-2D9A9C8218AC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersion.Output.Tests", "GitVersion.Output.Tests\GitVersion.Output.Tests.csproj", "{13C60949-7225-4B08-BE63-CAAC5E25FD16}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.Output.Tests", "GitVersion.Output.Tests\GitVersion.Output.Tests.csproj", "{13C60949-7225-4B08-BE63-CAAC5E25FD16}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{69C36B9D-E496-42A2-B091-C055E999686C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitVersion.Schema", "GitVersion.Schema\GitVersion.Schema.csproj", "{22026A20-261C-4EF5-836C-EA6F6D37B5E3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.Schema", "GitVersion.Schema\GitVersion.Schema.csproj", "{22026A20-261C-4EF5-836C-EA6F6D37B5E3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sln", "sln", "{542E443E-14C3-45A7-A2E9-ACF27286A3B2}" + ProjectSection(SolutionItems) = preProject + Directory.Build.props = Directory.Build.props + Directory.Packages.props = Directory.Packages.props + ..\.editorconfig = ..\.editorconfig + ..\.gitattributes = ..\.gitattributes + ..\.gitignore = ..\.gitignore + ..\GitVersion.yml = ..\GitVersion.yml + ..\schemas\6.0\GitVersion.configuration.json = ..\schemas\6.0\GitVersion.configuration.json + ..\schemas\6.0\GitVersion.json = ..\schemas\6.0\GitVersion.json + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "readme", "readme", "{1F4BE015-699F-464A-8FF0-D8762102421A}" + ProjectSection(SolutionItems) = preProject + ..\BREAKING_CHANGES.md = ..\BREAKING_CHANGES.md + ..\CONTRIBUTING.md = ..\CONTRIBUTING.md + ..\LICENSE = ..\LICENSE + ..\README.md = ..\README.md + ..\SECURITY.md = ..\SECURITY.md + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -107,14 +113,15 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {0C1C310E-7A4D-4032-878B-6DC375894C49} - EndGlobalSection GlobalSection(NestedProjects) = preSolution + {093AFCF2-68F4-49B1-8173-7CB88467E783} = {69C36B9D-E496-42A2-B091-C055E999686C} {B1C486D2-2B07-42D6-86AE-3F9AD50F27C8} = {69C36B9D-E496-42A2-B091-C055E999686C} {85060C01-6DAF-48E9-9D7E-AEDA8FFEB0DD} = {69C36B9D-E496-42A2-B091-C055E999686C} {843450BC-3A6D-4DA6-8520-2D9A9C8218AC} = {69C36B9D-E496-42A2-B091-C055E999686C} {13C60949-7225-4B08-BE63-CAAC5E25FD16} = {69C36B9D-E496-42A2-B091-C055E999686C} - {093AFCF2-68F4-49B1-8173-7CB88467E783} = {69C36B9D-E496-42A2-B091-C055E999686C} + {1F4BE015-699F-464A-8FF0-D8762102421A} = {542E443E-14C3-45A7-A2E9-ACF27286A3B2} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0C1C310E-7A4D-4032-878B-6DC375894C49} EndGlobalSection EndGlobal