Skip to content

Commit d5a699e

Browse files
authored
React to NuGet package pruning warnings
Contributes to dotnet/sdk#46642 NuGet added a new feature that automatically prunes package and project references that are provided by the shared framework that is targeted. Resolve the few warnings that got emitted in ref projects when source-building the repository.
1 parent 68a88d1 commit d5a699e

File tree

7 files changed

+332
-317
lines changed

7 files changed

+332
-317
lines changed

eng/packaging.targets

Lines changed: 309 additions & 309 deletions
Large diffs are not rendered by default.

src/libraries/Microsoft.Extensions.Diagnostics.Abstractions/ref/Microsoft.Extensions.Diagnostics.Abstractions.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
45
</PropertyGroup>
@@ -13,7 +14,11 @@
1314
</ItemGroup>
1415

1516
<ItemGroup>
16-
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\ref\System.Diagnostics.DiagnosticSource.csproj" />
1717
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection.Abstractions\ref\Microsoft.Extensions.DependencyInjection.Abstractions.csproj" />
1818
</ItemGroup>
19+
20+
<ItemGroup Condition="'$(TargetFramework)' != '$(NetCoreAppCurrent)'">
21+
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\ref\System.Diagnostics.DiagnosticSource.csproj" />
22+
</ItemGroup>
23+
1924
</Project>

src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
45
</PropertyGroup>
@@ -9,6 +10,10 @@
910

1011
<ItemGroup>
1112
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection.Abstractions\ref\Microsoft.Extensions.DependencyInjection.Abstractions.csproj" />
13+
</ItemGroup>
14+
15+
<ItemGroup Condition="'$(TargetFramework)' != '$(NetCoreAppCurrent)'">
1216
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\ref\System.Diagnostics.DiagnosticSource.csproj" />
1317
</ItemGroup>
18+
1419
</Project>

src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.Json\ref\System.Text.Json.csproj" />
2221
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Configuration.Abstractions\ref\Microsoft.Extensions.Configuration.Abstractions.csproj" />
2322
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging.Abstractions\ref\Microsoft.Extensions.Logging.Abstractions.csproj" />
2423
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging\ref\Microsoft.Extensions.Logging.csproj" />
2524
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Options\ref\Microsoft.Extensions.Options.csproj" />
2625
</ItemGroup>
2726

27+
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
28+
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.Json\ref\System.Text.Json.csproj" />
29+
</ItemGroup>
30+
2831
</Project>

src/libraries/System.Formats.Nrbf/ref/System.Formats.Nrbf.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
23
<PropertyGroup>
34
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
45
<CLSCompliant>false</CLSCompliant>
@@ -8,7 +9,7 @@
89
<Compile Include="System.Formats.Nrbf.cs" />
910
</ItemGroup>
1011

11-
<ItemGroup>
12+
<ItemGroup Condition="'$(TargetFramework)' != '$(NetCoreAppCurrent)'">
1213
<ProjectReference Include="$(LibrariesProjectRoot)System.Reflection.Metadata\ref\System.Reflection.Metadata.csproj" />
1314
</ItemGroup>
1415

@@ -21,4 +22,5 @@
2122
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\RequiresDynamicCodeAttribute.cs" />
2223
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
2324
</ItemGroup>
25+
2426
</Project>

src/libraries/System.Memory.Data/ref/System.Memory.Data.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\RequiresUnreferencedCodeAttribute.cs" />
1414
</ItemGroup>
1515

16-
<ItemGroup>
16+
<ItemGroup Condition="'$(TargetFramework)' != '$(NetCoreAppCurrent)'">
1717
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.Json\ref\System.Text.Json.csproj" />
1818
</ItemGroup>
1919

src/libraries/System.Net.Http.Json/ref/System.Net.Http.Json.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\StringSyntaxAttribute.cs" />
1818
</ItemGroup>
1919

20-
<ItemGroup>
21-
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.Json\ref\System.Text.Json.csproj" />
22-
</ItemGroup>
23-
2420
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
2521
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.Http\ref\System.Net.Http.csproj" />
2622
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.Primitives\ref\System.Net.Primitives.csproj" />
2723
<ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" />
2824
</ItemGroup>
2925

26+
<ItemGroup Condition="'$(TargetFramework)' != '$(NetCoreAppCurrent)'">
27+
<ProjectReference Include="$(LibrariesProjectRoot)System.Text.Json\ref\System.Text.Json.csproj" />
28+
</ItemGroup>
29+
3030
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
3131
<Reference Include="System.Net.Http" />
3232
</ItemGroup>

0 commit comments

Comments
 (0)