Skip to content

Commit 50d6bfc

Browse files
committed
Extract GitVersion Configuration into a separate project
The major change in this commit is the extraction of the GitVersion configuration-related code into a separate project. This includes branch configuration, GitFlow and GitHub workflows, caching strategies and modules. In the refactored structure, other projects now reference this configuration project. The definition of the `IBranchConfiguration` has changed and includes a new method for providing an empty configuration. Some necessary code and file shifting has occurred to support this new structure.
1 parent 3f9fc42 commit 50d6bfc

File tree

70 files changed

+86
-45
lines changed

Some content is hidden

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

70 files changed

+86
-45
lines changed

src/GitVersion.App.Tests/GitVersion.App.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
55
</ItemGroup>
66
<ItemGroup>
7+
<ProjectReference Include="..\GitVersion.Configuration\GitVersion.Configuration.csproj" />
78
<ProjectReference Include="..\GitVersion.Core\GitVersion.Core.csproj" />
89
<ProjectReference Include="..\GitVersion.App\GitVersion.App.csproj" />
910
</ItemGroup>

src/GitVersion.App/GitVersion.App.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
<ItemGroup>
2929
<ProjectReference Include="..\GitVersion.BuildAgents\GitVersion.BuildAgents.csproj" />
30+
<ProjectReference Include="..\GitVersion.Configuration\GitVersion.Configuration.csproj" />
3031
<ProjectReference Include="..\GitVersion.LibGit2Sharp\GitVersion.LibGit2Sharp.csproj" />
3132
<ProjectReference Include="..\GitVersion.Core\GitVersion.Core.csproj" />
3233
<ProjectReference Include="..\GitVersion.Output\GitVersion.Output.csproj" />

src/GitVersion.App/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using GitVersion.Agents;
2+
using GitVersion.Configuration;
23
using GitVersion.Extensions;
34
using GitVersion.Output;
45
using Microsoft.Extensions.Configuration;
@@ -26,6 +27,7 @@ private IHostBuilder CreateHostBuilder(string[] args) =>
2627
services.AddModule(new GitVersionCoreModule());
2728
services.AddModule(new GitVersionLibGit2SharpModule());
2829
services.AddModule(new GitVersionBuildAgentsModule());
30+
services.AddModule(new GitVersionConfigurationModule());
2931
services.AddModule(new GitVersionOutputModule());
3032
services.AddModule(new GitVersionAppModule());
3133

src/GitVersion.Core/Configuration/BranchConfiguration.cs renamed to src/GitVersion.Configuration/BranchConfiguration.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,11 @@ public virtual IBranchConfiguration Inherit(IBranchConfiguration configuration)
9898
PreReleaseWeight = PreReleaseWeight ?? configuration.PreReleaseWeight
9999
};
100100
}
101+
102+
public IBranchConfiguration Empty() => new BranchConfiguration
103+
{
104+
RegularExpression = string.Empty,
105+
Label = ConfigurationConstants.BranchNamePlaceholder,
106+
Increment = IncrementStrategy.Inherit
107+
};
101108
}

0 commit comments

Comments
 (0)