Skip to content

Commit

Permalink
More robust detection of System.Memory & friends (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
hazzik authored Apr 17, 2024
1 parent 0a86951 commit 8631729
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Polyfill/Polyfill.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
<Target Name="PreparePolyfill" DependsOnTargets="ResolvePackageAssets">
<PropertyGroup>
<DefineConstants
Condition="@(PackageDependencies->WithMetadataValue('Identity', 'System.ValueTuple')->Count()) != 0">$(DefineConstants);FeatureValueTuple</DefineConstants>
Condition="@(ResolvedCompileFileDefinitions->WithMetadataValue('NuGetPackageId', 'System.ValueTuple')->Count()) != 0">$(DefineConstants);FeatureValueTuple</DefineConstants>
<DefineConstants
Condition="@(PackageDependencies->WithMetadataValue('Identity', 'System.Memory')->Count()) != 0">$(DefineConstants);FeatureMemory</DefineConstants>
Condition="@(ResolvedCompileFileDefinitions->WithMetadataValue('NuGetPackageId', 'System.Memory')->Count()) != 0">$(DefineConstants);FeatureMemory</DefineConstants>

<DefineConstants
Condition="@(PackageDependencies->WithMetadataValue('Identity', 'System.Threading.Tasks.Extensions')->Count()) != 0">$(DefineConstants);FeatureValueTask</DefineConstants>
Condition="@(ResolvedCompileFileDefinitions->WithMetadataValue('NuGetPackageId', '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>
Condition="@(ResolvedCompileFileDefinitions->WithMetadataValue('NuGetPackageId', '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;FeatureValueTask</DefineConstants>
<DefineConstants Condition="$(LowerFramework.StartsWith('net8'))">$(DefineConstants);FeatureMemory;FeatureValueTuple;FeatureValueTask</DefineConstants>
Expand All @@ -66,4 +66,4 @@
%(NuGetPackageId) == 'Polyfill'">false</Visible>
</Compile>
</ItemGroup>
</Project>
</Project>

0 comments on commit 8631729

Please sign in to comment.