Skip to content

Commit 2edbb0a

Browse files
authored
Merge pull request #510 from CommunityToolkit/dev/shared-props
Use PolySharp for polyfills, and centralize shared MSBuild properties
2 parents e896978 + 765901a commit 2edbb0a

38 files changed

+126
-801
lines changed

build/Community.Toolkit.Common.props

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<PropertyGroup>
2828
<SignAssembly>true</SignAssembly>
2929
<AssemblyOriginatorKeyFile>$(RepositoryDirectory)toolkit.snk</AssemblyOriginatorKeyFile>
30+
<AssemblySignPublicKey>002400000480000094000000060200000024000052534131000400000100010041753AF735AE6140C9508567666C51C6AB929806ADB0D210694B30AB142A060237BC741F9682E7D8D4310364B4BBA4EE89CC9D3D5CE7E5583587E8EA44DCA09977996582875E71FB54FA7B170798D853D5D8010B07219633BDB761D01AC924DA44576D6180CDCEAE537973982BB461C541541D58417A3794E34F45E6F2D129E2</AssemblySignPublicKey>
3031
</PropertyGroup>
3132

3233
<PropertyGroup>

build/Community.Toolkit.Common.targets

-6
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,4 @@
1717
<None Include="$(RepositoryDirectory)ThirdPartyNotices.txt" Pack="true" PackagePath="\" Visible="False" />
1818
</ItemGroup>
1919

20-
<!-- Configure trimming for core projects on .NET 6 and above -->
21-
<PropertyGroup Condition="'$(IsCoreProject)' == 'true' AND ('$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0')">
22-
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
23-
<IsTrimmable>true</IsTrimmable>
24-
</PropertyGroup>
25-
2620
</Project>

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@
1414
<PackageTags>Incremental;Loading;Collection;IncrementalLoadingCollection;String;Array;Extensions;Helpers</PackageTags>
1515
</PropertyGroup>
1616

17-
<!-- .NET Standard 2.1 and .NET 6 already have [NotNullIfNotNull] and [NotNullWhen] -->
18-
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
19-
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
17+
<!-- Necessary polyfills -->
18+
<PropertyGroup>
19+
<PolySharpIncludeGeneratedTypes>
20+
System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute;
21+
System.Diagnostics.CodeAnalysis.NotNullWhenAttribute;
22+
System.Runtime.CompilerServices.SkipLocalsInitAttribute;
23+
</PolySharpIncludeGeneratedTypes>
2024
</PropertyGroup>
2125

2226
</Project>

src/CommunityToolkit.Common/Properties/AssemblyInfo.cs

-8
This file was deleted.

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

+15-14
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,34 @@
1515
</PropertyGroup>
1616

1717
<Choose>
18-
<When Condition="'$(TargetFramework)' == 'netstandard2.0'">
1918

20-
<!-- .NET Standard 2.0 doesn't have the Span<T> type -->
19+
<!-- .NET Standard 2.0 doesn't have the Span<T> type -->
20+
<When Condition="'$(TargetFramework)' == 'netstandard2.0'">
2121
<ItemGroup>
2222
<PackageReference Include="System.Memory" Version="4.5.5" />
2323
</ItemGroup>
2424
</When>
2525

26+
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
2627
<When Condition="'$(TargetFramework)' == 'netstandard2.1'">
27-
<PropertyGroup>
28-
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
29-
</PropertyGroup>
30-
31-
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
3228
<ItemGroup>
3329
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
3430
</ItemGroup>
3531
</When>
36-
37-
<!-- Enable trimming support on .NET 6 -->
38-
<When Condition="'$(TargetFramework)' == 'net6.0'">
39-
<PropertyGroup>
40-
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
41-
</PropertyGroup>
42-
</When>
4332
</Choose>
4433

34+
<!-- Necessary polyfills -->
35+
<PropertyGroup>
36+
<PolySharpIncludeGeneratedTypes>
37+
System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute;
38+
System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute;
39+
System.Diagnostics.CodeAnalysis.NotNullAttribute;
40+
System.Diagnostics.StackTraceHiddenAttribute;
41+
System.Runtime.CompilerServices.CallerArgumentExpressionAttribute;
42+
System.Runtime.CompilerServices.SkipLocalsInitAttribute;
43+
</PolySharpIncludeGeneratedTypes>
44+
</PropertyGroup>
45+
4546
<ItemGroup>
4647
<None Update="Generated\Guard.Comparable.Numeric.tt">
4748
<Generator>TextTemplatingFileGenerator</Generator>

src/CommunityToolkit.Diagnostics/Properties/AssemblyInfo.cs

-8
This file was deleted.

src/CommunityToolkit.HighPerformance/Attributes/NotNullAttribute.cs

-19
This file was deleted.

0 commit comments

Comments
 (0)