Skip to content

Commit 28d075c

Browse files
committed
Rename Config to Configuration and ConfigInfo to ConfigurationContext
1 parent 062bfc4 commit 28d075c

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

src/GitVersion.App/Arguments.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public GitVersionOptions ToOptions()
6060

6161
ConfigInfo =
6262
{
63-
ConfigFile = ConfigFile,
63+
ConfigurationFile = ConfigFile,
6464
OverrideConfiguration = OverrideConfig,
65-
ShowConfig = ShowConfig
65+
ShowConfiguration = ShowConfig
6666
},
6767

6868
RepositoryInfo =

src/GitVersion.App/GitVersionExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private bool HandleNonMainCommand(GitVersionOptions gitVersionOptions, out int e
152152
return true;
153153
}
154154

155-
if (gitVersionOptions.ConfigInfo.ShowConfig)
155+
if (gitVersionOptions.ConfigInfo.ShowConfiguration)
156156
{
157157
var configuration = this.configurationProvider.Provide();
158158
this.console.WriteLine(configuration.ToString());

src/GitVersion.Core.Tests/Configuration/ConfigurationFileLocatorTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public class NamedConfigurationFileLocatorTests : TestBase
8484
[SetUp]
8585
public void Setup()
8686
{
87-
this.gitVersionOptions = new GitVersionOptions { ConfigInfo = { ConfigFile = "my-config.yaml" } };
87+
this.gitVersionOptions = new GitVersionOptions { ConfigInfo = { ConfigurationFile = "my-config.yaml" } };
8888
this.repoPath = DefaultRepoPath;
8989
this.workingPath = DefaultWorkingPath;
9090

@@ -140,7 +140,7 @@ public void DoNotThrowWhenConfigFileIsInSubDirectoryOfRepoPath()
140140
{
141141
this.workingPath = DefaultRepoPath;
142142

143-
this.gitVersionOptions = new GitVersionOptions { ConfigInfo = { ConfigFile = "./src/my-config.yaml" } };
143+
this.gitVersionOptions = new GitVersionOptions { ConfigInfo = { ConfigurationFile = "./src/my-config.yaml" } };
144144
var sp = GetServiceProvider(this.gitVersionOptions);
145145
this.configFileLocator = sp.GetRequiredService<IConfigurationFileLocator>();
146146
this.fileSystem = sp.GetRequiredService<IFileSystem>();
@@ -200,8 +200,8 @@ public void ThrowsExceptionOnCustomYmlFileDoesNotExist()
200200

201201
var exception = Should.Throw<WarningException>(() => this.configFileLocator.Verify(this.workingPath, this.repoPath));
202202

203-
var workingPathFileConfig = PathHelper.Combine(this.workingPath, this.gitVersionOptions.ConfigInfo.ConfigFile);
204-
var repoPathFileConfig = PathHelper.Combine(this.repoPath, this.gitVersionOptions.ConfigInfo.ConfigFile);
203+
var workingPathFileConfig = PathHelper.Combine(this.workingPath, this.gitVersionOptions.ConfigInfo.ConfigurationFile);
204+
var repoPathFileConfig = PathHelper.Combine(this.repoPath, this.gitVersionOptions.ConfigInfo.ConfigurationFile);
205205
var expectedMessage = $"The configuration file was not found at '{workingPathFileConfig}' or '{repoPathFileConfig}'";
206206
exception.Message.ShouldBe(expectedMessage);
207207
}

src/GitVersion.Core/ConfigInfo.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/GitVersion.Core/Configuration/ConfigurationFileLocator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class ConfigurationFileLocator : IConfigurationFileLocator
1212
public ConfigurationFileLocator(IFileSystem fileSystem, IOptions<GitVersionOptions> options)
1313
{
1414
this.fileSystem = fileSystem;
15-
var configFile = options.Value.ConfigInfo.ConfigFile;
15+
var configFile = options.Value.ConfigInfo.ConfigurationFile;
1616
FilePath = !configFile.IsNullOrWhiteSpace() ? configFile : DefaultFileName;
1717
}
1818

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace GitVersion;
2+
3+
public class ConfigurationContext
4+
{
5+
public string? ConfigurationFile;
6+
public IReadOnlyDictionary<object, object?>? OverrideConfiguration;
7+
public bool ShowConfiguration;
8+
}

src/GitVersion.Core/GitVersionOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class GitVersionOptions
88

99
public AssemblyInfoData AssemblyInfo { get; } = new();
1010
public AuthenticationInfo Authentication { get; } = new();
11-
public ConfigInfo ConfigInfo { get; } = new();
11+
public ConfigurationContext ConfigInfo { get; } = new();
1212
public RepositoryInfo RepositoryInfo { get; } = new();
1313
public WixInfo WixInfo { get; } = new();
1414
public Settings Settings { get; } = new();

src/GitVersion.Core/PublicAPI.Unshipped.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ GitVersion.Common.IRepositoryStore.GetTargetBranch(string? targetBranchName) ->
7979
GitVersion.Common.IRepositoryStore.GetValidVersionTags(string? tagPrefixRegex, GitVersion.SemanticVersionFormat versionFormat, System.DateTimeOffset? olderThan = null) -> System.Collections.Generic.IEnumerable<(GitVersion.ITag! Tag, GitVersion.SemanticVersion! Semver, GitVersion.ICommit! Commit)>!
8080
GitVersion.Common.IRepositoryStore.GetVersionTagsOnBranch(GitVersion.IBranch! branch, string? tagPrefixRegex, GitVersion.SemanticVersionFormat versionFormat) -> System.Collections.Generic.IEnumerable<GitVersion.SemanticVersion!>!
8181
GitVersion.Common.IRepositoryStore.IsCommitOnBranch(GitVersion.ICommit? baseVersionSource, GitVersion.IBranch! branch, GitVersion.ICommit! firstMatchingCommit) -> bool
82-
GitVersion.ConfigInfo
83-
GitVersion.ConfigInfo.ConfigFile -> string?
84-
GitVersion.ConfigInfo.ConfigInfo() -> void
85-
GitVersion.ConfigInfo.OverrideConfiguration -> System.Collections.Generic.IReadOnlyDictionary<object!, object?>?
86-
GitVersion.ConfigInfo.ShowConfig -> bool
8782
GitVersion.Configuration.BranchConfiguration
8883
GitVersion.Configuration.BranchConfiguration.BranchConfiguration() -> void
8984
GitVersion.Configuration.BranchConfiguration.BranchConfiguration(GitVersion.Configuration.BranchConfiguration! branchConfiguration) -> void
@@ -288,6 +283,11 @@ GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step
288283
GitVersion.Configuration.Init.Wizard.PickBranchingStrategy3Step.PickBranchingStrategy3Step(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void
289284
GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep
290285
GitVersion.Configuration.Init.Wizard.PickBranchingStrategyStep.PickBranchingStrategyStep(GitVersion.Logging.IConsole! console, GitVersion.IFileSystem! fileSystem, GitVersion.Logging.ILog! log, GitVersion.Configuration.Init.Wizard.IConfigInitStepFactory! stepFactory) -> void
286+
GitVersion.ConfigurationContext
287+
GitVersion.ConfigurationContext.ConfigurationContext() -> void
288+
GitVersion.ConfigurationContext.ConfigurationFile -> string?
289+
GitVersion.ConfigurationContext.OverrideConfiguration -> System.Collections.Generic.IReadOnlyDictionary<object!, object?>?
290+
GitVersion.ConfigurationContext.ShowConfiguration -> bool
291291
GitVersion.Environment
292292
GitVersion.Environment.Environment() -> void
293293
GitVersion.Environment.GetEnvironmentVariable(string! variableName) -> string?
@@ -370,7 +370,7 @@ GitVersion.GitVersionModule.GitVersionModule() -> void
370370
GitVersion.GitVersionOptions
371371
GitVersion.GitVersionOptions.AssemblyInfo.get -> GitVersion.AssemblyInfoData!
372372
GitVersion.GitVersionOptions.Authentication.get -> GitVersion.AuthenticationInfo!
373-
GitVersion.GitVersionOptions.ConfigInfo.get -> GitVersion.ConfigInfo!
373+
GitVersion.GitVersionOptions.ConfigInfo.get -> GitVersion.ConfigurationContext!
374374
GitVersion.GitVersionOptions.Diag -> bool
375375
GitVersion.GitVersionOptions.GitVersionOptions() -> void
376376
GitVersion.GitVersionOptions.Init -> bool

0 commit comments

Comments
 (0)