Skip to content

Commit

Permalink
Manage Dependencies centrally
Browse files Browse the repository at this point in the history
Use Static Graph restore when applicable.
Manage Packages Centrally using NuGet's CPVM feature.
  • Loading branch information
Nirmal4G committed Aug 14, 2021
1 parent ab3455d commit 48c7eb2
Show file tree
Hide file tree
Showing 38 changed files with 286 additions and 272 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
Expand Down
8 changes: 5 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<Project>

<Import Project="Directory.Solution.props" />

<PropertyGroup>
<RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory>
<BuildToolsDirectory>$(RepositoryDirectory)build\</BuildToolsDirectory>
Expand Down Expand Up @@ -47,15 +49,15 @@
<EnableTypeInfoReflection>false</EnableTypeInfoReflection>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="All" />
</ItemGroup>
</When>
</Choose>

<Import Project="$(BuildToolsDirectory)Windows.Toolkit.VisualStudio.Design.props" Condition="$(IsDesignProject)" />

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

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

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

<ItemGroup Label="Core">
<!-- UWP SDK -->
<PackageVersion Include="Win2D.uwp" Version="1.26.0" />
<PackageVersion Include="ColorCode.UWP" Version="2.0.9" />
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.6.1" />
<PackageVersion Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.1" />
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
<!-- MSBuild SDK Extras refernces the following package implicitly -->
<PackageVersion Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.12" Condition="'$(_SdkShortFrameworkIdentifier)' != 'uap'" />
<!-- C# Compiler SDK -->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.11.0" />
</ItemGroup>

<ItemGroup Label="Global">
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.4.231" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>

<ItemGroup Label="Samples">
<!-- Store Services SDK -->
<PackageVersion Include="Microsoft.Services.Store.Engagement" Version="10.1901.28001" />
<!-- Forms and Graph Toolkit -->
<PackageVersion Include="Microsoft.Toolkit.Forms.UI.XamlHost" Version="6.1.3" />
<PackageVersion Include="Microsoft.Toolkit.Graph.Controls" Version="7.0.0-preview2" />
<PackageVersion Include="Microsoft.Toolkit.Win32.UI.XamlApplication" Version="6.1.3" />
<!-- Monaco JS Text Editor for WinRT JS -->
<PackageVersion Include="Monaco.Editor" Version="0.8.1-alpha" />
<!-- Notifications Visualizer -->
<PackageVersion Include="NotificationsVisualizerLibrary" Version="1.0.5" />
</ItemGroup>

<ItemGroup Label="Tests">
<!-- MSTest -->
<PackageVersion Include="MSTest.TestAdapter" Version="2.2.5" />
<PackageVersion Include="MSTest.TestFramework" Version="2.2.5" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<!-- Test Helpers -->
<PackageVersion Include="FluentAssertions" Version="6.0.0" />
<!-- DO NOT UPGRADE: This version is used for upgrade testing between 6.1.1 and 7.0.0 for the Object Serializers -->
<PackageVersion Include="Newtonsoft.Json" Version="10.0.3" Pin="true" />
<!-- WinUI Test Infra -->
<PackageVersion Include="MUXAppTestHelpers" Version="0.0.4" />
<PackageVersion Include="MUXTestInfra.TAEF" Version="0.0.4" />
<PackageVersion Include="MUXTestInfra.MSTest" Version="0.0.4" />
<PackageVersion Include="MUXCustomBuildTasks" Version="1.0.67" />
<PackageVersion Include="TAEF.Redist.Wlk" Version="10.57.200928001" />
<!-- Windows App Test Infra -->
<PackageVersion Include="Microsoft.Windows.Apps.Test" Version="1.0.181205002" />
</ItemGroup>

<ItemGroup Label="System">
<!-- BCL Extensions -->
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
<!-- Dependency Injection -->
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" />
<!-- Windows Registry -->
<PackageVersion Include="Microsoft.Win32.Registry" Version="5.0.0" />
<!-- Annotations -->
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<!-- Diagnostics -->
<PackageVersion Include="System.Diagnostics.Contracts" Version="4.3.0" />
<PackageVersion Include="System.Diagnostics.Process" Version="4.3.0" />
<!-- Drawing -->
<PackageVersion Include="System.Drawing.Common" Version="5.0.2" />
<PackageVersion Include="System.Drawing.Primitives" Version="4.3.0" />
<!-- Memory -->
<PackageVersion Include="System.Memory" Version="4.5.4" />
<!-- Numerics -->
<PackageVersion Include="System.Numerics.Vectors" Version="4.5.0" />
<!-- Reflection -->
<PackageVersion Include="System.Reflection.Emit" Version="4.7.0" />
<PackageVersion Include="System.Reflection.TypeExtensions" Version="4.7.0" />
<!-- Runtime -->
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
<!-- Tasks -->
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.Threading.Tasks.Parallel" Version="4.3.0" />
<!-- Text - JSON -->
<PackageVersion Include="System.Text.Json" Version="5.0.2" />
<!-- Text - XML -->
<PackageVersion Include="System.Xml.ReaderWriter" Version="4.3.1" />
<PackageVersion Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
</ItemGroup>

</Project>
14 changes: 14 additions & 0 deletions Directory.Solution.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project>

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

<!-- Options that are supported only when using the Full MSBuild! -->
<PropertyGroup Condition="'$(MSBuildRuntimeType)' == 'Full'">
<!-- Static Graph Restore doesn't yet support targets like uap10.0 framework -->
<RestoreUseStaticGraphEvaluation>False</RestoreUseStaticGraphEvaluation>
</PropertyGroup>

</Project>
4 changes: 1 addition & 3 deletions GazeInputTest/GazeInputTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.12</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.Input.GazeInteraction\Microsoft.Toolkit.Uwp.Input.GazeInteraction.csproj">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
<When Condition="'$(TargetFramework)' == 'netstandard1.4'">
<!-- .NET Standard 1.4 doesn't have the Span<T> type, ValueTuple or the [Pure] attribute -->
<ItemGroup>
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Diagnostics.Contracts" />
<PackageReference Include="System.ValueTuple" />
<PackageReference Include="System.Memory" />
</ItemGroup>
</When>

<When Condition="'$(TargetFramework)' == 'netstandard2.0'">
<!-- .NET Standard 2.0 doesn't have the Span<T> type -->
<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Memory" />
</ItemGroup>
</When>

Expand All @@ -39,11 +39,12 @@
</PropertyGroup>
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
<ItemGroup>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
</When>

<When Condition="'$(TargetFramework)' == 'net5.0'">
<!-- .NET 5 SDK doesn't define "NETSTANDARD2_1_OR_GREATER" until a later revision -->
<PropertyGroup>
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- Box&lt;T&gt;: a type mapping boxed value types and exposing some utility and high performance methods.
- Ref&lt;T&gt;: a stack-only struct that can store a reference to a value of a specified type.
- NullableRef&lt;T&gt;: a stack-only struct similar to Ref&lt;T&gt;, which also supports nullable references.
</Description>
</Description>
<PackageTags>Parallel;Performance;Unsafe;Span;Memory;String;StringPool;Array;Stream;Buffer;Extensions;Helpers</PackageTags>
</PropertyGroup>

Expand All @@ -39,23 +39,23 @@
which is used by the Box<T> type in the package.
-->
<ItemGroup>
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
<PackageReference Include="System.Drawing.Primitives" Version="4.3.0" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="System.Threading.Tasks.Parallel" Version="4.3.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
<PackageReference Include="System.Diagnostics.Contracts" />
<PackageReference Include="System.Drawing.Primitives" />
<PackageReference Include="System.Memory" />
<PackageReference Include="System.Numerics.Vectors" />
<PackageReference Include="System.Threading.Tasks.Extensions" />
<PackageReference Include="System.Threading.Tasks.Parallel" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
</When>

<When Condition="'$(TargetFramework)' == 'netstandard2.0'">
<!-- .NET Standard 2.0 doesn't have the Span<T>, HashCode and ValueTask types -->
<ItemGroup>
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.0" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.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>

Expand All @@ -77,7 +77,7 @@
</PropertyGroup>
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
<ItemGroup>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
</When>

Expand All @@ -101,7 +101,7 @@
<DefineConstants>NETSTANDARD2_1_OR_GREATER;SPAN_RUNTIME_SUPPORT;NETCORE_RUNTIME</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
</When>

Expand All @@ -110,7 +110,7 @@
<DefineConstants>SPAN_RUNTIME_SUPPORT;NETCORE_RUNTIME</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
</When>
</Choose>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
<Nullable>Enable</Nullable>
<IsPackable>false</IsPackable>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Remove="EmbeddedResources\INotifyPropertyChanged.cs" />
<Compile Remove="EmbeddedResources\NotNullAttribute.cs" />
<Compile Remove="EmbeddedResources\NotNullIfNotNullAttribute.cs" />
<Compile Remove="EmbeddedResources\ObservableObject.cs" />
<Compile Remove="EmbeddedResources\ObservableRecipient.cs" />
<Compile Remove="EmbeddedResources\*.cs" />
</ItemGroup>

<ItemGroup>
Expand All @@ -34,12 +29,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.9.0" PrivateAssets="all" Pack="false" />
<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="All" Pack="false" />
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions Microsoft.Toolkit.Mvvm/Microsoft.Toolkit.Mvvm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@

<!-- .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="5.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<PackageReference Include="System.ComponentModel.Annotations" />
<PackageReference Include="System.Memory" />
</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="5.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>

<!-- Source generator project reference for packing -->
<ItemGroup>
<ProjectReference Include="..\Microsoft.Toolkit.Mvvm.SourceGenerators\Microsoft.Toolkit.Mvvm.SourceGenerators.csproj" PrivateAssets="all" />
Expand Down
Loading

0 comments on commit 48c7eb2

Please sign in to comment.