Skip to content

Commit

Permalink
Manage Dependencies centrally
Browse files Browse the repository at this point in the history
Update package versions.
Use Static Graph restore when applicable.
Manage Packages Centrally using NuGet's CPVM feature.
  • Loading branch information
Nirmal4G committed Oct 27, 2022
1 parent 58ed821 commit 4b8a67d
Show file tree
Hide file tree
Showing 28 changed files with 219 additions and 176 deletions.
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 @@ -46,15 +48,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 @@ -68,7 +70,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
102 changes: 102 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<Project>

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

<ItemGroup Label="Core">
<!-- UWP SDK -->
<PackageVersion Include="Win2D.uwp" Version="1.26.0" />
<PackageVersion Include="ColorCode.UWP" Version="2.0.12" />
<PackageVersion Include="Microsoft.UI.Xaml" Version="2.7.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.13" Condition="'$(_SdkShortFrameworkIdentifier)' != 'uap'" />
<!-- C# Compiler SDK -->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" />
<!-- Visual Studio DesignTime SDK -->
<PackageVersion Include="Microsoft.VisualStudio.DesignTools.Extensibility" Version="16.4.29519.181" />
</ItemGroup>

<ItemGroup Label="Toolkit">
<PackageVersion Include="Microsoft.Toolkit" Version="7.1.2" />
<PackageVersion Include="Microsoft.Toolkit.Diagnostics" Version="7.1.2" />
<PackageVersion Include="Microsoft.Toolkit.Mvvm" Version="7.1.2" />
</ItemGroup>

<ItemGroup Label="Global">
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.4.255" />
<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.9.0-beta" />
</ItemGroup>

<ItemGroup Label="Tests">
<!-- MSTest -->
<PackageVersion Include="MSTest.TestAdapter" Version="2.2.9" />
<PackageVersion Include="MSTest.TestFramework" Version="2.2.9" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<!-- Test Helpers -->
<PackageVersion Include="FluentAssertions" Version="6.6.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.3" />
<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 @@ -133,9 +133,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 @@ -43,23 +43,23 @@

<!-- For Desktop Win32 apps' WinRT APIs support -->
<ItemGroup Condition="'$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" />
</ItemGroup>

<!-- The .NET Core desktop apps also need the Registry NuGet package and 'System.Reflection.Emit' for generating COM class dynamically -->
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or $(TargetFramework.Contains('windows10.0'))">
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
<PackageReference Include="Microsoft.Win32.Registry" />
<PackageReference Include="System.Reflection.Emit" />
<PackageReference Include="System.Drawing.Common" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'native'">
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="$(ExtrasUwpMetaPackageVersion)" PrivateAssets="All" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" PrivateAssets="All" />
</ItemGroup>

<!-- Native (C++) does not need 'System.ValueTuple' (plus it is incompatible with this package) -->
<ItemGroup Condition="'$(TargetFramework)' != 'native'">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="System.ValueTuple" />
</ItemGroup>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,16 @@
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.12</Version>
</PackageReference>
<PackageReference Include="Microsoft.Services.Store.Engagement">
<Version>10.1901.28001</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit">
<Version>7.1.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" />
<PackageReference Include="Microsoft.Services.Store.Engagement" />
<PackageReference Include="Microsoft.Toolkit" />
<!-- TODO Reintroduce graph controls
<PackageReference Include="Microsoft.Toolkit.Graph.Controls">
<Version>7.0.0-preview2</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Graph.Controls" />
-->
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.7.0</Version>
</PackageReference>
<PackageReference Include="Monaco.Editor">
<Version>0.7.0-alpha</Version>
</PackageReference>
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed">
<Version>2.0.1</Version>
</PackageReference>
<PackageReference Include="System.ValueTuple">
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml" />
<PackageReference Include="Monaco.Editor" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed" />
<PackageReference Include="System.ValueTuple" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\BrushAssets\TileTexture.png" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.12</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed" Version="2.0.1" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="ColorCode.UWP" Version="2.0.6" />
<PackageReference Include="ColorCode.UWP" />
</ItemGroup>

<Import Project="$(BuildToolsDirectory)Windows.Toolkit.UWP.Controls.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="5.0.2" />
<PackageReference Include="Win2D.uwp" Version="1.25.0" />
<PackageReference Include="System.Text.Json" />
<PackageReference Include="Win2D.uwp" />
</ItemGroup>

<Import Project="$(BuildToolsDirectory)Windows.Toolkit.UWP.Controls.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="Win2D.uwp" Version="1.25.0" />
<PackageReference Include="System.Threading.Tasks.Extensions" />
<PackageReference Include="Win2D.uwp" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Microsoft.Toolkit.Uwp.UI/Microsoft.Toolkit.Uwp.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Toolkit" Version="7.1.2" />
<PackageReference Include="Microsoft.Toolkit" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Microsoft.Toolkit.Uwp/Microsoft.Toolkit.Uwp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Toolkit" Version="7.1.2" />
<PackageReference Include="Microsoft.Toolkit" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" />
</ItemGroup>

</Project>
8 changes: 2 additions & 6 deletions SmokeTests/SmokeTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,11 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.10</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" />
</ItemGroup>
<!-- Only the Layout package have a dependency on WinUI -->
<ItemGroup Condition="$(CurrentProject) == 'UWPBaselineWinUI' or $(CurrentProject) == 'Microsoft.Toolkit.Uwp.UI.Controls.Layout'">
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.7.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml" />
</ItemGroup>
<ItemGroup Condition="'$(CurrentProject)' != '' and '$(CurrentProject)' != 'UWPBaseline' and '$(CurrentProject)' != 'UWPBaselineWinUI' and '$(NuGetPackageVersion)' != 'To Fill In With Local Version Number'">
<PackageReference Include="$(CurrentProject)" Version="$(NuGetPackageVersion)" />
Expand Down
24 changes: 6 additions & 18 deletions UITests/UITests.App/UITests.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,12 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.12</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit">
<Version>7.1.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Diagnostics">
<Version>7.1.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Mvvm">
<Version>7.1.2</Version>
</PackageReference>
<PackageReference Include="MUXAppTestHelpers">
<Version>0.0.4</Version>
</PackageReference>
<PackageReference Include="System.Text.Json">
<Version>5.0.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" />
<PackageReference Include="Microsoft.Toolkit" />
<PackageReference Include="Microsoft.Toolkit.Diagnostics" />
<PackageReference Include="Microsoft.Toolkit.Mvvm" />
<PackageReference Include="MUXAppTestHelpers" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>
<ItemGroup>
<None Include="UITests.App.pfx" />
Expand Down
22 changes: 11 additions & 11 deletions UITests/UITests.Tests.MSTest/UITests.Tests.MSTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@

<ItemGroup>
<!-- MSTest -->
<PackageReference Include="Microsoft.Toolkit" Version="7.1.2" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="Microsoft.Toolkit" />
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<!-- Microsoft.UI.Xaml MSTest Extension -->
<PackageReference Include="MUXTestInfra.MSTest" Version="0.0.4" />
<PackageReference Include="MUXTestInfra.MSTest" />
<!-- System packages -->
<PackageReference Include="System.Text.Json" Version="5.0.2" />
<PackageReference Include="System.Drawing.Primitives" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.5.1" />
<PackageReference Include="System.Text.Json" />
<PackageReference Include="System.Drawing.Primitives" />
<PackageReference Include="System.Diagnostics.Process" />
<PackageReference Include="System.Reflection.TypeExtensions" />
<!-- Windows SDK packages -->
<PackageReference Include="Microsoft.Windows.Apps.Test" Version="1.0.181205002" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
<PackageReference Include="Microsoft.Windows.Apps.Test" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" />
</ItemGroup>

<Import Project="..\UITests.Tests.Shared\UITests.Tests.Shared.projitems" Label="Shared" />
Expand Down
Loading

0 comments on commit 4b8a67d

Please sign in to comment.