Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add text-only package Polyfill 7.9.1 #1105

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/textOnlyPackages/src/polyfill/7.9.1/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# exclude code from dotnet format https://github.com/dotnet/sdk/issues/38906
root = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AssemblyName>Polyfill</AssemblyName>
</PropertyGroup>

</Project>
125 changes: 125 additions & 0 deletions src/textOnlyPackages/src/polyfill/7.9.1/build/Polyfill.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<Project>
<PropertyGroup>
<PrepareForBuildDependsOn>$(PrepareForBuildDependsOn);PreparePolyfill</PrepareForBuildDependsOn>
<LowerFramework>$(TargetFramework.ToLower())</LowerFramework>
<LowerFrameworks>$(TargetFrameworks.ToLower())</LowerFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(NETCoreSdkVersion)' != '' AND $([MSBuild]::VersionGreaterThanOrEquals($(NETCoreSdkVersion), '9'))">
<DefineConstants Condition="$(LangVersion) == '13'">$(DefineConstants);LangVersion13</DefineConstants>
<DefineConstants Condition="$(LangVersion) == 'latest'">$(DefineConstants);LangVersion13</DefineConstants>
<DefineConstants Condition="$(LangVersion) == 'preview'">$(DefineConstants);LangVersion13</DefineConstants>
<DefineConstants Condition="$(LangVersion) == 'default'">$(DefineConstants);LangVersion13</DefineConstants>
<DefineConstants Condition="$(LangVersion) == 'latestMajor'">$(DefineConstants);LangVersion13</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(AllowUnsafeBlocks) == 'true' ">
<DefineConstants>$(DefineConstants);AllowUnsafeBlocks</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(PolyPublic) == 'true' ">
<DefineConstants>$(DefineConstants);PolyPublic</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(LowerFramework.StartsWith('netcoreapp2'))">
<DefineConstants>$(DefineConstants);NETCOREAPP2X</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(LowerFramework.StartsWith('netcoreapp3'))">
<DefineConstants>$(DefineConstants);NETCOREAPP3X</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(LowerFramework.StartsWith('net46'))">
<DefineConstants>$(DefineConstants);NET46X</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(LowerFramework.StartsWith('net47'))">
<DefineConstants>$(DefineConstants);NET47X</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(LowerFramework.StartsWith('net48'))">
<DefineConstants>$(DefineConstants);NET48X</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="$(LowerFramework.StartsWith('netcoreapp2')) or
$(LowerFramework.StartsWith('netcoreapp3'))">
<DefineConstants>$(DefineConstants);NETCOREAPPX</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<MaxNetRequired>false</MaxNetRequired>
<MaxNetRequired
Condition="($(LowerFrameworks.Contains('net5')) OR
$(LowerFrameworks.Contains('net6')) OR
$(LowerFrameworks.Contains('net7')) OR
$(LowerFrameworks.Contains('netstandard')) OR
$(LowerFrameworks.Contains('netcore')))
AND
!$(LowerFrameworks.Contains('net8'))
AND
!$(LowerFramework.Contains('net8'))"
>true</MaxNetRequired>

<MaxNetClassicRequired>false</MaxNetClassicRequired>
<MaxNetClassicRequired
Condition="(
$(LowerFrameworks.Contains('net4')) OR
$(LowerFrameworks.Contains('netstandard'))
)
AND
!$(LowerFramework.Contains('net48'))
AND
!$(LowerFrameworks.Contains('net48'))"
>true</MaxNetClassicRequired>
</PropertyGroup>
<Target
Name="PolyfillValidateNugetTargets"
AfterTargets="AfterBuild"
Condition="$(NoWarn.Contains('PolyfillTargetsForNuget')) != true And '$(GeneratePackageOnBuild)' == 'true'">
<Warning
Code="PolyfillTargetsForNuget"
Text="Projects that produce a nuget and consume Polyfill:
For best performance all frameworks from the lowest TargetFramework up to and including net48 should be targeted.
For example:
* If a nuget's minimum target is net47, then the resulting TargetFrameworks should include net471, net472, and net48.
* If a nuget's minimum target net6, then the resulting TargetFrameworks should include net7.0 and net8.0."
HelpLink="https://github.com/SimonCropp/Polyfill#targetframeworks"
Condition="$(MaxNetRequired)" />
</Target>

<Target Name="PreparePolyfill" DependsOnTargets="ResolvePackageAssets">
<PropertyGroup>
<DefineConstants
Condition="@(ResolvedCompileFileDefinitions->AnyHaveMetadataValue('NuGetPackageId', 'System.ValueTuple'))">$(DefineConstants);FeatureValueTuple</DefineConstants>

<MemoryVersion>@(ResolvedCompileFileDefinitions->WithMetadataValue('NuGetPackageId', 'System.Memory')->Metadata('NuGetPackageVersion'))</MemoryVersion>

<DefineConstants
Condition="'$(MemoryVersion)' != '' AND $([MSBuild]::VersionGreaterThanOrEquals($(MemoryVersion), '4.5.5'))">$(DefineConstants);FeatureMemory</DefineConstants>

<DefineConstants
Condition="@(ResolvedCompileFileDefinitions->AnyHaveMetadataValue('NuGetPackageId', 'System.Threading.Tasks.Extensions'))">$(DefineConstants);FeatureValueTask</DefineConstants>

<DefineConstants
Condition="@(ResolvedCompileFileDefinitions->AnyHaveMetadataValue('NuGetPackageId', 'System.Net.Http')) OR @(Reference->AnyHaveMetadataValue('Identity', 'System.Net.Http'))">$(DefineConstants);FeatureHttp</DefineConstants>

<DefineConstants Condition="$(LowerFramework.StartsWith('net9'))">$(DefineConstants);FeatureMemory;FeatureValueTuple;FeatureValueTask</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net8'))">$(DefineConstants);FeatureMemory;FeatureValueTuple;FeatureValueTask</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net7'))">$(DefineConstants);FeatureMemory;FeatureValueTuple;FeatureValueTask</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net6'))">$(DefineConstants);FeatureMemory;FeatureValueTuple;FeatureValueTask</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net5'))">$(DefineConstants);FeatureMemory;FeatureValueTuple;FeatureValueTask</DefineConstants>
<DefineConstants Condition="'$(LowerFramework)'=='netcoreapp3.1'">$(DefineConstants);FeatureMemory;FeatureValueTuple;FeatureValueTask</DefineConstants>
<DefineConstants Condition="'$(LowerFramework)'=='netcoreapp3.0'">$(DefineConstants);FeatureMemory;FeatureValueTuple;FeatureValueTask</DefineConstants>
<DefineConstants Condition="'$(LowerFramework)'=='netcoreapp2.2'">$(DefineConstants);FeatureMemory;FeatureValueTuple;FeatureValueTask</DefineConstants>
<DefineConstants Condition="'$(LowerFramework)'=='netcoreapp2.1'">$(DefineConstants);FeatureMemory;FeatureValueTuple;FeatureValueTask</DefineConstants>
<DefineConstants Condition="'$(LowerFramework)'=='netcoreapp2.0'">$(DefineConstants);FeatureValueTuple</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net47'))">$(DefineConstants);FeatureValueTuple</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net48'))">$(DefineConstants);FeatureValueTuple</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('netstandard2.1'))">$(DefineConstants);FeatureValueTuple;FeatureValueTask</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('netstandard2.0'))">$(DefineConstants);FeatureValueTuple</DefineConstants>
</PropertyGroup>
</Target>
<ItemGroup>

<Compile Condition="'$(PolyGuard)' != 'true' "
Remove="$(MSBuildThisFileDirectory)..\**\Guard\*.cs" />

<Compile Condition="'$(PolyNullability)' != 'true' "
Remove="$(MSBuildThisFileDirectory)..\**\NullabilityInfoExtensions.cs" />

<Compile Update="@(Compile)">
<Visible Condition="%(NuGetItemType) == 'Compile' and
%(NuGetPackageId) == 'Polyfill'">false</Visible>
</Compile>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// <auto-generated />
#pragma warning disable

#if NETFRAMEWORK || NETSTANDARD || NETCOREAPP2X

namespace System.Runtime.CompilerServices;

using Diagnostics;
using Diagnostics.CodeAnalysis;
using Link = ComponentModel.DescriptionAttribute;

/// <summary>
/// Indicates that a parameter captures the expression passed for another parameter as a string.
/// </summary>
[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
[AttributeUsage(AttributeTargets.Parameter)]
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.callerargumentexpressionattribute
#if PolyPublic
public
#endif
sealed class CallerArgumentExpressionAttribute :
Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="CallerArgumentExpressionAttribute"/> class.
/// </summary>
/// <param name="parameterName">
/// The name of the parameter whose expression should be captured as a string.
/// </param>
public CallerArgumentExpressionAttribute(string parameterName) =>
ParameterName = parameterName;

/// <summary>
/// Gets the name of the parameter whose expression should be captured as a string.
/// </summary>
public string ParameterName { get; }
}

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// <auto-generated />
#pragma warning disable

#if !NET8_0_OR_GREATER && FeatureMemory

namespace System.Runtime.CompilerServices;

using Diagnostics;
using Diagnostics.CodeAnalysis;
using Link = ComponentModel.DescriptionAttribute;

[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, Inherited = false)]
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.collectionbuilderattribute
#if PolyPublic
public
#endif
sealed class CollectionBuilderAttribute : Attribute
{
/// <summary>Initialize the attribute to refer to the <paramref name="methodName"/> method on the <paramref name="builderType"/> type.</summary>
/// <param name="builderType">The type of the builder to use to construct the collection.</param>
/// <param name="methodName">The name of the method on the builder to use to construct the collection.</param>
/// <remarks>
/// <paramref name="methodName"/> must refer to a static method that accepts a single parameter of
/// type <see cref="ReadOnlySpan{T}"/> and returns an instance of the collection being built containing
/// a copy of the data from that span. In future releases of .NET, additional patterns may be supported.
/// </remarks>
public CollectionBuilderAttribute(Type builderType, string methodName)
{
BuilderType = builderType;
MethodName = methodName;
}

/// <summary>Gets the type of the builder to use to construct the collection.</summary>
public Type BuilderType { get; }

/// <summary>Gets the name of the method on the builder to use to construct the collection.</summary>
/// <remarks>This should match the metadata name of the target method. For example, this might be ".ctor" if targeting the type's constructor.</remarks>
public string MethodName { get; }
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// <auto-generated />
#pragma warning disable

#if !NET7_0_OR_GREATER

namespace System.Runtime.CompilerServices;

using Diagnostics;
using Diagnostics.CodeAnalysis;
using Link = ComponentModel.DescriptionAttribute;

/// <summary>
/// Indicates that compiler support for a particular feature is required for the location where this attribute is applied.
/// </summary>
[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
[AttributeUsage(
validOn: AttributeTargets.All,
AllowMultiple = true,
Inherited = false)]
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.compilerfeaturerequiredattribute
#if PolyPublic
public
#endif
sealed class CompilerFeatureRequiredAttribute :
Attribute
{
/// <summary>
/// Initialize a new instance of <see cref="CompilerFeatureRequiredAttribute"/>
/// </summary>
/// <param name="featureName">The name of the required compiler feature.</param>
public CompilerFeatureRequiredAttribute(string featureName) =>
FeatureName = featureName;

/// <summary>
/// The name of the compiler feature.
/// </summary>
public string FeatureName { get; }

/// <summary>
/// If true, the compiler can choose to allow access to the location where this attribute is applied if it does not understand <see cref="FeatureName"/>.
/// </summary>
public bool IsOptional { get; init; }

/// <summary>
/// The <see cref="FeatureName"/> used for the ref structs C# feature.
/// </summary>
public const string RefStructs = nameof(RefStructs);

/// <summary>
/// The <see cref="FeatureName"/> used for the required members C# feature.
/// </summary>
public const string RequiredMembers = nameof(RequiredMembers);
}

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// <auto-generated />
#pragma warning disable

#if !NET7_0_OR_GREATER

#nullable enable
namespace System.Diagnostics.CodeAnalysis;

using Diagnostics;

/// <summary>
/// Indicates that the specified method parameter expects a constant.
/// </summary>
/// <remarks>
/// This can be used to inform tooling that a constant should be used as an argument for the annotated parameter.
/// </remarks>
[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.constantexpectedattribute
#if PolyPublic
public
#endif
sealed class ConstantExpectedAttribute : Attribute
{
/// <summary>
/// Indicates the minimum bound of the expected constant, inclusive.
/// </summary>
public object? Min { get; set; }
/// <summary>
/// Indicates the maximum bound of the expected constant, inclusive.
/// </summary>
public object? Max { get; set; }
}
#endif
Loading