Skip to content

Commit 531e12a

Browse files
committed
Refactor remaining Project and Build files
- Remove Cake Build - Update Azure CI script - Simplify project files - Add and Update comments - Remove unnecessary lines - Remove BOM from all files - Rearrange and Order code blocks - Include build root folder - Rename NuGet Icon to `Icon.png` - Normalize casing for `ReadMe.md` - Rename solution file to `CommunityToolkit.sln`
1 parent c5ab771 commit 531e12a

File tree

42 files changed

+267
-591
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+267
-591
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
[Rr]eleases/
1919
x64/
2020
x86/
21-
build/
2221
bld/
2322
[Bb]in/
2423
[Oo]bj/

CommunityToolkit.Common/CommunityToolkit.Common.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
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-
Additionally, also enable trimming support on .NET 6. -->
17+
<!--
18+
NETSTANDARD2_1_OR_GREATER: includes both .NET Standard 2.1 and .NET 6
19+
Those targets already have [NotNullIfNotNull] and [NotNullWhen].
20+
Additionally, also enable trimming support on .NET 6.
21+
-->
1922
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
2023
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
2124
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>

CommunityToolkit.Diagnostics/CommunityToolkit.Diagnostics.csproj

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
</When>
2525

2626
<When Condition="'$(TargetFramework)' == 'netstandard2.1'">
27+
28+
<!-- NETSTANDARD2_1_OR_GREATER: includes both .NET Standard 2.1 and .NET 6 -->
2729
<PropertyGroup>
2830
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
2931
</PropertyGroup>
@@ -34,7 +36,10 @@
3436
</ItemGroup>
3537
</When>
3638

37-
<!-- Enable trimming support on .NET 6 -->
39+
<!--
40+
NETSTANDARD2_1_OR_GREATER: includes both .NET Standard 2.1 and .NET 6.
41+
Additionally, also enable trimming support on .NET 6.
42+
-->
3843
<When Condition="'$(TargetFramework)' == 'net6.0'">
3944
<PropertyGroup>
4045
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
@@ -44,6 +49,12 @@
4449
</When>
4550
</Choose>
4651

52+
<!-- T4 service used by the Guard APIs -->
53+
<ItemGroup>
54+
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
55+
</ItemGroup>
56+
57+
<!-- Text Templates to generate sources -->
4758
<ItemGroup>
4859
<None Update="Generated\Guard.Comparable.Numeric.tt">
4960
<Generator>TextTemplatingFileGenerator</Generator>
@@ -63,11 +74,7 @@
6374
</None>
6475
</ItemGroup>
6576

66-
<!-- T4 service used by the Guard APIs -->
67-
<ItemGroup>
68-
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
69-
</ItemGroup>
70-
77+
<!-- Sources generated based on the above text templates -->
7178
<ItemGroup>
7279
<Compile Update="Generated\Guard.Comparable.Numeric.g.cs">
7380
<DesignTime>True</DesignTime>

CommunityToolkit.HighPerformance/CommunityToolkit.HighPerformance.csproj

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
- Box&lt;T&gt;: a type mapping boxed value types and exposing some utility and high performance methods.
2222
- Ref&lt;T&gt;: a stack-only struct that can store a reference to a value of a specified type.
2323
- NullableRef&lt;T&gt;: a stack-only struct similar to Ref&lt;T&gt;, which also supports nullable references.
24-
</Description>
24+
</Description>
2525
<PackageTags>Parallel;Performance;Unsafe;Span;Memory;String;StringPool;Array;Stream;Buffer;Extensions;Helpers</PackageTags>
2626
</PropertyGroup>
2727

@@ -39,33 +39,42 @@
3939

4040
<When Condition="'$(TargetFramework)' == 'netstandard2.1'">
4141

42+
<!-- NETSTANDARD2_1_OR_GREATER: includes both .NET Standard 2.1, .NET Core 3.1 and .NET 6 -->
43+
<PropertyGroup>
44+
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
45+
</PropertyGroup>
46+
4247
<!-- .NET Standard 2.1 doesn't have the Unsafe type -->
4348
<ItemGroup>
4449
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
4550
</ItemGroup>
4651
</When>
4752

48-
<When Condition="'$(TargetFramework)' == 'net6.0'">
53+
<When Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
4954

50-
<!-- NETSTANDARD2_1_OR_GREATER: includes both .NET Standard 2.1, .NET Core 3.1 and .NET 6.
51-
Additionally, also enable trimming support on .NET 6. -->
55+
<!-- NETSTANDARD2_1_OR_GREATER: includes both .NET Standard 2.1, .NET Core 3.1 and .NET 6 -->
5256
<PropertyGroup>
5357
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
54-
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
55-
<IsTrimmable>true</IsTrimmable>
5658
</PropertyGroup>
57-
</When>
5859

59-
<When Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
60-
<PropertyGroup>
61-
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
62-
</PropertyGroup>
63-
6460
<!-- .NET Core 3.1 has the Unsafe type, but the version it ships with lacks Unsafe.IsNullRef<T> -->
6561
<ItemGroup>
6662
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
6763
</ItemGroup>
6864
</When>
65+
66+
<When Condition="'$(TargetFramework)' == 'net6.0'">
67+
68+
<!--
69+
NETSTANDARD2_1_OR_GREATER: includes both .NET Standard 2.1, .NET Core 3.1 and .NET 6.
70+
Additionally, also enable trimming support on .NET 6.
71+
-->
72+
<PropertyGroup>
73+
<DefineConstants>NETSTANDARD2_1_OR_GREATER</DefineConstants>
74+
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
75+
<IsTrimmable>true</IsTrimmable>
76+
</PropertyGroup>
77+
</When>
6978
</Choose>
7079

7180
</Project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
; Shipped analyzer releases
1+
; Shipped analyzer releases
22
; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md

CommunityToolkit.Mvvm.SourceGenerators/AnalyzerReleases.Unshipped.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; Unshipped analyzer release
1+
; Unshipped analyzer release
22
; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md
33

44
### New Rules

CommunityToolkit.Mvvm.SourceGenerators/Attributes/NotNullWhenAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,29 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
54
<IsPackable>false</IsPackable>
5+
<TargetFramework>netstandard2.0</TargetFramework>
66
</PropertyGroup>
77

8+
<!-- Sources that are used by Generator logic in the target projects -->
89
<ItemGroup>
9-
<Compile Remove="EmbeddedResources\INotifyPropertyChanged.cs" />
10-
<Compile Remove="EmbeddedResources\NotNullAttribute.cs" />
11-
<Compile Remove="EmbeddedResources\NotNullIfNotNullAttribute.cs" />
12-
<Compile Remove="EmbeddedResources\ObservableObject.cs" />
13-
<Compile Remove="EmbeddedResources\ObservableRecipient.cs" />
14-
</ItemGroup>
15-
16-
<ItemGroup>
17-
<EmbeddedResource Include="EmbeddedResources\INotifyPropertyChanged.cs">
18-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
19-
</EmbeddedResource>
20-
<EmbeddedResource Include="EmbeddedResources\NotNullAttribute.cs">
21-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
22-
</EmbeddedResource>
23-
<EmbeddedResource Include="EmbeddedResources\NotNullIfNotNullAttribute.cs">
24-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
25-
</EmbeddedResource>
26-
<EmbeddedResource Include="EmbeddedResources\ObservableObject.cs">
27-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
28-
</EmbeddedResource>
29-
<EmbeddedResource Include="EmbeddedResources\ObservableRecipient.cs">
10+
<Compile Remove="EmbeddedResources\*.cs" />
11+
<EmbeddedResource Include="EmbeddedResources\*.cs">
3012
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3113
</EmbeddedResource>
3214
</ItemGroup>
3315

16+
<!--
17+
These files enables tracking Analyzer releases for the rules that ship from this project.
18+
See <https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md>
19+
-->
3420
<ItemGroup>
35-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="all" Pack="false" />
21+
<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
22+
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
3623
</ItemGroup>
3724

3825
<ItemGroup>
39-
<AdditionalFiles Include="AnalyzerReleases.Shipped.md" />
40-
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md" />
26+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="All" Pack="false" />
4127
</ItemGroup>
4228

43-
</Project>
29+
</Project>

CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

CommunityToolkit.Mvvm.SourceGenerators/Diagnostics/DiagnosticExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

0 commit comments

Comments
 (0)