Skip to content

Commit

Permalink
Adopt Central Package Management
Browse files Browse the repository at this point in the history
Adopt Adopt Central Package Management for NuGet packages.
Resolves App-vNext#1064.
  • Loading branch information
martincostello committed Mar 21, 2023
1 parent 4c1cd6e commit 18c3292
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 34 deletions.
9 changes: 3 additions & 6 deletions eng/Analyzers.targets
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<Project>
<ItemGroup Label="Analyzers" Condition="$(UseDefaultAnalyzers) == 'true'">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.1" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.51.0.59060" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
<AdditionalFiles Include="$(MsBuildThisFileDirectory)analyzers\Stylecop.json" Visible="false" />
<EditorConfigFiles Include="$(MsBuildThisFileDirectory)analyzers\Stylecop.globalconfig" />
<EditorConfigFiles Include="$(MsBuildThisFileDirectory)analyzers\$(ProjectType).globalconfig" />
Expand Down
8 changes: 4 additions & 4 deletions eng/Benchmark.targets
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project>

<Import Project="..\Version.props" />

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.3" />
</ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
</ItemGroup>

</Project>
</Project>
4 changes: 2 additions & 2 deletions eng/Library.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</PropertyGroup>

<ItemGroup Label="SourceLink">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup Label="SharedNuspecProperties">
Expand All @@ -37,4 +37,4 @@
<InternalsVisibleTo Include="%(InternalsVisibleToTest.Identity)$(PollyPublicKeySuffix)" />
</ItemGroup>
</Target>
</Project>
</Project>
18 changes: 9 additions & 9 deletions eng/Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.2.0" PrivateAssets="all" />
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="ReportGenerator" Version="5.1.19" PrivateAssets="all" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" PrivateAssets="all" />
<PackageReference Include="coverlet.msbuild" PrivateAssets="all" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="GitHubActionsTestLogger" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Moq" />
<PackageReference Include="ReportGenerator" PrivateAssets="all" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
</ItemGroup>

<PropertyGroup Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) != '.NETFramework'">
Expand All @@ -36,4 +36,4 @@
<ReportGenerator ReportFiles="@(CoverletReport)" ReportTypes="$(ReportGeneratorReportTypes)" Tag="$(TargetFramework)" TargetDirectory="$(ReportGeneratorTargetDirectory)" Title="$(AssemblyName)" VerbosityLevel="Warning" />
<Exec Condition=" '$(ReportGeneratorOutputMarkdown)' == 'true' " Command="pwsh -Command %22('$(_MarkdownSummaryPrefix)' + [System.Environment]::NewLine + [System.Environment]::NewLine + (Get-Content $([System.IO.Path]::Combine($(ReportGeneratorTargetDirectory), 'SummaryGithub.md')) | Out-String) + [System.Environment]::NewLine + [System.Environment]::NewLine + '$(_MarkdownSummarySuffix)') >> $(GITHUB_STEP_SUMMARY)%22" />
</Target>
</Project>
</Project>
7 changes: 6 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<ItemGroup>
<Using Include="System.Collections" />
<Using Include="System.Collections.Concurrent" />
Expand Down Expand Up @@ -42,4 +47,4 @@
<Using Include="BenchmarkDotNet.Jobs" />
<Using Include="BenchmarkDotNet.Running" />
</ItemGroup>
</Project>
</Project>
3 changes: 1 addition & 2 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project>
<Import Project="$(MsBuildThisFileDirectory)../eng/Common.targets" />
<Import Project="$(MsBuildThisFileDirectory)../eng/$(ProjectType).targets" Condition="$(ProjectType) != ''" />

</Project>
</Project>
21 changes: 21 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project>
<ItemGroup>
<PackageVersion Include="coverlet.msbuild" Version="3.2.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.5" />
<PackageVersion Include="FluentAssertions" Version="6.10.0" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.1" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="ReportGenerator" Version="5.1.19" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="8.51.0.59060" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.435" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="4.5.0" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions src/Polly.Benchmarks/Polly.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
</ItemGroup>
<ItemGroup Condition=" '$(BenchmarkFromNuGet)' != 'True' ">
<ProjectReference Include="..\Polly\Polly.csproj" />
</ItemGroup>
</Project>
</Project>
8 changes: 4 additions & 4 deletions src/Polly.Core/Polly.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" Condition="!$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'netcoreapp3.1'))" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" Condition="!$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'netcoreapp3.1'))" />
<PackageReference Include="System.Threading.Tasks.Extensions" Condition="!$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'netcoreapp3.1'))" />
<PackageReference Include="System.ValueTuple" Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'" />
<PackageReference Include="System.ComponentModel.Annotations" Condition="!$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework), 'netcoreapp3.1'))" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions src/Polly/Polly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net461' or '$(TargetFramework)' == 'netstandard1.1'">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="System.ValueTuple" />
</ItemGroup>

<ItemGroup>
<Using Remove="System.Net.Http" />
<InternalsVisibleToTest Include="Polly.Specs"/>
Expand Down

0 comments on commit 18c3292

Please sign in to comment.