Skip to content

Commit

Permalink
#3231 switch to central package management
Browse files Browse the repository at this point in the history
  • Loading branch information
arturcic committed Oct 15, 2022
1 parent fd6ec5f commit 8f6d714
Show file tree
Hide file tree
Showing 15 changed files with 109 additions and 104 deletions.
65 changes: 26 additions & 39 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,57 +28,44 @@
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>

</PropertyGroup>
<PropertyGroup>
<PackageVersion_LibGit2Sharp>0.27.0-preview-0182</PackageVersion_LibGit2Sharp>
<PackageVersion_LibGit2Sharp_NativeBinaries>2.0.315-alpha.0.9</PackageVersion_LibGit2Sharp_NativeBinaries>

<PackageVersion_JetBrainsAnnotations>2022.1.0</PackageVersion_JetBrainsAnnotations>
<PackageVersion_YamlDotNet>12.0.2</PackageVersion_YamlDotNet>
<PackageVersion_MicrosoftExtensions>6.0.0</PackageVersion_MicrosoftExtensions>
<PackageVersion_MicrosoftJson>6.0.0</PackageVersion_MicrosoftJson>
<PackageVersion_MicrosoftTextEncoding>6.0.0</PackageVersion_MicrosoftTextEncoding>
<PackageVersion_MsBuild>17.3.1</PackageVersion_MsBuild>

<PackageVersion_MicrosoftTestSdk>17.3.2</PackageVersion_MicrosoftTestSdk>
<PackageVersion_NSubstitute>4.4.0</PackageVersion_NSubstitute>
<PackageVersion_CoverletMsBuild>3.1.2</PackageVersion_CoverletMsBuild>
<PackageVersion_NUnit>3.13.3</PackageVersion_NUnit>
<PackageVersion_NUnit3TestAdapter>4.2.1</PackageVersion_NUnit3TestAdapter>
<PackageVersion_JunitXmlTestLogger>3.0.114</PackageVersion_JunitXmlTestLogger>
<PackageVersion_Shouldly>4.1.0</PackageVersion_Shouldly>
<PackageVersion_MicrosoftPublicApiAnalyzers>3.3.3</PackageVersion_MicrosoftPublicApiAnalyzers>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json"/>
<PackageReference Include="System.Text.Encodings.Web"/>
</ItemGroup>
<ItemGroup Condition=" '$(IsTestProject)' == 'false' ">
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition=" '$(IsTestProject)' == 'true' ">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(PackageVersion_MicrosoftTestSdk)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="System.Text.Json" Version="$(PackageVersion_MicrosoftJson)" />
<PackageReference Include="System.Text.Encodings.Web" Version="$(PackageVersion_MicrosoftTextEncoding)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection"/>
<PackageReference Include="Microsoft.NET.Test.Sdk"/>

<PackageReference Include="JetBrains.Annotations" Version="$(PackageVersion_JetBrainsAnnotations)" />
<PackageReference Include="NSubstitute" Version="$(PackageVersion_NSubstitute)" />
<PackageReference Include="JetBrains.Annotations"/>
<PackageReference Include="NSubstitute"/>

<PackageReference Include="NUnit" Version="$(PackageVersion_NUnit)" />
<PackageReference Include="NUnit3TestAdapter" Version="$(PackageVersion_NUnit3TestAdapter)" />
<PackageReference Include="JunitXml.TestLogger" Version="$(PackageVersion_JunitXmlTestLogger)" />
<PackageReference Include="Shouldly" Version="$(PackageVersion_Shouldly)" />
<PackageReference Include="NUnit"/>
<PackageReference Include="NUnit3TestAdapter"/>
<PackageReference Include="JunitXml.TestLogger"/>
<PackageReference Include="Shouldly"/>

<PackageReference Include="coverlet.msbuild" Version="$(PackageVersion_CoverletMsBuild)">
<PackageReference Include="coverlet.msbuild">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

<ProjectReference Include="..\GitTools.Testing\GitTools.Testing.csproj" />
<ProjectReference Include="..\GitTools.Testing\GitTools.Testing.csproj"/>

</ItemGroup>

<ItemGroup>
<Using Include="System.Collections" />
<Using Include="System.Collections.Specialized" />
<Using Include="System.Diagnostics" />
<Using Include="System.Reflection" />
<Using Include="System.Text" />
<Using Include="System.Xml" />
<Using Include="System.Collections"/>
<Using Include="System.Collections.Specialized"/>
<Using Include="System.Diagnostics"/>
<Using Include="System.Reflection"/>
<Using Include="System.Text"/>
<Using Include="System.Xml"/>
</ItemGroup>

<ItemGroup>
Expand Down
40 changes: 40 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="FluentDateTime" Version="2.1.0"/>
<PackageVersion Include="LibGit2Sharp" Version="0.27.0-preview-0182"/>
<PackageVersion Include="LibGit2Sharp.NativeBinaries" Version="2.0.315-alpha.0.9"/>
<PackageVersion Include="JetBrains.Annotations" Version="2022.1.0"/>

<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.3.1"/>
<PackageVersion Include="Microsoft.Build" Version="17.3.1"/>
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.3"/>
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0"/>
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="6.0.0"/>
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="6.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Options" Version="6.0.0"/>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.3.2"/>
<PackageVersion Include="Microsoft.Win32.Registry" Version="6.0.0-preview.5.21301.5"/>

<PackageVersion Include="Mono.Cecil" Version="0.11.4"/>

<PackageVersion Include="Buildalyzer" Version="4.1.5"/>
<PackageVersion Include="coverlet.msbuild" Version="3.1.2"/>
<PackageVersion Include="MSBuild.ProjectCreation" Version="8.3.0"/>
<PackageVersion Include="NSubstitute" Version="4.4.0"/>
<PackageVersion Include="NUnit" Version="3.13.3"/>
<PackageVersion Include="NUnit3TestAdapter" Version="4.2.1"/>
<PackageVersion Include="JunitXml.TestLogger" Version="3.0.114"/>
<PackageVersion Include="Shouldly" Version="4.1.0"/>

<PackageVersion Include="Polly" Version="7.2.3"/>

<PackageVersion Include="System.Net.Requests" Version="4.3.0"/>
<PackageVersion Include="System.Text.Json" Version="6.0.0"/>
<PackageVersion Include="System.Text.Encodings.Web" Version="6.0.0"/>
<PackageVersion Include="YamlDotNet" Version="12.0.2"/>
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/GitTools.Testing/GitTools.Testing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LibGit2Sharp" Version="$(PackageVersion_LibGit2Sharp)" />
<PackageReference Include="JetBrains.Annotations" Version="$(PackageVersion_JetBrainsAnnotations)" PrivateAssets="All" />
<PackageReference Include="LibGit2Sharp" />
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/GitVersion.App.Tests/GitVersion.App.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
<PackageReference Include="Mono.Cecil"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitVersion.Core\GitVersion.Core.csproj" />
Expand Down
18 changes: 6 additions & 12 deletions src/GitVersion.App/GitVersion.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,20 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(PackageVersion_MicrosoftPublicApiAnalyzers)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Json" Version="$(PackageVersion_MicrosoftJson)" />
<PackageReference Include="System.Text.Encodings.Web" Version="$(PackageVersion_MicrosoftJson)" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="Microsoft.Extensions.Hosting"/>
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GitVersion.LibGit2Sharp\GitVersion.LibGit2Sharp.csproj" />
<ProjectReference Include="..\GitVersion.Core\GitVersion.Core.csproj" />
<ProjectReference Include="..\GitVersion.LibGit2Sharp\GitVersion.LibGit2Sharp.csproj"/>
<ProjectReference Include="..\GitVersion.Core\GitVersion.Core.csproj"/>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="../../docs/input/docs/usage/cli/arguments.md" />
<EmbeddedResource Include="../../docs/input/docs/usage/cli/arguments.md"/>
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="GitVersion.App.Tests" />
<InternalsVisibleTo Include="GitVersion.App.Tests"/>
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions src/GitVersion.Core.Tests/GitVersion.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentDateTime" Version="2.1.0" />
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="$(PackageVersion_LibGit2Sharp_NativeBinaries)" />
<PackageReference Include="Microsoft.Extensions.Options" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="YamlDotNet" Version="$(PackageVersion_YamlDotNet)" />
<PackageReference Include="FluentDateTime" />
<PackageReference Include="LibGit2Sharp.NativeBinaries" />
<PackageReference Include="Microsoft.Extensions.Options" />
<PackageReference Include="YamlDotNet" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitVersion.LibGit2Sharp\GitVersion.LibGit2Sharp.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using GitTools.Testing;
using GitVersion.Core.Tests.Helpers;
using GitVersion.Core.Tests.IntegrationTests;
using GitVersion.VersionCalculation;
using LibGit2Sharp;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -16,7 +15,7 @@ public class VersionSourceTests : TestBase
public void VersionSourceSha()
{
using var fixture = new EmptyRepositoryFixture();
var initialCommit = fixture.Repository.MakeACommit();
_ = fixture.Repository.MakeACommit();
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
_ = fixture.Repository.MakeACommit();
var featureBranch = fixture.Repository.CreateBranch("feature/foo");
Expand All @@ -36,7 +35,7 @@ public void VersionSourceSha()
public void VersionSourceShaOneCommit()
{
using var fixture = new EmptyRepositoryFixture();
var initialCommit = fixture.Repository.MakeACommit();
_ = fixture.Repository.MakeACommit();

var nextVersionCalculator = GetNextVersionCalculator(fixture);

Expand Down
2 changes: 1 addition & 1 deletion src/GitVersion.Core/Core/MainlineBranchFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public IDictionary<string, List<IBranch>> FindMainlineBranches(ICommit commit)
private bool BranchIsMainline(INamedReference branch)
{
var matcher = new MainlineConfigBranchMatcher(branch, this.log);
return this.mainlineBranchConfigurations.Any(matcher.IsMainline) == true;
return this.mainlineBranchConfigurations.Any(matcher.IsMainline);
}

private class MainlineConfigBranchMatcher
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersion.Core/Core/RepositoryStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public IEnumerable<IBranch> GetSourceBranches(IBranch branch, Config configurati
{
foreach (var branchCommit in FindCommitBranchesWasBranchedFrom(branch, configuration, excludedBranches))
{
foreach (var item in referenceLookup[branchCommit.Commit.Sha]
foreach (var _ in referenceLookup[branchCommit.Commit.Sha]
.Where(r => r.Name.Friendly == branchCommit.Branch.Name.Friendly))
{
if (returnedBranches.Add(branchCommit.Branch))
Expand Down
36 changes: 15 additions & 21 deletions src/GitVersion.Core/GitVersion.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,26 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Polly" Version="7.2.3" />
<PackageReference Include="System.Net.Requests" Version="4.3.0" />

<PackageReference Include="JetBrains.Annotations" Version="$(PackageVersion_JetBrainsAnnotations)" PrivateAssets="All" />
<PackageReference Include="System.Text.Json" Version="$(PackageVersion_MicrosoftJson)" />
<PackageReference Include="System.Text.Encodings.Web" Version="$(PackageVersion_MicrosoftJson)" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(PackageVersion_MicrosoftPublicApiAnalyzers)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="Microsoft.Extensions.Options" Version="$(PackageVersion_MicrosoftExtensions)" />
<PackageReference Include="YamlDotNet" Version="$(PackageVersion_YamlDotNet)" />
<PackageReference Include="Polly"/>
<PackageReference Include="System.Net.Requests"/>

<PackageReference Include="JetBrains.Annotations" PrivateAssets="All"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions"/>
<PackageReference Include="Microsoft.Extensions.Options"/>
<PackageReference Include="YamlDotNet"/>
</ItemGroup>

<ItemGroup>
<Compile Remove="VersionConverters\*\AddFormats\**\*.*" />
<Compile Remove="VersionConverters\*\Templates\**\*.*" />
<EmbeddedResource Include="VersionConverters\*\AddFormats\**\*.*" />
<EmbeddedResource Include="VersionConverters\*\Templates\**\*.*" />
<Compile Remove="VersionConverters\*\AddFormats\**\*.*"/>
<Compile Remove="VersionConverters\*\Templates\**\*.*"/>
<EmbeddedResource Include="VersionConverters\*\AddFormats\**\*.*"/>
<EmbeddedResource Include="VersionConverters\*\Templates\**\*.*"/>
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="GitVersion.Core.Tests" />
<InternalsVisibleTo Include="GitVersion.App.Tests" />
<InternalsVisibleTo Include="GitVersion.MsBuild.Tests" />
<InternalsVisibleTo Include="GitVersion.Core.Tests"/>
<InternalsVisibleTo Include="GitVersion.App.Tests"/>
<InternalsVisibleTo Include="GitVersion.MsBuild.Tests"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public VersionField DetermineIncrementedField(GitVersionContext context, BaseVer
return defaultIncrement;
}

return commitMessageIncrement ?? VersionField.None;
return commitMessageIncrement.Value;
}

public VersionField? GetIncrementForCommits(Config configuration, IEnumerable<ICommit> commits)
Expand Down
8 changes: 2 additions & 6 deletions src/GitVersion.LibGit2Sharp/GitVersion.LibGit2Sharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LibGit2Sharp" Version="$(PackageVersion_LibGit2Sharp)" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(PackageVersion_MicrosoftPublicApiAnalyzers)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="LibGit2Sharp"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GitVersion.Core\GitVersion.Core.csproj" />
<ProjectReference Include="..\GitVersion.Core\GitVersion.Core.csproj"/>
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions src/GitVersion.MsBuild.Tests/GitVersion.MsBuild.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSBuild.ProjectCreation" Version="8.3.0"/>
<PackageReference Include="Buildalyzer" Version="4.1.5"/>
<PackageReference Include="LibGit2Sharp" Version="$(PackageVersion_LibGit2Sharp)"/>
<PackageReference Include="Microsoft.Build" Version="$(PackageVersion_MsBuild)"/>
<PackageReference Include="MSBuild.ProjectCreation"/>
<PackageReference Include="Buildalyzer"/>
<PackageReference Include="LibGit2Sharp"/>
<PackageReference Include="Microsoft.Build"/>
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 3 additions & 9 deletions src/GitVersion.MsBuild/GitVersion.MsBuild.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(PackageVersion_MsBuild)" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(PackageVersion_MicrosoftPublicApiAnalyzers)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Win32.Registry" Version="6.0.0-preview.5.21301.5" PrivateAssets="All" />
<PackageReference Include="System.Text.Json" Version="$(PackageVersion_MicrosoftJson)" PrivateAssets="All" />
<PackageReference Include="System.Text.Encodings.Web" Version="$(PackageVersion_MicrosoftJson)" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(PackageVersion_MicrosoftExtensions)" PrivateAssets="All" />
<PackageReference Include="Microsoft.Build.Utilities.Core" PrivateAssets="All" />
<PackageReference Include="Microsoft.Win32.Registry" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/GitVersion.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\GitVersion.yml = ..\GitVersion.yml
..\LICENSE = ..\LICENSE
..\README.md = ..\README.md
Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitVersion.Core", "GitVersion.Core\GitVersion.Core.csproj", "{F9741A0D-B9D7-4557-9A1C-A7252C1071F5}"
Expand Down

0 comments on commit 8f6d714

Please sign in to comment.