Skip to content

Commit d6c44da

Browse files
committed
Fixed .csproj files for base and Diagnostics packages
1 parent 90c6f40 commit d6c44da

File tree

2 files changed

+54
-124
lines changed

2 files changed

+54
-124
lines changed
Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>netstandard1.4;netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
5-
<LangVersion>9.0</LangVersion>
6-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
7-
<Nullable>enable</Nullable>
8-
<Title>Windows Community Toolkit Diagnostics .NET Standard</Title>
9-
<Description>
10-
This package includes .NET Standard code only helpers such as:
11-
- Guard: Helper methods to verify conditions when running code.
12-
- ThrowHelper: Helper methods to efficiently throw exceptions.
13-
</Description>
14-
<PackageTags>UWP Toolkit Windows IncrementalLoadingCollection String Array extensions helpers</PackageTags>
15-
</PropertyGroup>
16-
<Choose>
17-
<When Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
18-
<ItemGroup>
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard1.4;netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
5+
<LangVersion>9.0</LangVersion>
6+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
7+
<Nullable>enable</Nullable>
8+
<Title>Windows Community Toolkit Diagnostics .NET Standard</Title>
9+
<Description>
10+
This package includes .NET Standard code only helpers such as:
11+
- Guard: Helper methods to verify conditions when running code.
12+
- ThrowHelper: Helper methods to efficiently throw exceptions.
13+
</Description>
14+
<PackageTags>UWP Toolkit Windows IncrementalLoadingCollection String Array extensions helpers</PackageTags>
15+
</PropertyGroup>
16+
<Choose>
17+
<When Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
18+
<ItemGroup>
1919

20-
<!-- .NET Standard 1.4 doesn't have the Span<T> type, ValueTuple or the [Pure] attribute -->
21-
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
22-
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
23-
<PackageReference Include="System.Memory" Version="4.5.4" />
24-
</ItemGroup>
25-
</When>
26-
<When Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
27-
<ItemGroup>
20+
<!-- .NET Standard 1.4 doesn't have the Span<T> type, ValueTuple or the [Pure] attribute -->
21+
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
22+
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
23+
<PackageReference Include="System.Memory" Version="4.5.4" />
24+
</ItemGroup>
25+
</When>
26+
<When Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
27+
<ItemGroup>
2828

29-
<!-- .NET Standard 2.0 doesn't have the Span<T> type -->
30-
<PackageReference Include="System.Memory" Version="4.5.4" />
31-
</ItemGroup>
32-
</When>
33-
<When Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
34-
<PropertyGroup>
35-
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
36-
</PropertyGroup>
37-
<ItemGroup>
29+
<!-- .NET Standard 2.0 doesn't have the Span<T> type -->
30+
<PackageReference Include="System.Memory" Version="4.5.4" />
31+
</ItemGroup>
32+
</When>
33+
<When Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
34+
<PropertyGroup>
35+
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
36+
</PropertyGroup>
37+
<ItemGroup>
3838

39-
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
40-
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
41-
</ItemGroup>
42-
</When>
43-
<When Condition=" '$(TargetFramework)' == 'net5.0' ">
44-
<PropertyGroup>
45-
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
46-
</PropertyGroup>
47-
</When>
48-
</Choose>
39+
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
40+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
41+
</ItemGroup>
42+
</When>
43+
<When Condition=" '$(TargetFramework)' == 'net5.0' ">
44+
<PropertyGroup>
45+
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
46+
</PropertyGroup>
47+
</When>
48+
</Choose>
4949

50-
<!-- T4 service used by the Guard APIs -->
51-
<ItemGroup>
52-
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
53-
</ItemGroup>
50+
<!-- T4 service used by the Guard APIs -->
51+
<ItemGroup>
52+
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
53+
</ItemGroup>
5454

5555
</Project>

Microsoft.Toolkit/Microsoft.Toolkit.csproj

Lines changed: 7 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -13,85 +13,15 @@
1313
</Description>
1414
<PackageTags>UWP Toolkit Windows IncrementalLoadingCollection String Array extensions helpers</PackageTags>
1515
</PropertyGroup>
16-
<Choose>
17-
<When Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
18-
<ItemGroup>
1916

20-
<!-- .NET Standard 1.4 doesn't have the Span<T> type, ValueTuple or the [Pure] attribute -->
21-
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
22-
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
23-
<PackageReference Include="System.Memory" Version="4.5.4" />
24-
</ItemGroup>
25-
</When>
26-
<When Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
27-
<ItemGroup>
28-
29-
<!-- .NET Standard 2.0 doesn't have the Span<T> type -->
30-
<PackageReference Include="System.Memory" Version="4.5.4" />
31-
</ItemGroup>
32-
</When>
33-
<When Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
34-
<PropertyGroup>
35-
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
36-
</PropertyGroup>
37-
<ItemGroup>
38-
39-
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
40-
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0.0" />
41-
</ItemGroup>
42-
</When>
43-
<When Condition=" '$(TargetFramework)' == 'net5.0' ">
44-
<PropertyGroup>
45-
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
46-
</PropertyGroup>
47-
</When>
48-
</Choose>
49-
50-
<ItemGroup>
51-
<None Update="Diagnostics\Generated\Guard.Comparable.Numeric.tt">
52-
<Generator>TextTemplatingFileGenerator</Generator>
53-
<LastGenOutput>Guard.Comparable.Numeric.g.cs</LastGenOutput>
54-
</None>
55-
<None Update="Diagnostics\Generated\Guard.Collection.tt">
56-
<Generator>TextTemplatingFileGenerator</Generator>
57-
<LastGenOutput>Guard.Collection.g.cs</LastGenOutput>
58-
</None>
59-
<None Update="Diagnostics\Generated\ThrowHelper.Collection.tt">
60-
<Generator>TextTemplatingFileGenerator</Generator>
61-
<LastGenOutput>ThrowHelper.Collection.g.cs</LastGenOutput>
62-
</None>
63-
<None Update="Diagnostics\Generated\TypeInfo.ttinclude">
64-
<Generator>TextTemplatingFileGenerator</Generator>
65-
<LastGenOutput>TypeInfo.g.cs</LastGenOutput>
66-
</None>
17+
<!-- .NET Standard 1.4 doesn't have the [Pure] attribute -->
18+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
19+
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
6720
</ItemGroup>
6821

69-
<!-- T4 service used by the Guard APIs -->
70-
<ItemGroup>
71-
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
72-
</ItemGroup>
73-
74-
<ItemGroup>
75-
<Compile Update="Diagnostics\Generated\Guard.Comparable.Numeric.g.cs">
76-
<DesignTime>True</DesignTime>
77-
<AutoGen>True</AutoGen>
78-
<DependentUpon>Guard.Comparable.Numeric.tt</DependentUpon>
79-
</Compile>
80-
<Compile Update="Diagnostics\Generated\Guard.Collection.g.cs">
81-
<DesignTime>True</DesignTime>
82-
<AutoGen>True</AutoGen>
83-
<DependentUpon>Guard.Collection.tt</DependentUpon>
84-
</Compile>
85-
<Compile Update="Diagnostics\Generated\ThrowHelper.Collection.g.cs">
86-
<DesignTime>True</DesignTime>
87-
<AutoGen>True</AutoGen>
88-
<DependentUpon>ThrowHelper.Collection.tt</DependentUpon>
89-
</Compile>
90-
<Compile Update="Diagnostics\Generated\TypeInfo.g.cs">
91-
<DesignTime>True</DesignTime>
92-
<AutoGen>True</AutoGen>
93-
<DependentUpon>TypeInfo.ttinclude</DependentUpon>
94-
</Compile>
95-
</ItemGroup>
22+
<!-- .NET Standard 2.1 and .NET 5 already have [NotNullIfNotNull] and [NotNullWhen] -->
23+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'net5.0' ">
24+
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
25+
</PropertyGroup>
9626

9727
</Project>

0 commit comments

Comments
 (0)