Skip to content

Commit c4d8260

Browse files
authored
Merge pull request #3398 from arturcic/main
Move output (VersionConverters) to its own module
2 parents 02982a3 + 7b0015b commit c4d8260

File tree

79 files changed

+166
-110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+166
-110
lines changed

src/GitVersion.App.Tests/ArgumentParserTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ public void OverrideConfigWithSingleOptions(string options, GitVersionConfigurat
393393
{
394394
var arguments = this.argumentParser.ParseArguments($"/overrideconfig {options}");
395395

396-
ConfigurationHelper configruationHelper = new(arguments.OverrideConfig);
397-
configruationHelper.Configuration.ShouldBeEquivalentTo(expected);
396+
ConfigurationHelper configurationHelper = new(arguments.OverrideConfig);
397+
configurationHelper.Configuration.ShouldBeEquivalentTo(expected);
398398
}
399399

400400
private static IEnumerable<TestCaseData> OverrideConfigWithSingleOptionTestData()

src/GitVersion.App.Tests/PullRequestInBuildAgentTest.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using GitVersion.BuildAgents;
22
using GitVersion.Core.Tests.Helpers;
33
using GitVersion.Extensions;
4+
using GitVersion.Output;
45
using LibGit2Sharp;
56

67
namespace GitVersion.App.Tests;
@@ -167,7 +168,11 @@ private static async Task VerifyPullRequestVersionIsCalculatedProperly(string pu
167168
}
168169

169170
var programFixture = new ProgramFixture(fixture.RepositoryPath);
170-
programFixture.WithOverrides(services => services.AddModule(new GitVersionBuildAgentsModule()));
171+
programFixture.WithOverrides(services =>
172+
{
173+
services.AddModule(new GitVersionBuildAgentsModule());
174+
services.AddModule(new GitVersionOutputModule());
175+
});
171176
programFixture.WithEnv(env.ToArray());
172177

173178
var result = await programFixture.Run();

src/GitVersion.App.Tests/UpdateWixVersionFileTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using GitVersion.Helpers;
2+
using GitVersion.Output.WixUpdater;
23
using GitVersion.OutputVariables;
3-
using GitVersion.VersionConverters.WixUpdater;
44

55
namespace GitVersion.App.Tests;
66

src/GitVersion.App/GitVersion.App.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<ProjectReference Include="..\GitVersion.BuildAgents\GitVersion.BuildAgents.csproj" />
3030
<ProjectReference Include="..\GitVersion.LibGit2Sharp\GitVersion.LibGit2Sharp.csproj" />
3131
<ProjectReference Include="..\GitVersion.Core\GitVersion.Core.csproj" />
32+
<ProjectReference Include="..\GitVersion.Output\GitVersion.Output.csproj" />
3233
</ItemGroup>
3334

3435
<ItemGroup>

src/GitVersion.App/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using GitVersion.BuildAgents;
22
using GitVersion.Extensions;
3+
using GitVersion.Output;
34
using Microsoft.Extensions.Configuration;
45
using Microsoft.Extensions.DependencyInjection;
56
using Microsoft.Extensions.Hosting;
@@ -25,6 +26,7 @@ private IHostBuilder CreateHostBuilder(string[] args) =>
2526
services.AddModule(new GitVersionCoreModule());
2627
services.AddModule(new GitVersionLibGit2SharpModule());
2728
services.AddModule(new GitVersionBuildAgentsModule());
29+
services.AddModule(new GitVersionOutputModule());
2830
services.AddModule(new GitVersionAppModule());
2931

3032
services.AddSingleton(sp =>

src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<ProjectReference Include="..\GitVersion.BuildAgents\GitVersion.BuildAgents.csproj" />
1717
<ProjectReference Include="..\GitVersion.LibGit2Sharp\GitVersion.LibGit2Sharp.csproj" />
1818
<ProjectReference Include="..\GitVersion.Core\GitVersion.Core.csproj" />
19+
<ProjectReference Include="..\GitVersion.Output\GitVersion.Output.csproj" />
1920
</ItemGroup>
2021
<ItemGroup>
2122
<Content Include="VersionCalculation\Approved\**\*.approved.txt" />

src/GitVersion.Core.Tests/Helpers/GitVersionCoreTestModule.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using GitVersion.BuildAgents;
22
using GitVersion.Extensions;
33
using GitVersion.Logging;
4+
using GitVersion.Output;
45
using Microsoft.Extensions.DependencyInjection;
56

67
namespace GitVersion.Core.Tests.Helpers;
@@ -11,6 +12,7 @@ public void RegisterTypes(IServiceCollection services)
1112
{
1213
services.AddModule(new GitVersionLibGit2SharpModule());
1314
services.AddModule(new GitVersionBuildAgentsModule());
15+
services.AddModule(new GitVersionOutputModule());
1416
services.AddModule(new GitVersionCoreModule());
1517

1618
services.AddSingleton<IFileSystem, TestFileSystem>();

src/GitVersion.Core/Extensions/CommonExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ namespace GitVersion.Extensions;
55

66
public static class CommonExtensions
77
{
8-
public static T NotNull<T>([NotNull] this T? value, [CallerArgumentExpression("value")] string name = "")
8+
public static T NotNull<T>([NotNull] this T? value, [CallerArgumentExpression(nameof(value))] string name = "")
99
where T : class => value ?? throw new ArgumentNullException(name);
1010

11-
public static string NotNullOrEmpty([NotNull] this string? value, [CallerArgumentExpression("value")] string name = "")
11+
public static string NotNullOrEmpty([NotNull] this string? value, [CallerArgumentExpression(nameof(value))] string name = "")
1212
{
1313
if (string.IsNullOrEmpty(value))
1414
{
@@ -18,7 +18,7 @@ public static string NotNullOrEmpty([NotNull] this string? value, [CallerArgumen
1818
return value;
1919
}
2020

21-
public static string NotNullOrWhitespace([NotNull] this string? value, [CallerArgumentExpression("value")] string name = "")
21+
public static string NotNullOrWhitespace([NotNull] this string? value, [CallerArgumentExpression(nameof(value))] string name = "")
2222
{
2323
if (string.IsNullOrWhiteSpace(value))
2424
{

src/GitVersion.Core/GitVersion.Core.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@
2121
<PackageReference Include="YamlDotNet" />
2222
</ItemGroup>
2323

24-
<ItemGroup>
25-
<Compile Remove="VersionConverters\*\AddFormats\**\*.*" />
26-
<Compile Remove="VersionConverters\*\Templates\**\*.*" />
27-
<EmbeddedResource Include="VersionConverters\*\AddFormats\**\*.*" />
28-
<EmbeddedResource Include="VersionConverters\*\Templates\**\*.*" />
29-
</ItemGroup>
30-
3124
<ItemGroup>
3225
<InternalsVisibleTo Include="GitVersion.Core.Tests" />
3326
<InternalsVisibleTo Include="GitVersion.App.Tests" />

src/GitVersion.Core/GitVersionCommonModule.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ public void RegisterTypes(IServiceCollection services)
1313
services.AddSingleton<IEnvironment, Environment>();
1414
services.AddSingleton<IConsole, ConsoleAdapter>();
1515

16-
services.AddSingleton<IGitVersionOutputTool, GitVersionOutputTool>();
17-
1816
services.AddSingleton<IBuildAgent, LocalBuild>();
1917
services.AddSingleton<IBuildAgentResolver, BuildAgentResolver>();
2018
services.AddSingleton(sp => sp.GetRequiredService<IBuildAgentResolver>().Resolve());

0 commit comments

Comments
 (0)