Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Feb 20, 2024
1 parent 0ebd42b commit cfc65cc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ using System.Threading.Tasks;
static partial class Polyfill
{

#if TASKSEXTENSIONSREFERENCED
#if FeatureValueTask

/// <summary>
/// Asynchronously writes a character memory region to the stream.
Expand Down
26 changes: 12 additions & 14 deletions src/Polyfill/Polyfill.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>
<PropertyGroup>
<PrepareForBuildDependsOn>$(PrepareForBuildDependsOn);PreparePolyfill</PrepareForBuildDependsOn>
<TasksExtensionsReferenced>false</TasksExtensionsReferenced>
<LowerFramework>$(TargetFramework.ToLower())</LowerFramework>
</PropertyGroup>
<PropertyGroup Condition="$(AllowUnsafeBlocks) == 'true' ">
Expand Down Expand Up @@ -36,27 +35,26 @@
<DefineConstants
Condition="@(PackageDependencies->WithMetadataValue('Identity', 'System.Memory')->Count()) != 0">$(DefineConstants);FeatureMemory</DefineConstants>

<TasksExtensionsReferenced
Condition="@(PackageDependencies->WithMetadataValue('Identity', 'System.Threading.Tasks.Extensions')->Count()) != 0">true</TasksExtensionsReferenced>
<DefineConstants
Condition="$(TasksExtensionsReferenced)">$(DefineConstants);TASKSEXTENSIONSREFERENCED</DefineConstants>
Condition="@(PackageDependencies->WithMetadataValue('Identity', 'System.Threading.Tasks.Extensions')->Count()) != 0">$(DefineConstants);FeatureValueTask</DefineConstants>

<DefineConstants
Condition="@(PackageDependencies->WithMetadataValue('Identity', 'System.Net.Http')->Count()) != 0 OR @(Reference->WithMetadataValue('Identity', 'System.Net.Http')->Count()) != 0">$(DefineConstants);FetureHttp</DefineConstants>

<DefineConstants Condition="$(LowerFramework.StartsWith('net9'))">$(DefineConstants);FeatureMemory;FeatureValueTuple</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net8'))">$(DefineConstants);FeatureMemory;FeatureValueTuple</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net7'))">$(DefineConstants);FeatureMemory;FeatureValueTuple</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net6'))">$(DefineConstants);FeatureMemory;FeatureValueTuple</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net5'))">$(DefineConstants);FeatureMemory;FeatureValueTuple</DefineConstants>
<DefineConstants Condition="'$(LowerFramework)'=='netcoreapp3.1'">$(DefineConstants);FeatureMemory;FeatureValueTuple</DefineConstants>
<DefineConstants Condition="'$(LowerFramework)'=='netcoreapp3.0'">$(DefineConstants);FeatureMemory;FeatureValueTuple</DefineConstants>
<DefineConstants Condition="'$(LowerFramework)'=='netcoreapp2.2'">$(DefineConstants);FeatureMemory;FeatureValueTuple</DefineConstants>
<DefineConstants Condition="'$(LowerFramework)'=='netcoreapp2.1'">$(DefineConstants);FeatureMemory;FeatureValueTuple</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'))">$(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>
Expand Down
2 changes: 1 addition & 1 deletion src/Polyfill/Polyfill_Stream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#pragma warning disable

#if TASKSEXTENSIONSREFERENCED && (NETFRAMEWORK || NETSTANDARD2_0 || NETCOREAPP2_0)
#if FeatureValueTask && (NETFRAMEWORK || NETSTANDARD2_0 || NETCOREAPP2_0)

using System;
using System.IO;
Expand Down
2 changes: 1 addition & 1 deletion src/Polyfill/Polyfill_TextReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

static partial class Polyfill
{
#if TASKSEXTENSIONSREFERENCED && FeatureMemory && (NETFRAMEWORK || NETSTANDARD2_0 || NETCOREAPP2_0)
#if FeatureValueTask && FeatureMemory && (NETFRAMEWORK || NETSTANDARD2_0 || NETCOREAPP2_0)
/// <summary>
/// Asynchronously reads the characters from the current stream into a memory block.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Polyfill/Polyfill_TextWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
static partial class Polyfill
{

#if TASKSEXTENSIONSREFERENCED
#if FeatureValueTask

/// <summary>
/// Asynchronously writes a character memory region to the stream.
Expand Down

0 comments on commit cfc65cc

Please sign in to comment.