Use PolySharp for automatic polyfilling (#5161)

* Remove unnecessary whitespace in packages.yml

The whitespace after the if conditional in packages.yml was unused and unnecessary. This commit ensures to remove those to promote cleaner, more efficient code.

* Update default package version in GitHub workflows

The package version in the GitHub workflows configuration (.github/workflows/packages.yml) has been updated from 3.1.0 to 3.2.0. This change reflects version updates in the package management system.

* Use PolySharp for automatic polyfilling

PolySharp is a design time only dependency which will analyze which polyfills are needed for the currently building target framework and will then source generate only the needed polyfills. Also they're internal by default so they don't conflict.

fixes #5157

---------

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>
This commit is contained in:
Robin Sue 2024-04-02 15:17:25 +02:00 committed by GitHub
parent b4f5797ec2
commit 2f6e579cb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 9 deletions

View file

@ -66,6 +66,7 @@
<PackageVersion Include="Nuke.Components" Version="8.0.0"/>
<PackageVersion Include="Open.Linq.AsyncExtensions" Version="1.2.0"/>
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0"/>
<PackageVersion Include="PolySharp" Version="1.14.1"/>
<PackageVersion Include="Proto.Actor" Version="1.5.0"/>
<PackageVersion Include="Proto.Cluster" Version="1.5.0"/>
<PackageVersion Include="Proto.Cluster.CodeGen" Version="1.5.0"/>

View file

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>
@ -10,6 +10,10 @@
<ItemGroup>
<PackageReference Include="Humanizer.Core" />
<PackageReference Include="IronCompress" />
<PackageReference Include="PolySharp">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Linq.Dynamic.Core" />
</ItemGroup>

View file

@ -1,8 +0,0 @@
// See: https://github.com/dotnet/core/issues/8016
namespace System.Runtime.CompilerServices;
public class RequiredMemberAttribute : Attribute { }
public class CompilerFeatureRequiredAttribute : Attribute
{
public CompilerFeatureRequiredAttribute(string name) { }
}