Skip to content

Commit a0e056f

Browse files
committed
Replace Polyfill by Meziantou.Polyfill and bring back internal OperatingSystem polyfills
1 parent baba687 commit a0e056f

File tree

12 files changed

+735
-363
lines changed

12 files changed

+735
-363
lines changed

Directory.Build.props

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
2323
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
2424
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
25-
<PolyUseEmbeddedAttribute>true</PolyUseEmbeddedAttribute>
26-
<PolyArgumentExceptions>true</PolyArgumentExceptions>
2725
</PropertyGroup>
2826

2927
<PropertyGroup>
@@ -36,6 +34,11 @@
3634
<PublicKeyToken>35a561290d20de2f</PublicKeyToken>
3735
</PropertyGroup>
3836

37+
<PropertyGroup>
38+
<MeziantouPolyfill_ExcludedPolyfills>$(MeziantouPolyfill_ExcludedPolyfills);M:System.OperatingSystem.</MeziantouPolyfill_ExcludedPolyfills>
39+
<MeziantouPolyfill_ExcludedPolyfills>$(MeziantouPolyfill_ExcludedPolyfills);T:System.Net.Http.</MeziantouPolyfill_ExcludedPolyfills>
40+
</PropertyGroup>
41+
3942
<PropertyGroup Condition=" '$(DotNetRoot)' == '' ">
4043
<DotNetRoot Condition=" '$(DOTNET_HOST_PATH)' != '' ">$([System.IO.Path]::GetDirectoryName($(DOTNET_HOST_PATH)))</DotNetRoot>
4144
<DotNetRoot Condition=" '$(MSBuildRuntimeType)' != 'Core' ">$(ProgramFiles)\dotnet</DotNetRoot>

Directory.Build.targets

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,15 @@
5959
<DefineConstants>$(DefineConstants);SUPPORTS_AUTHORIZATION_MIDDLEWARE</DefineConstants>
6060
<DefineConstants>$(DefineConstants);SUPPORTS_BCL_ASYNC_ENUMERABLE</DefineConstants>
6161
<DefineConstants>$(DefineConstants);SUPPORTS_BULK_DBSET_OPERATIONS</DefineConstants>
62+
<DefineConstants>$(DefineConstants);SUPPORTS_CHUNK_LINQ_EXTENSION</DefineConstants>
6263
<DefineConstants>$(DefineConstants);SUPPORTS_DBSET_VALUETASK_FINDASYNC</DefineConstants>
6364
<DefineConstants>$(DefineConstants);SUPPORTS_ENDPOINT_ROUTING</DefineConstants>
6465
<DefineConstants>$(DefineConstants);SUPPORTS_ENVIRONMENT_PROCESS_PATH</DefineConstants>
66+
<DefineConstants>$(DefineConstants);SUPPORTS_HEXADECIMAL_STRING_CONVERSION</DefineConstants>
6567
<DefineConstants>$(DefineConstants);SUPPORTS_HTTP_CLIENT_DEFAULT_REQUEST_VERSION</DefineConstants>
6668
<DefineConstants>$(DefineConstants);SUPPORTS_HTTP_CLIENT_DEFAULT_REQUEST_VERSION_POLICY</DefineConstants>
6769
<DefineConstants>$(DefineConstants);SUPPORTS_HTTP_CLIENT_RESILIENCE</DefineConstants>
70+
<DefineConstants>$(DefineConstants);SUPPORTS_INT32_RANDOM_NUMBER_GENERATOR_METHODS</DefineConstants>
6871
<DefineConstants>$(DefineConstants);SUPPORTS_MULTIPLE_VALUES_IN_QUERYHELPERS</DefineConstants>
6972
<DefineConstants>$(DefineConstants);SUPPORTS_NAMED_PIPE_STATIC_FACTORY_WITH_ACL</DefineConstants>
7073
<DefineConstants>$(DefineConstants);SUPPORTS_ONE_SHOT_HASHING_METHODS</DefineConstants>
@@ -73,6 +76,7 @@
7376
<DefineConstants>$(DefineConstants);SUPPORTS_PEM_ENCODED_KEY_IMPORT</DefineConstants>
7477
<DefineConstants>$(DefineConstants);SUPPORTS_REDIRECTION_ON_SIGN_IN</DefineConstants>
7578
<DefineConstants>$(DefineConstants);SUPPORTS_TEXT_ELEMENT_ENUMERATOR</DefineConstants>
79+
<DefineConstants>$(DefineConstants);SUPPORTS_VALUETASK_COMPLETED_TASK</DefineConstants>
7680
<DefineConstants>$(DefineConstants);SUPPORTS_WINFORMS_TASK_DIALOG</DefineConstants>
7781
<DefineConstants>$(DefineConstants);SUPPORTS_ZLIB_COMPRESSION</DefineConstants>
7882
</PropertyGroup>
@@ -155,19 +159,6 @@
155159
<DefineConstants>$(DefineConstants);SUPPORTS_WINDOWS_RUNTIME</DefineConstants>
156160
</PropertyGroup>
157161

158-
<PropertyGroup
159-
Condition=" ('$(TargetFrameworkIdentifier)' == '.NETCore') Or
160-
('$(TargetFrameworkIdentifier)' == '.NETFramework' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '4.7'))) ">
161-
<!--
162-
Note: Polyfill only generates the OperatingSystem APIs if the System.Runtime.InteropServices.RuntimeInformation
163-
package is referenced. Yet, this package isn't necessary on UWP and .NET Framework 4.7+ and is deliberately not
164-
referenced by OpenIddict due to its problematic dependencies graph. To ensure the OperatingSystem APIs are
165-
still correctly generated, the FeatureRuntimeInformation compilation flag is manually added here.
166-
-->
167-
168-
<DefineConstants>$(DefineConstants);FeatureRuntimeInformation</DefineConstants>
169-
</PropertyGroup>
170-
171162
<!--
172163
Note: Entity Framework Core 2.x references System.Interactive.Async 3.x, that includes
173164
its own IAsyncEnumerable. To work around collisions between this type and the new type
@@ -223,21 +214,4 @@
223214
<Target Name="_CalculateXbfSupport"
224215
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCore' And '$(TargetPlatformIdentifier)' == 'UAP' " />
225216

226-
<!--
227-
Note: Polyfill internally references RequiredMemberAttribute without using "global::", which collides with
228-
the type of the same name exposed by the iOS/Mac Catalyst/macOS reference assemblies. To work around that,
229-
the RequiredMemberAttribute.cs file imported by Polyfill is excluded from compilation on these platforms.
230-
-->
231-
232-
<Target Name="RemoveRequiredMemberAttribute" BeforeTargets="CoreCompile">
233-
<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And
234-
('$(TargetPlatformIdentifier)' == 'iOS' Or
235-
'$(TargetPlatformIdentifier)' == 'MacCatalyst' Or
236-
'$(TargetPlatformIdentifier)' == 'macOS' ) ">
237-
<Compile Remove="@(Compile)"
238-
Condition=" %(Compile.NuGetPackageId) == 'Polyfill' And
239-
'%(Compile.Filename)%(Compile.Extension)' == 'RequiredMemberAttribute.cs' " />
240-
</ItemGroup>
241-
</Target>
242-
243217
</Project>

0 commit comments

Comments
 (0)