mirror of
https://github.com/CommunityToolkit/dotnet.git
synced 2026-10-26 10:11:04 +08:00
Reorder code-blocks for better readability
To make diff understandable through blame and across similar project files, I have re-organized some lines in these project files. This also improves readability. Previously, the focus is per-project file but now—to maintain project logic across repos and several similar logic across project files, new way of authoring project files is required. This refactor is the start of it.
This commit is contained in:
@@ -58,11 +58,6 @@
|
||||
</When>
|
||||
|
||||
<When Condition="'$(TargetFramework)' == 'netstandard2.1'">
|
||||
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
NETSTANDARD2_1_OR_GREATER: includes both .NET Standard 2.1 and .NET Core 3.1.
|
||||
This is needed because .NET Core 3.1 will be a separate package than .NET Standard 2.1.
|
||||
@@ -75,8 +70,13 @@
|
||||
available on .NET Core 2.1. So by using this constant, we can make sure to expose those
|
||||
APIs relying on that method on all target frameworks that are able to support them.
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<DefineConstants>NETSTANDARD2_1_OR_GREATER;SPAN_RUNTIME_SUPPORT</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
|
||||
<When Condition="'$(TargetFramework)' == 'net5.0'">
|
||||
@@ -86,9 +86,6 @@
|
||||
</When>
|
||||
|
||||
<When Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
<!--
|
||||
NETCORE_RUNTIME: to avoid issues with APIs that assume a specific memory layout, we define a
|
||||
.NET Core runtime constant to indicate either .NET Core 2.1 or .NET Core 3.1. These are
|
||||
@@ -101,15 +98,18 @@
|
||||
<PropertyGroup>
|
||||
<DefineConstants>NETSTANDARD2_1_OR_GREATER;SPAN_RUNTIME_SUPPORT;NETCORE_RUNTIME</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
|
||||
<When Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
|
||||
<When Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
|
||||
<PropertyGroup>
|
||||
<DefineConstants>SPAN_RUNTIME_SUPPORT;NETCORE_RUNTIME</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Incremental;Loading;Collection;IncrementalLoadingCollection;String;Array;extensions;helpers</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- .NET Standard 1.4 doesn't have the [Pure] attribute -->
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
|
||||
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- .NET Standard 2.1 and .NET 5 already have [NotNullIfNotNull] and [NotNullWhen] -->
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'net5.0'">
|
||||
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- .NET Standard 1.4 doesn't have the [Pure] attribute -->
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.4'">
|
||||
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user