Skip to content

Commit 1ceea3d

Browse files
Muximizeangularsen
andauthored
Enable Central Package Management (#1386)
This PR removes some seemingly unused dependencies, and moves all dependency versions to a single file according to [Central Package Management](https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management). --------- Co-authored-by: Andreas Gullberg Larsen <andreas.larsen84@gmail.com>
1 parent 7970fcd commit 1ceea3d

File tree

12 files changed

+42
-58
lines changed

12 files changed

+42
-58
lines changed

CodeGen/CodeGen.csproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
14-
<PackageReference Include="NuGet.Protocol" Version="6.9.1" />
15-
<PackageReference Include="Serilog" Version="3.1.1" />
16-
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
17-
<PackageReference Include="System.CommandLine.DragonFruit" Version="0.2.0-alpha.19174.3" />
13+
<PackageReference Include="Newtonsoft.Json" />
14+
<PackageReference Include="NuGet.Protocol" />
15+
<PackageReference Include="Serilog" />
16+
<PackageReference Include="Serilog.Sinks.Console" />
17+
<PackageReference Include="System.CommandLine.DragonFruit" />
1818
</ItemGroup>
1919

2020
</Project>

Directory.Build.props

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@
2121
<WarningsNotAsErrors>612,618</WarningsNotAsErrors>
2222
</PropertyGroup>
2323

24+
<!-- Build symbol package (.snupkg) to distribute the PDB file for debugging, in addition to Source Link per recommendation: https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/sourcelink -->
25+
<PropertyGroup>
26+
<IncludeSymbols>true</IncludeSymbols>
27+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
28+
</PropertyGroup>
29+
2430
<ItemGroup>
2531
<Compile Include="$(MSBuildThisFileDirectory)/NullableAttributes.cs" />
2632
</ItemGroup>
2733

28-
</Project>
34+
</Project>

Directory.Packages.props

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
7+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
8+
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
9+
<PackageVersion Include="NuGet.Protocol" Version="6.10.0" />
10+
<PackageVersion Include="Serilog" Version="4.0.0" />
11+
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
12+
<PackageVersion Include="System.CommandLine.DragonFruit" Version="0.4.0-alpha.22272.1" />
13+
<PackageVersion Include="xunit" Version="2.8.1" />
14+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
15+
</ItemGroup>
16+
</Project>

PerfTests/PerfTest_Startup_v4_144_0/PerfTest_Startup_v4_144_0.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="UnitsNet" Version="4.144.0" />
12+
<PackageReference Include="UnitsNet" VersionOverride="4.144.0" />
1313
</ItemGroup>
1414

1515
</Project>

PerfTests/PerfTest_Startup_v4_72_0/PerfTest_Startup_v4_72_0.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="UnitsNet" Version="4.72.0" />
12+
<PackageReference Include="UnitsNet" VersionOverride="4.72.0" />
1313
</ItemGroup>
1414

1515
</Project>

UnitsNet.Benchmark/UnitsNet.Benchmark.csproj

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
14-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
15-
<PrivateAssets>all</PrivateAssets>
16-
</PackageReference>
13+
<PackageReference Include="BenchmarkDotNet" />
1714
</ItemGroup>
1815

1916
<ItemGroup>

UnitsNet.NumberExtensions.Tests/UnitsNet.NumberExtensions.Tests.csproj

+3-5
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
29-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
30-
<PackageReference Include="xunit" Version="2.7.0" />
31-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
28+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
29+
<PackageReference Include="xunit" />
30+
<PackageReference Include="xunit.runner.visualstudio">
3231
<PrivateAssets>all</PrivateAssets>
3332
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3433
</PackageReference>
35-
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
3634
</ItemGroup>
3735

3836
<ItemGroup>

UnitsNet.Serialization.JsonNet.Tests/UnitsNet.Serialization.JsonNet.Tests.csproj

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
18-
<PackageReference Include="xunit" Version="2.7.0" />
19-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
18+
<PackageReference Include="xunit" />
19+
<PackageReference Include="xunit.runner.visualstudio">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2222
</PackageReference>
23-
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
2423
</ItemGroup>
2524

2625
<ItemGroup>

UnitsNet.Serialization.JsonNet/UnitsNet.Serialization.JsonNet.csproj

+1-15
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@
2727
<TargetFramework>netstandard2.0</TargetFramework>
2828
</PropertyGroup>
2929

30-
<!-- SourceLink: https://github.com/dotnet/sourcelink -->
31-
<PropertyGroup>
32-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
33-
34-
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
35-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
36-
37-
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
38-
<IncludeSymbols>true</IncludeSymbols>
39-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
40-
</PropertyGroup>
41-
4230
<!-- Strong name signing -->
4331
<PropertyGroup>
4432
<AssemblyOriginatorKeyFile>../UnitsNet.snk</AssemblyOriginatorKeyFile>
@@ -48,9 +36,7 @@
4836

4937
<!-- NuGet references that work for both signed and unsigned -->
5038
<ItemGroup>
51-
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" PrivateAssets="All" />
52-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
53-
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
39+
<PackageReference Include="Newtonsoft.Json" />
5440
</ItemGroup>
5541

5642
<!-- Project references, will also generate the corresponding nuget dependencies -->

UnitsNet.Tests/UnitsNet.Tests.csproj

+3-5
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@
2424
</ItemGroup>
2525

2626
<ItemGroup>
27-
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
28-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
29-
<PackageReference Include="xunit" Version="2.7.0" />
30-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
27+
<PackageReference Include="Microsoft.NET.Test.Sdk" />
28+
<PackageReference Include="xunit" />
29+
<PackageReference Include="xunit.runner.visualstudio">
3130
<PrivateAssets>all</PrivateAssets>
3231
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3332
</PackageReference>
34-
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
3533
</ItemGroup>
3634

3735
<ItemGroup>

UnitsNet.sln

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ ProjectSection(SolutionItems) = preProject
4040
UnitsNet.sln.DotSettings = UnitsNet.sln.DotSettings
4141
UnitsNet.snk = UnitsNet.snk
4242
azure-pipelines.yml = azure-pipelines.yml
43+
Directory.Packages.props = Directory.Packages.props
4344
EndProjectSection
4445
EndProject
4546
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{71C6EF60-7E52-4DF4-BA93-5FAF6D89AEC6}"

UnitsNet/UnitsNet.csproj

-17
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@
2727
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
2828
</PropertyGroup>
2929

30-
<!-- SourceLink: https://github.com/dotnet/sourcelink -->
31-
<PropertyGroup>
32-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
33-
34-
<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
35-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
36-
37-
<!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
38-
<IncludeSymbols>true</IncludeSymbols>
39-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
40-
</PropertyGroup>
41-
4230
<!-- Strong name signing -->
4331
<PropertyGroup>
4432
<AssemblyOriginatorKeyFile>../UnitsNet.snk</AssemblyOriginatorKeyFile>
@@ -48,11 +36,6 @@
4836
<NeutralLanguage>en-US</NeutralLanguage>
4937
</PropertyGroup>
5038

51-
<!-- NuGet references that work for all TargetFrameworks, both signed and unsigned. -->
52-
<ItemGroup>
53-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
54-
</ItemGroup>
55-
5639
<!-- Link in common unit definition .json files -->
5740
<ItemGroup>
5841
<None Include="..\Common\**\*">

0 commit comments

Comments
 (0)