Skip to content

Commit

Permalink
Minimize the build graph by deleting unnecessary references (#68603)
Browse files Browse the repository at this point in the history
* Minimize the build graph by deleting references

Minimizing projects' dependency graph. There are tons of unnecessary
Reference and ProjectReference items which aren't required anymore as
the referenced projects became full facade assemblies. Removing those
from a leaf's graph makes the graph smaller and therefore the project's
evaluation and build faster.

* Update src/libraries/System.Net.Quic/ref/System.Net.Quic.csproj

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>

* Update Versions.props

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
  • Loading branch information
ViktorHofer and bartonjs authored Apr 28, 2022
1 parent f10cdda commit ba055bd
Show file tree
Hide file tree
Showing 140 changed files with 133 additions and 401 deletions.
10 changes: 0 additions & 10 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -89,31 +89,21 @@
<!-- Libraries dependencies -->
<MicrosoftBclAsyncInterfacesVersion>6.0.0</MicrosoftBclAsyncInterfacesVersion>
<MicrosoftBclHashCodeVersion>1.1.1</MicrosoftBclHashCodeVersion>
<MicrosoftWin32PrimitivesVersion>4.3.0</MicrosoftWin32PrimitivesVersion>
<MicrosoftWin32RegistryVersion>5.0.0</MicrosoftWin32RegistryVersion>
<StyleCopAnalyzersVersion>1.2.0-beta.406</StyleCopAnalyzersVersion>
<SystemBuffersVersion>4.5.1</SystemBuffersVersion>
<SystemCollectionsVersion>4.3.0</SystemCollectionsVersion>
<SystemComponentModelAnnotationsVersion>5.0.0</SystemComponentModelAnnotationsVersion>
<SystemDataSqlClientVersion>4.8.3</SystemDataSqlClientVersion>
<SystemDataDataSetExtensionsVersion>4.5.0</SystemDataDataSetExtensionsVersion>
<SystemDiagnosticsContractsVersion>4.3.0</SystemDiagnosticsContractsVersion>
<SystemDynamicRuntimeVersion>4.3.0</SystemDynamicRuntimeVersion>
<SystemIOFileSystemAccessControlVersion>5.0.0</SystemIOFileSystemAccessControlVersion>
<SystemIOPipesAccessControlVersion>5.0.0</SystemIOPipesAccessControlVersion>
<SystemLinqExpressionsVersion>4.3.0</SystemLinqExpressionsVersion>
<SystemMemoryVersion>4.5.4</SystemMemoryVersion>
<SystemNetPrimitivesVersion>4.3.1</SystemNetPrimitivesVersion>
<SystemNumericsVectorsVersion>4.5.0</SystemNumericsVectorsVersion>
<SystemReflectionMetadataVersion>6.0.0</SystemReflectionMetadataVersion>
<SystemReflectionEmitVersion>4.7.0</SystemReflectionEmitVersion>
<SystemReflectionEmitILGenerationVersion>4.7.0</SystemReflectionEmitILGenerationVersion>
<SystemReflectionEmitLightweightVersion>4.7.0</SystemReflectionEmitLightweightVersion>
<SystemRuntimeVersion>4.3.1</SystemRuntimeVersion>
<SystemRuntimeExtensionsVersion>4.3.1</SystemRuntimeExtensionsVersion>
<SystemRuntimeInteropServicesVersion>4.3.0</SystemRuntimeInteropServicesVersion>
<SystemRuntimeInteropServicesRuntimeInformationVersion>4.3.0</SystemRuntimeInteropServicesRuntimeInformationVersion>
<SystemRuntimeSerializationPrimitivesVersion>4.3.0</SystemRuntimeSerializationPrimitivesVersion>
<SystemSecurityAccessControlVersion>6.0.0</SystemSecurityAccessControlVersion>
<SystemSecurityCryptographyAlgorithmsVersion>4.3.1</SystemSecurityCryptographyAlgorithmsVersion>
<SystemSecurityCryptographyCngVersion>5.0.0</SystemSecurityCryptographyCngVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/Microsoft.CSharp/ref/Microsoft.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="Microsoft.CSharp.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\System.Linq\ref\System.Linq.csproj" />
<ProjectReference Include="..\..\System.Linq.Expressions\ref\System.Linq.Expressions.csproj" />
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
</ItemGroup>
Expand Down
6 changes: 0 additions & 6 deletions src/libraries/Microsoft.CSharp/src/Microsoft.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -239,21 +239,15 @@
<Reference Include="System.Reflection.Emit.ILGeneration" />
<Reference Include="System.Reflection.Emit.Lightweight" />
<Reference Include="System.Reflection.Primitives" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Collections" />
<Reference Include="System.Collections.Concurrent" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Diagnostics.Tools" />
<Reference Include="System.Linq" />
<Reference Include="System.Linq.Expressions" />
<Reference Include="System.Memory" />
<Reference Include="System.ObjectModel" />
<Reference Include="System.Reflection" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Threading" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<Reference Include="System.Security" />
<!-- Manually reference the transitive dependency to make NuGet pick the package over the transitive project: https://github.com/NuGet/Home/issues/10368 -->
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" PrivateAssets="all" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,4 @@
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Configuration.Xml\src\Microsoft.Extensions.Configuration.Xml.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<!-- Manually reference the transitive dependency to make NuGet pick the package over the transitive project: https://github.com/NuGet/Home/issues/10368 -->
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" PrivateAssets="all" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,5 @@
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="8.0.0" />
</ItemGroup>

<!-- Include these transitive dependencies to overrule NuGet's ProjectReference over PackageReferene behavior: https://github.com/NuGet/Home/issues/9354. -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<PackageReference Include="Microsoft.Win32.Primitives" Version="$(MicrosoftWin32PrimitivesVersion)" />
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
<PackageReference Include="System.Runtime" Version="$(SystemRuntimeVersion)" />
<PackageReference Include="System.Runtime.Extensions" Version="$(SystemRuntimeExtensionsVersion)" />
<PackageReference Include="System.Net.Primitives" Version="$(SystemNetPrimitivesVersion)" />
<PackageReference Include="System.Collections" Version="$(SystemCollectionsVersion)" />
<PackageReference Include="System.Runtime.InteropServices" Version="$(SystemRuntimeInteropServicesVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="Microsoft.VisualBasic.Core.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\System.ComponentModel\ref\System.ComponentModel.csproj" />
<ProjectReference Include="..\..\System.IO.FileSystem.DriveInfo\ref\System.IO.FileSystem.DriveInfo.csproj" />
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
<ProjectReference Include="..\..\System.Runtime.InteropServices\ref\System.Runtime.InteropServices.csproj" />
<ProjectReference Include="..\..\System.Security.Principal\ref\System.Security.Principal.csproj" />
<ProjectReference Include="..\..\System.Threading.Thread\ref\System.Threading.Thread.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.IO.FileSystem.DriveInfo\ref\System.IO.FileSystem.DriveInfo.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -105,33 +105,19 @@
<Reference Include="System.Collections" />
<Reference Include="System.Collections.NonGeneric" />
<Reference Include="System.Collections.Specialized" />
<Reference Include="System.ComponentModel" />
<Reference Include="System.ComponentModel.Primitives" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Diagnostics.Process" />
<Reference Include="System.Dynamic.Runtime" />
<Reference Include="System.Globalization" />
<Reference Include="System.IO" />
<Reference Include="System.IO.FileSystem" />
<Reference Include="System.IO.FileSystem.DriveInfo" />
<Reference Include="System.Linq" />
<Reference Include="System.Linq.Expressions" />
<Reference Include="System.ObjectModel" />
<Reference Include="System.Reflection" />
<Reference Include="System.Reflection.Emit" />
<Reference Include="System.Reflection.Emit.ILGeneration" />
<Reference Include="System.Reflection.Emit.Lightweight" />
<Reference Include="System.Reflection.Extensions" />
<Reference Include="System.Reflection.Primitives" />
<Reference Include="System.Reflection.TypeExtensions" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Security.Principal" />
<Reference Include="System.Text.RegularExpressions" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Threading.Thread" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryVersion)" />
<PackageReference Include="System.Security.AccessControl" Version="$(SystemSecurityAccessControlVersion)" />
<!-- Manually reference the transitive dependency to make NuGet pick the package over the transitive project: https://github.com/NuGet/Home/issues/10368 -->
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" PrivateAssets="all" />
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" PrivateAssets="all" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\Microsoft.Win32.Registry.AccessControl.csproj" />
<!-- Manually reference the transitive dependency to make NuGet pick the package over the transitive project: https://github.com/NuGet/Home/issues/10368 -->
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" PrivateAssets="all" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="Microsoft.Win32.Registry.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.IO.Pipes.AccessControl\ref\System.IO.Pipes.AccessControl.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Security.AccessControl\ref\System.Security.AccessControl.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Security.Principal.Windows\ref\System.Security.Principal.Windows.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,8 @@
<ItemGroup>
<Reference Include="System.Buffers" />
<Reference Include="System.Collections" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Diagnostics.Tools" />
<Reference Include="System.Memory" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Security.AccessControl" />
<Reference Include="System.Security.Principal.Windows" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
<ProjectReference Include="$(LibrariesProjectRoot)System.Collections\ref\System.Collections.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime.InteropServices\ref\System.Runtime.InteropServices.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
</ItemGroup>
<ItemGroup>
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Threading" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
<ProjectReference Include="..\..\System.ComponentModel.Primitives\ref\System.ComponentModel.Primitives.csproj" />
<ProjectReference Include="..\..\System.Collections.NonGeneric\ref\System.Collections.NonGeneric.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
Link="Common\System\Collections\CompatibleComparer.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Collections.NonGeneric" />
<Reference Include="System.ComponentModel.Primitives" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Threading" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
<Reference Include="System.ComponentModel.TypeConverter" />
<Reference Include="System.Linq" />
<Reference Include="System.Runtime" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Text.RegularExpressions" />
<Reference Include="System.Threading" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
<Reference Include="System.ComponentModel" />
<Reference Include="System.ObjectModel" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Threading" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="System.ComponentModel.manual.cs" />
<Compile Include="System.ComponentModel.TypeConverter.cs" />
<Compile Include="System.ComponentModel.TypeConverter.Forwards.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\System.Collections.NonGeneric\ref\System.Collections.NonGeneric.csproj" />
<ProjectReference Include="..\..\System.ComponentModel\ref\System.ComponentModel.csproj" />
<ProjectReference Include="..\..\System.Drawing.Primitives\ref\System.Drawing.Primitives.csproj" />
<ProjectReference Include="..\..\System.ComponentModel.Primitives\ref\System.ComponentModel.Primitives.csproj" />
<ProjectReference Include="..\..\System.ObjectModel\ref\System.ObjectModel.csproj" />
<ProjectReference Include="..\..\System.Resources.Writer\ref\System.Resources.Writer.csproj" />
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -245,21 +245,17 @@
<Reference Include="System.ComponentModel" />
<Reference Include="System.ComponentModel.Primitives" />
<Reference Include="System.Drawing.Primitives" />
<Reference Include="System.IO.FileSystem" />
<Reference Include="System.Linq" />
<Reference Include="System.Memory" />
<Reference Include="System.Net.Primitives" />
<Reference Include="System.Net.Security" />
<Reference Include="System.ObjectModel" />
<Reference Include="System.Resources.Writer" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Runtime.Loader" />
<Reference Include="System.Runtime.Serialization.Formatters" />
<Reference Include="System.Text.RegularExpressions" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Thread" />
<Reference Include="System.Xml.XDocument" />
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions src/libraries/System.Console/ref/System.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
<ProjectReference Include="..\..\System.Text.Encoding\ref\System.Text.Encoding.csproj" />
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions src/libraries/System.Console/src/System.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@
<Reference Include="System.Collections" />
<Reference Include="System.Memory" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Text.Encoding.Extensions" />
<Reference Include="System.Threading" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
<Compile Include="System.Data.Common.manual.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Collections.NonGeneric\ref\System.Collections.NonGeneric.csproj" />
<ProjectReference Include="..\..\System.ComponentModel\ref\System.ComponentModel.csproj" />
<ProjectReference Include="..\..\System.ComponentModel.Primitives\ref\System.ComponentModel.Primitives.csproj" />
<ProjectReference Include="..\..\System.ComponentModel.TypeConverter\ref\System.ComponentModel.TypeConverter.csproj" />
<ProjectReference Include="..\..\System.ObjectModel\ref\System.ObjectModel.csproj" />
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
<ProjectReference Include="..\..\System.Transactions.Local\ref\System.Transactions.Local.csproj" />
<ProjectReference Include="..\..\System.Xml.ReaderWriter\ref\System.Xml.ReaderWriter.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@
<ProjectReference Include="..\..\System.Collections.NonGeneric\src\System.Collections.NonGeneric.csproj" />
<ProjectReference Include="..\..\System.ComponentModel.TypeConverter\src\System.ComponentModel.TypeConverter.csproj" />
<ProjectReference Include="..\..\System.Runtime\src\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj" />
<ProjectReference Include="..\..\System.Private.Uri\src\System.Private.Uri.csproj" />
<Reference Include="System.Collections.Concurrent" />
<Reference Include="System.ComponentModel" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
<PropertyGroup>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Collections" />
<Reference Include="System.Runtime" />
<Reference Include="System.Threading.Thread" />
<Reference Include="System.Data.Common" />
<Reference Include="System.Linq" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
<Compile Include="System.Diagnostics.EventLog.netframework.cs" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'">
<ProjectReference Include="$(LibrariesProjectRoot)System.Security.Permissions\ref\System.Security.Permissions.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" PrivateAssets="all" />
</ItemGroup>
Expand Down
Loading

0 comments on commit ba055bd

Please sign in to comment.