Skip to content

Commit

Permalink
Add NetCoreAppCurrent configuration to libs (Phase 1) (#54544)
Browse files Browse the repository at this point in the history
* Use property to indicate NetCoreApp min version

* Add NetCoreAppCurrent to S.Numerics.Tensors

* Add NetCoreAppCurrent to S.T.AccessControl

* Add NetCoreAppCurrent to System.Memory.Data

* Add NetCoreAppCurrent to S.Composition.* projects

* Add NetCoreAppCurrent to System.IO.Packaging

* Add NetCoreAppCurrent config to System.IO.Ports

Adding a NetCoreAppCurrent configuration to System.IO.Ports and
reducing package size, build times and platform specific assets by
using runtime checks on Unix derivates for the slightly diverging
SerialPort implementation.

Contributes to #54012

* Add NetCoreAppCurrent to System.Data.OleDb

* Add NetCoreAppCurrent to M.W32.Registry.AccessControl

* Add NetCoreAppCurrent to S.Reflection.Context

* Add NetCoreAppCurrent to S.C.Composition.Registration

* Add NetCoreAppCurrent to S.Resources.Extensions

* Add NetCoreAppCurrent to S.N.H.WinHttpHandler
  • Loading branch information
ViktorHofer authored Jun 29, 2021
1 parent 53e6b47 commit b056b7b
Show file tree
Hide file tree
Showing 96 changed files with 516 additions and 240 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<NetCoreAppCurrentIdentifier>.NETCoreApp</NetCoreAppCurrentIdentifier>
<NetCoreAppCurrentTargetFrameworkMoniker>$(NetCoreAppCurrentIdentifier),Version=v$(NetCoreAppCurrentVersion)</NetCoreAppCurrentTargetFrameworkMoniker>
<NetCoreAppCurrent>net$(NetCoreAppCurrentVersion)</NetCoreAppCurrent>
<NetCoreAppMinimum>netcoreapp3.1</NetCoreAppMinimum>
<AspNetCoreAppCurrent>net$(AspNetCoreAppCurrentVersion)</AspNetCoreAppCurrent>
<NetCoreAppToolCurrent>net$(NetCoreAppToolCurrentVersion)</NetCoreAppToolCurrent>
<NetCoreAppCurrentToolTargetFrameworkMoniker>$(NetCoreAppCurrentIdentifier),Version=v$(NetCoreAppToolCurrentVersion)</NetCoreAppCurrentToolTargetFrameworkMoniker>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</ItemGroup>

<ItemGroup>
<NETStandardCompatError Include="netcoreapp2.0" Supported="netcoreapp3.1" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>

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

<ItemGroup>
<NETStandardCompatError Include="netcoreapp2.0" Supported="netcoreapp3.1" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ Microsoft.Extensions.Primitives.StringSegment</PackageDescription>
</ItemGroup>

<ItemGroup>
<NETStandardCompatError Include="netcoreapp2.0" Supported="netcoreapp3.1" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<ProjectReference Include="..\src\Microsoft.Win32.Registry.AccessControl.csproj" />
<!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
<ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore50;uap10.0;net46" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;net461</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>

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

<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Win32.Registry\ref\Microsoft.Win32.Registry.csproj" />
</ItemGroup>

<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. -->
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsVersion)" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<TargetFrameworks>netstandard2.0-windows;netstandard2.0;net461-windows</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netstandard2.0-windows;netstandard2.0;net461-windows</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>

<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsWindows)' != 'true'">SR.PlatformNotSupported_RegistryAccessControl</GeneratePlatformNotSupportedAssemblyMessage>
<OmitResources Condition="$(TargetFramework.StartsWith('net4'))">true</OmitResources>
<OmitResources Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">true</OmitResources>
</PropertyGroup>

<ItemGroup Condition="'$(TargetsWindows)' == 'true'">
<Compile Include="Microsoft\Win32\RegistryAclExtensions.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<Reference Include="Microsoft.Win32.Registry" />
<Reference Include="System.Runtime" />
<Reference Include="System.Security.AccessControl" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard'">
<PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryVersion)" />
<PackageReference Include="System.Security.AccessControl" Version="$(SystemSecurityAccessControlVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@
<ItemGroup>
<ProjectReference Include="..\src\Microsoft.Win32.Registry.AccessControl.csproj" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('$(NetCoreAppCurrent)'))">
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Win32.Registry\src\Microsoft.Win32.Registry.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<SupportedFramework>uap10.0.16299;net461;netcoreapp2.0;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\Microsoft.Win32.SystemEvents.csproj" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="netcoreapp3.1" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<InboxOnTargetFramework Include="net461">
<AsFrameworkReference>true</AsFrameworkReference>
</InboxOnTargetFramework>
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.1</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<Compile Include="System.ComponentModel.Composition.Registration.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\System.ComponentModel.Composition\ref\System.ComponentModel.Composition.csproj" />
<ProjectReference Include="..\..\System.Reflection.Context\ref\System.Reflection.Context.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.ComponentModel.Composition\ref\System.ComponentModel.Composition.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Reflection.Context\ref\System.Reflection.Context.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.1</TargetFrameworks>
<SetIsTrimmable>false</SetIsTrimmable>
</PropertyGroup>

<ItemGroup>
<Compile Include="System\ComponentModel\Composition\Registration\ExportBuilder.cs" />
<Compile Include="System\ComponentModel\Composition\Registration\ImportBuilder.cs" />
Expand All @@ -24,8 +25,17 @@
<Compile Include="$(CommonPath)System\Composition\Diagnostics\TraceWriter.cs"
Link="Common\System\Composition\Diagnostics\TraceWriter.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.ComponentModel.Composition\src\System.ComponentModel.Composition.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Reflection.Context\src\System.Reflection.Context.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<Reference Include="System.Collections" />
<Reference Include="System.Linq" />
<Reference Include="System.Linq.Expressions" />
<Reference Include="System.Runtime" />
<Reference Include="System.Threading" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<!-- Disable nullable attributes explicitly as some tests depend on them not being present. -->
<Nullable>disable</Nullable>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</InboxOnTargetFramework>
<InboxOnTargetFramework Include="uap10.0.16299" />
<InboxOnTargetFramework Include="$(AllXamarinFrameworks)" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="netcoreapp3.1" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</ProjectReference>
<!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
<ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore45;netcore451;netcore50;uap10.0;net45;net451;net46;wp8;wpa81" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<Compile Include="System\Composition\Convention\AttributedModelProvider.cs" />
<Compile Include="System\Composition\ExportAttribute.cs" />
Expand All @@ -17,4 +18,8 @@
<Compile Include="System\Composition\SharedAttribute.cs" />
<Compile Include="System\Composition\SharingBoundaryAttribute.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<Reference Include="System.Runtime" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</ProjectReference>
<!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
<ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore45;netcore451;netcore50;uap10.0;net45;net451;net46;wp8;wpa81" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;net461</TargetFrameworks>
<SetIsTrimmable>false</SetIsTrimmable>
</PropertyGroup>

<ItemGroup>
<Compile Include="System\Composition\Convention\ConventionBuilder.cs" />
<Compile Include="System\Composition\Convention\ExportConventionBuilder.cs" />
Expand All @@ -21,7 +22,16 @@
<Compile Include="$(CommonPath)System\Composition\Diagnostics\TraceWriter.cs"
Link="Common\System\Composition\Diagnostics\TraceWriter.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.Composition.AttributedModel\src\System.Composition.AttributedModel.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<Reference Include="System.Collections" />
<Reference Include="System.Linq" />
<Reference Include="System.Linq.Expressions" />
<Reference Include="System.Runtime" />
<Reference Include="System.Threading" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</ProjectReference>
<!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
<ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore45;netcore451;netcore50;uap10.0;net45;net451;net46;wp8;wpa81" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;net461</TargetFrameworks>
<SetIsTrimmable>false</SetIsTrimmable>
</PropertyGroup>

<ItemGroup>
<Compile Include="System\Composition\Hosting\CompositionHost.cs" />
<Compile Include="System\Composition\Hosting\Core\CompositeActivator.cs" />
Expand Down Expand Up @@ -31,10 +32,21 @@
<Compile Include="System\Composition\Hosting\Util\MethodInfoExtensions.cs" />
<Compile Include="System\Composition\Hosting\Util\SmallSparseInitonlyArray.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.Composition.Runtime\src\System.Composition.Runtime.csproj" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<Reference Include="System.Collections" />
<Reference Include="System.Linq" />
<Reference Include="System.Linq.Expressions" />
<Reference Include="System.ObjectModel" />
<Reference Include="System.Runtime" />
<Reference Include="System.Threading" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<Reference Include="System.ComponentModel.Composition" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</ProjectReference>
<!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
<ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore45;netcore451;netcore50;uap10.0;net45;net451;net46;wp8;wpa81" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>System.Composition</RootNamespace>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<Compile Include="System\Composition\CompositionContext.cs" />
<Compile Include="System\Composition\ExportFactoryOfT.cs" />
Expand All @@ -12,4 +13,10 @@
<Compile Include="System\Composition\Hosting\Core\CompositionContract.cs" />
<Compile Include="System\Composition\Runtime\Util\Formatters.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<Reference Include="System.Collections" />
<Reference Include="System.Linq" />
<Reference Include="System.Runtime" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</ProjectReference>
<!-- Exclude TFMs that aren't supported by the package anymore from validation. -->
<ExcludeHarvestedSupportedFramework Include="netcoreapp1.0;netcoreapp1.1;netcore45;netcore451;netcore50;uap10.0;net45;net451;net46;wp8;wpa81" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>System.Composition</RootNamespace>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);netstandard2.0;net461</TargetFrameworks>
<SetIsTrimmable>false</SetIsTrimmable>
</PropertyGroup>

<ItemGroup>
<Compile Include="System\Composition\CompositionContextExtensions.cs" />
<Compile Include="System\Composition\Convention\AttributedModelProviderExtensions.cs" />
Expand All @@ -29,9 +30,17 @@
<Compile Include="$(CoreLibSharedDir)System\Numerics\Hashing\HashHelpers.cs"
Link="Common\System\Numerics\Hashing\HashHelpers.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.Composition.AttributedModel\src\System.Composition.AttributedModel.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Composition.Hosting\src\System.Composition.Hosting.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Composition.Runtime\src\System.Composition.Runtime.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<Reference Include="System.Collections" />
<Reference Include="System.Linq" />
<Reference Include="System.Linq.Expressions" />
<Reference Include="System.Runtime" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<SupportedFramework>uap10.0.16299;net461;netcoreapp2.0;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.Data.Odbc.csproj" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="netcoreapp3.1" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.Data.OleDb.csproj" />
<NETStandardCompatError Include="netcoreapp2.0" Supported="$(NetCoreAppMinimum)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
</Project>
Loading

0 comments on commit b056b7b

Please sign in to comment.