Skip to content

Commit

Permalink
GitTools#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 6b51f9c
Show file tree
Hide file tree
Showing 21 changed files with 140 additions and 118 deletions.
9 changes: 9 additions & 0 deletions build/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,14 @@
<ItemGroup>
<Using Include="Common.Utilities.Constants" Alias="Constants"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Cake.Common" />
<PackageReference Include="Cake.Compression" />
<PackageReference Include="Cake.Frosting" />
<PackageReference Include="Cake.Incubator" />
<PackageReference Include="Cake.DotNetLocalTools.Module" />

<PackageReference Include="Cake.Docker" />
</ItemGroup>

</Project>
22 changes: 15 additions & 7 deletions build/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Cake.Common" Version="2.2.0" />
<PackageReference Include="Cake.Compression" Version="0.2.6" />
<PackageReference Include="Cake.Frosting" Version="2.2.0" />
<PackageReference Include="Cake.Incubator" Version="7.0.0" />
<PackageReference Include="Cake.DotNetLocalTools.Module" Version="1.0.2" />

<PackageReference Include="Cake.Docker" Version="1.1.2" />
<PackageVersion Include="Cake.Common" Version="2.2.0" />
<PackageVersion Include="Cake.Compression" Version="0.3.0" />
<PackageVersion Include="Cake.Codecov" Version="1.0.1" />
<PackageVersion Include="Cake.Coverlet" Version="2.5.4" />
<PackageVersion Include="Cake.Frosting" Version="2.2.0" />
<PackageVersion Include="Cake.Incubator" Version="7.0.0" />
<PackageVersion Include="Cake.DotNetLocalTools.Module" Version="1.0.2" />
<PackageVersion Include="Cake.Docker" Version="1.1.2" />
<PackageVersion Include="Cake.Git" Version="2.0.0" />
<PackageVersion Include="Cake.Json" Version="7.0.1" />
<PackageVersion Include="Cake.Wyam2" Version="3.0.0" />

<PackageVersion Include="xunit.assert" Version="2.4.2" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions build/build/build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ProjectReference Include="..\common\common.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Cake.Codecov" Version="1.0.1" />
<PackageReference Include="Cake.Coverlet" Version="2.5.4" />
<PackageReference Include="Cake.Codecov" />
<PackageReference Include="Cake.Coverlet" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion build/chores/chores.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<ProjectReference Include="..\common\common.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Cake.Json" Version="7.0.1" />
<PackageReference Include="Cake.Json" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions build/common/common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Coverlet" Version="2.5.4" />
<PackageReference Include="xunit.assert" Version="2.4.1" />
<PackageReference Include="Cake.Coverlet"/>
<PackageReference Include="xunit.assert"/>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions build/docs/docs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ProjectReference Include="..\common\common.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Cake.Git" Version="2.0.0" />
<PackageReference Include="Cake.Wyam2" Version="3.0.0-rc2" />
<PackageReference Include="Cake.Git" />
<PackageReference Include="Cake.Wyam2" />
</ItemGroup>
</Project>
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>
Loading

0 comments on commit 6b51f9c

Please sign in to comment.