Skip to content

Commit

Permalink
Manage Dependencies centrally
Browse files Browse the repository at this point in the history
Manage Packages Centrally using NuGet's CPVM feature.
This uses `Directory.Packages.props` to store the package versions in one file.
  • Loading branch information
Nirmal4G committed Aug 19, 2022
1 parent 21fd74d commit d1361b3
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

<!-- .NET Standard 2.0 doesn't have the Span<T> type -->
<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Memory" />
</ItemGroup>
</When>

<When Condition="'$(TargetFramework)' == 'netstandard2.1'">

<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
<ItemGroup>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
</When>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@

<!-- .NET Standard 2.0 doesn't have the Span<T>, HashCode and ValueTask types -->
<ItemGroup>
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="Microsoft.Bcl.HashCode" />
<PackageReference Include="System.Memory" />
<PackageReference Include="System.Threading.Tasks.Extensions" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
</When>

<When Condition="'$(TargetFramework)' == 'netstandard2.1'">

<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
<ItemGroup>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
</When>

Expand All @@ -54,7 +54,7 @@

<!-- .NET Core 3.1 has the Unsafe type, but the version it ships with lacks Unsafe.IsNullRef<T> -->
<ItemGroup>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
</When>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="All" Pack="false" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="All" Pack="false" />
</ItemGroup>

<Import Project="$(BuildToolsDirectory)Community.Toolkit.GetBuildOutputs.targets" />
Expand Down
12 changes: 6 additions & 6 deletions CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@

<!-- .NET Standard 2.0 doesn't have the Span<T> and IAsyncEnumerable<T> types -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<PackageReference Include="System.ComponentModel.Annotations" />
<PackageReference Include="System.Memory" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>

<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>

<!-- Source generator project reference for packing -->
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</Choose>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.255" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" PrivateAssets="All" />
</ItemGroup>

<Choose>
Expand All @@ -40,7 +40,7 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>
</When>
</Choose>
Expand Down
42 changes: 42 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<Project>

<PropertyGroup Label="Core">
<NETStandardImplicitPackageVersion>2.0.3</NETStandardImplicitPackageVersion>
</PropertyGroup>

<ItemGroup Label="System">
<!-- BCL Extensions -->
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<!-- Annotations -->
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<!-- Memory -->
<PackageVersion Include="System.Memory" Version="4.5.5" />
<!-- Runtime -->
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<!-- Tasks -->
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
</ItemGroup>

<ItemGroup Label="Core">
<!-- C# Compiler SDK -->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" />
</ItemGroup>

<ItemGroup Label="Global">
<!-- Build Helpers -->
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.5.107" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>

<ItemGroup Label="Tests">
<!-- MSTest -->
<PackageVersion Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageVersion Include="MSTest.TestFramework" Version="2.2.8" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageVersion Include="Dbs.Signed3.Nito.AsyncEx.Context" Version="5.0.0" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions Directory.Solution.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>True</ManagePackageVersionsCentrally>
<RestoreUseStaticGraphEvaluation>True</RestoreUseStaticGraphEvaluation>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" />
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Dbs.Signed3.Nito.AsyncEx.Context" Version="5.0.0" />
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Dbs.Signed3.Nito.AsyncEx.Context" />
</ItemGroup>

</Project>

0 comments on commit d1361b3

Please sign in to comment.