Skip to content

Commit 6c462db

Browse files
committed
Use PolySharp to generate polyfills
1 parent 261e7d3 commit 6c462db

32 files changed

+59
-755
lines changed

src/CommunityToolkit.Common/Attributes/NotNullIfNotNullAttribute.cs

-28
This file was deleted.

src/CommunityToolkit.Common/Attributes/NotNullWhenAttribute.cs

-28
This file was deleted.

src/CommunityToolkit.Common/Attributes/SkipLocalsInitAttribute.cs

-27
This file was deleted.

src/CommunityToolkit.Common/CommunityToolkit.Common.csproj

+9
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,13 @@
1919
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
2020
</PropertyGroup>
2121

22+
<!-- Necessary polyfills -->
23+
<PropertyGroup>
24+
<PolySharpIncludeGeneratedTypes>
25+
System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute;
26+
System.Diagnostics.CodeAnalysis.NotNullWhenAttribute;
27+
System.Runtime.CompilerServices.SkipLocalsInitAttribute;
28+
</PolySharpIncludeGeneratedTypes>
29+
</PropertyGroup>
30+
2231
</Project>

src/CommunityToolkit.Diagnostics/Attributes/CallerArgumentExpressionAttribute.cs

-31
This file was deleted.

src/CommunityToolkit.Diagnostics/Attributes/DoesNotReturnAttribute.cs

-18
This file was deleted.

src/CommunityToolkit.Diagnostics/Attributes/DoesNotReturnIfAttribute.cs

-35
This file was deleted.

src/CommunityToolkit.Diagnostics/Attributes/NotNullAttribute.cs

-19
This file was deleted.

src/CommunityToolkit.Diagnostics/Attributes/SkipLocalsInitAttribute.cs

-27
This file was deleted.

src/CommunityToolkit.Diagnostics/Attributes/StackTraceHiddenAttribute.cs

-23
This file was deleted.

src/CommunityToolkit.Diagnostics/CommunityToolkit.Diagnostics.csproj

+13-1
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,26 @@
3434
</ItemGroup>
3535
</When>
3636

37-
<!-- Enable trimming support on .NET 6 -->
37+
<!-- For the .NET 6 target, simply define NETSTANDARD2_1_OR_GREATER too -->
3838
<When Condition="'$(TargetFramework)' == 'net6.0'">
3939
<PropertyGroup>
4040
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
4141
</PropertyGroup>
4242
</When>
4343
</Choose>
4444

45+
<!-- Necessary polyfills -->
46+
<PropertyGroup>
47+
<PolySharpIncludeGeneratedTypes>
48+
System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute;
49+
System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute;
50+
System.Diagnostics.CodeAnalysis.NotNullAttribute;
51+
System.Diagnostics.StackTraceHiddenAttribute;
52+
System.Runtime.CompilerServices.CallerArgumentExpressionAttribute;
53+
System.Runtime.CompilerServices.SkipLocalsInitAttribute;
54+
</PolySharpIncludeGeneratedTypes>
55+
</PropertyGroup>
56+
4557
<ItemGroup>
4658
<None Update="Generated\Guard.Comparable.Numeric.tt">
4759
<Generator>TextTemplatingFileGenerator</Generator>

src/CommunityToolkit.HighPerformance/Attributes/NotNullAttribute.cs

-19
This file was deleted.

src/CommunityToolkit.HighPerformance/Attributes/NotNullWhenAttribute.cs

-35
This file was deleted.

src/CommunityToolkit.HighPerformance/Attributes/SkipLocalsInitAttribute.cs

-27
This file was deleted.

src/CommunityToolkit.HighPerformance/CommunityToolkit.HighPerformance.csproj

+9
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,13 @@
5454
</When>
5555
</Choose>
5656

57+
<!-- Necessary polyfills -->
58+
<PropertyGroup>
59+
<PolySharpIncludeGeneratedTypes>
60+
System.Diagnostics.CodeAnalysis.NotNullAttribute;
61+
System.Diagnostics.CodeAnalysis.NotNullWhenAttribute;
62+
System.Runtime.CompilerServices.SkipLocalsInitAttribute;
63+
</PolySharpIncludeGeneratedTypes>
64+
</PropertyGroup>
65+
5766
</Project>

0 commit comments

Comments
 (0)