From 53fe8de9bdd86ae189cd12f5fb6c4ac73c44fed9 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 10 Jan 2024 18:11:51 -0600 Subject: [PATCH 01/22] Added net8.0-windows10.0.22621.0 --- MultiTarget/AvailableTargetFrameworks.props | 2 +- MultiTarget/EnabledTargetFrameworks.props | 2 +- MultiTarget/WinUI.Extra.props | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/MultiTarget/AvailableTargetFrameworks.props b/MultiTarget/AvailableTargetFrameworks.props index fdb520e8..d26e827a 100644 --- a/MultiTarget/AvailableTargetFrameworks.props +++ b/MultiTarget/AvailableTargetFrameworks.props @@ -1,7 +1,7 @@ uap10.0.17763 - net6.0-windows10.0.22621.0;net7.0-windows10.0.22621.0; + net6.0-windows10.0.22621.0;net7.0-windows10.0.22621.0;net8.0-windows10.0.22621.0; net7.0 net7.0 diff --git a/MultiTarget/EnabledTargetFrameworks.props b/MultiTarget/EnabledTargetFrameworks.props index 00c017dc..4ddd3474 100644 --- a/MultiTarget/EnabledTargetFrameworks.props +++ b/MultiTarget/EnabledTargetFrameworks.props @@ -1,7 +1,7 @@ uap10.0.17763 - net6.0-windows10.0.22621.0;net7.0-windows10.0.22621.0; + net6.0-windows10.0.22621.0;net7.0-windows10.0.22621.0;net8.0-windows10.0.22621.0; net7.0 net7.0 diff --git a/MultiTarget/WinUI.Extra.props b/MultiTarget/WinUI.Extra.props index cc07e8a2..e10746c8 100644 --- a/MultiTarget/WinUI.Extra.props +++ b/MultiTarget/WinUI.Extra.props @@ -10,6 +10,11 @@ 10.0.19041.0 + + + true + + true From e678ae7b31bd88b315f6203c997f79d7db0bceac Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 10 Jan 2024 18:37:14 -0600 Subject: [PATCH 02/22] Replaced win10-* RuntimeIdentifiers with win-* --- ProjectHeads/Head.WinAppSdk.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProjectHeads/Head.WinAppSdk.props b/ProjectHeads/Head.WinAppSdk.props index af5ebf40..a874c9b3 100644 --- a/ProjectHeads/Head.WinAppSdk.props +++ b/ProjectHeads/Head.WinAppSdk.props @@ -3,8 +3,8 @@ WinExe $(WinAppSdkTargetFramework.Split(';')[0]) x86;x64;arm64 - win10-x86;win10-x64;win10-arm64 - win10-$(Platform).pubxml + win-x86;win-x64;win-arm64 + win-$(Platform).pubxml true true true From f94d9cbc34469c2af386f7a3137b857f89d761cc Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Mon, 29 Jan 2024 15:31:47 -0600 Subject: [PATCH 03/22] Update to net8.0 --- .devcontainer/devcontainer.json | 2 +- .github/workflows/build.yml | 2 +- global.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b4cccfde..0efd1abc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ "args": { // Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0 // Append -bullseye or -focal to pin to an OS version. - "VARIANT": "6.0", + "VARIANT": "8.0", // Options "NODE_VERSION": "lts/*" } diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ccfb2cc..3f4af55c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ on: workflow_dispatch: env: - DOTNET_VERSION: ${{ '7.0.x' }} + DOTNET_VERSION: ${{ '8.0.x' }} ENABLE_DIAGNOSTICS: false #COREHOST_TRACE: 1 COREHOST_TRACEFILE: corehosttrace.log diff --git a/global.json b/global.json index 852dfb6d..2acf2fd2 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "8.0.101", "rollForward": "latestFeature" }, "msbuild-sdks": From cb8c8b5413068c1cdb5559a44ac0af6b3c4756a5 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Thu, 8 Feb 2024 13:50:29 -0600 Subject: [PATCH 04/22] Update Wasdk to 1.5.240205001-preview1 --- MultiTarget/PackageReferences/WinAppSdk.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MultiTarget/PackageReferences/WinAppSdk.props b/MultiTarget/PackageReferences/WinAppSdk.props index 300e627f..c879005f 100644 --- a/MultiTarget/PackageReferences/WinAppSdk.props +++ b/MultiTarget/PackageReferences/WinAppSdk.props @@ -1,6 +1,6 @@ - + From 5059444c2a55090dadfa33bd5609a45b9dc3674f Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Thu, 8 Feb 2024 18:01:08 -0600 Subject: [PATCH 05/22] Include MSBuild.Sdk.Extras/3.0.23 on UWP only --- .../ToolkitSampleMetadataTests.Documentation.cs | 4 +++- MultiTarget/WinUI.Extra.props | 2 ++ ProjectTemplate/samples/ProjectTemplate.Samples.csproj | 4 +++- .../CommunityToolkit.WinUI.Controls.ProjectTemplate.csproj | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs b/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs index 9eb02a78..aa72d6f3 100644 --- a/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs +++ b/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs @@ -271,7 +271,9 @@ Which is valid. > [!SAMPLE Sample]"; string csproj = """ - + + + Primitives diff --git a/MultiTarget/WinUI.Extra.props b/MultiTarget/WinUI.Extra.props index e10746c8..3d3641b7 100644 --- a/MultiTarget/WinUI.Extra.props +++ b/MultiTarget/WinUI.Extra.props @@ -1,4 +1,6 @@ + + true true diff --git a/ProjectTemplate/samples/ProjectTemplate.Samples.csproj b/ProjectTemplate/samples/ProjectTemplate.Samples.csproj index 97156000..d3837ac4 100644 --- a/ProjectTemplate/samples/ProjectTemplate.Samples.csproj +++ b/ProjectTemplate/samples/ProjectTemplate.Samples.csproj @@ -1,4 +1,6 @@ - + + + ProjectTemplate diff --git a/ProjectTemplate/src/CommunityToolkit.WinUI.Controls.ProjectTemplate.csproj b/ProjectTemplate/src/CommunityToolkit.WinUI.Controls.ProjectTemplate.csproj index 33aac3b8..bfd25683 100644 --- a/ProjectTemplate/src/CommunityToolkit.WinUI.Controls.ProjectTemplate.csproj +++ b/ProjectTemplate/src/CommunityToolkit.WinUI.Controls.ProjectTemplate.csproj @@ -1,4 +1,6 @@ - + + + ProjectTemplate This package contains ProjectTemplate. From a509481ba9a929889bdc198401da9861dbf3acac Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Thu, 15 Feb 2024 19:27:05 -0600 Subject: [PATCH 06/22] Move conditional MSBuild Extras to library only --- MultiTarget/Library.props | 4 +++- MultiTarget/WinUI.Extra.props | 5 +++-- ToolkitComponent.SourceProject.props | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/MultiTarget/Library.props b/MultiTarget/Library.props index d67a6451..c9610ed9 100644 --- a/MultiTarget/Library.props +++ b/MultiTarget/Library.props @@ -1,5 +1,5 @@ - + true false @@ -28,4 +28,6 @@ + + diff --git a/MultiTarget/WinUI.Extra.props b/MultiTarget/WinUI.Extra.props index 3d3641b7..83628f0e 100644 --- a/MultiTarget/WinUI.Extra.props +++ b/MultiTarget/WinUI.Extra.props @@ -1,6 +1,7 @@ - - + true true diff --git a/ToolkitComponent.SourceProject.props b/ToolkitComponent.SourceProject.props index 5fac813f..1022b2a1 100644 --- a/ToolkitComponent.SourceProject.props +++ b/ToolkitComponent.SourceProject.props @@ -3,9 +3,6 @@ - - - $([System.DateTime]::UtcNow.ToString(yyMMdd)) $(MajorVersion).$(MinorVersion).$(DateForVersion) @@ -19,6 +16,9 @@ false + + + From f7c1603559a4ae0af9aee6445dbda5d646b6d4d1 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Thu, 15 Feb 2024 22:16:59 -0600 Subject: [PATCH 07/22] Update to .NET 8.0.201 --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 2acf2fd2..e4e1a5f4 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.101", + "version": "8.0.201", "rollForward": "latestFeature" }, "msbuild-sdks": From 2f099298b9791f37a89a3a046ab8bc9fabef0371 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Sat, 17 Feb 2024 10:50:00 -0600 Subject: [PATCH 08/22] Handle case-sensitivity for importing Directory.Build.props --- .../ToolkitSampleMetadataTests.Documentation.cs | 2 +- .../AllComponents/Tests.Uwp/CommunityToolkit.Tests.Uwp.csproj | 2 +- ProjectHeads/AllComponents/Uwp/CommunityToolkit.App.Uwp.csproj | 2 +- .../SingleComponent/Tests.Uwp/ProjectTemplate.Tests.Uwp.csproj | 2 +- ProjectHeads/SingleComponent/Uwp/ProjectTemplate.Uwp.csproj | 2 +- ProjectTemplate/samples/ProjectTemplate.Samples.csproj | 2 +- .../src/CommunityToolkit.WinUI.Controls.ProjectTemplate.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs b/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs index aa72d6f3..7dfefff9 100644 --- a/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs +++ b/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs @@ -272,7 +272,7 @@ Which is valid. string csproj = """ - + Primitives diff --git a/ProjectHeads/AllComponents/Tests.Uwp/CommunityToolkit.Tests.Uwp.csproj b/ProjectHeads/AllComponents/Tests.Uwp/CommunityToolkit.Tests.Uwp.csproj index 4d327986..b0d2b247 100644 --- a/ProjectHeads/AllComponents/Tests.Uwp/CommunityToolkit.Tests.Uwp.csproj +++ b/ProjectHeads/AllComponents/Tests.Uwp/CommunityToolkit.Tests.Uwp.csproj @@ -1,6 +1,6 @@  - + true diff --git a/ProjectHeads/AllComponents/Uwp/CommunityToolkit.App.Uwp.csproj b/ProjectHeads/AllComponents/Uwp/CommunityToolkit.App.Uwp.csproj index 0345207e..ef273d6b 100644 --- a/ProjectHeads/AllComponents/Uwp/CommunityToolkit.App.Uwp.csproj +++ b/ProjectHeads/AllComponents/Uwp/CommunityToolkit.App.Uwp.csproj @@ -1,7 +1,7 @@  - + true diff --git a/ProjectHeads/SingleComponent/Tests.Uwp/ProjectTemplate.Tests.Uwp.csproj b/ProjectHeads/SingleComponent/Tests.Uwp/ProjectTemplate.Tests.Uwp.csproj index 4c89e75b..86fdc50d 100644 --- a/ProjectHeads/SingleComponent/Tests.Uwp/ProjectTemplate.Tests.Uwp.csproj +++ b/ProjectHeads/SingleComponent/Tests.Uwp/ProjectTemplate.Tests.Uwp.csproj @@ -1,6 +1,6 @@ - + true diff --git a/ProjectHeads/SingleComponent/Uwp/ProjectTemplate.Uwp.csproj b/ProjectHeads/SingleComponent/Uwp/ProjectTemplate.Uwp.csproj index 0f267534..fcd81198 100644 --- a/ProjectHeads/SingleComponent/Uwp/ProjectTemplate.Uwp.csproj +++ b/ProjectHeads/SingleComponent/Uwp/ProjectTemplate.Uwp.csproj @@ -1,6 +1,6 @@  - + true diff --git a/ProjectTemplate/samples/ProjectTemplate.Samples.csproj b/ProjectTemplate/samples/ProjectTemplate.Samples.csproj index d3837ac4..2085d05e 100644 --- a/ProjectTemplate/samples/ProjectTemplate.Samples.csproj +++ b/ProjectTemplate/samples/ProjectTemplate.Samples.csproj @@ -1,5 +1,5 @@ - + ProjectTemplate diff --git a/ProjectTemplate/src/CommunityToolkit.WinUI.Controls.ProjectTemplate.csproj b/ProjectTemplate/src/CommunityToolkit.WinUI.Controls.ProjectTemplate.csproj index bfd25683..017fbc66 100644 --- a/ProjectTemplate/src/CommunityToolkit.WinUI.Controls.ProjectTemplate.csproj +++ b/ProjectTemplate/src/CommunityToolkit.WinUI.Controls.ProjectTemplate.csproj @@ -1,5 +1,5 @@ - + ProjectTemplate From 6448e4428db4b7be4f4b0d846c8f61d40c44fa65 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Mon, 19 Feb 2024 11:29:40 -0600 Subject: [PATCH 09/22] Update to latest stable Microsoft.CodeAnalysis.CSharp and Microsoft.CodeAnalysis.Analyzers --- .../CommunityToolkit.Tooling.SampleGen.csproj | 4 ++-- .../CommunityToolkit.Tooling.TestGen.csproj | 4 ++-- .../CommunityToolkit.Tooling.XamlNamedPropertyRelay.csproj | 4 ++-- ProjectHeads/App.Head.props | 4 ++-- ProjectHeads/Tests.Head.props | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj b/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj index f1ab648c..7804110c 100644 --- a/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj +++ b/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj @@ -12,7 +12,7 @@ - - + + diff --git a/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj b/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj index ae539b98..8694fdb0 100644 --- a/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj +++ b/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj @@ -12,7 +12,7 @@ - - + + diff --git a/CommunityToolkit.Tooling.XamlNamedPropertyRelay/CommunityToolkit.Tooling.XamlNamedPropertyRelay.csproj b/CommunityToolkit.Tooling.XamlNamedPropertyRelay/CommunityToolkit.Tooling.XamlNamedPropertyRelay.csproj index ae539b98..8694fdb0 100644 --- a/CommunityToolkit.Tooling.XamlNamedPropertyRelay/CommunityToolkit.Tooling.XamlNamedPropertyRelay.csproj +++ b/CommunityToolkit.Tooling.XamlNamedPropertyRelay/CommunityToolkit.Tooling.XamlNamedPropertyRelay.csproj @@ -12,7 +12,7 @@ - - + + diff --git a/ProjectHeads/App.Head.props b/ProjectHeads/App.Head.props index b6303dfe..e391661d 100644 --- a/ProjectHeads/App.Head.props +++ b/ProjectHeads/App.Head.props @@ -13,8 +13,8 @@ - - + + diff --git a/ProjectHeads/Tests.Head.props b/ProjectHeads/Tests.Head.props index 86073487..0dff7352 100644 --- a/ProjectHeads/Tests.Head.props +++ b/ProjectHeads/Tests.Head.props @@ -1,8 +1,8 @@ - - + + From 6967d0ffd089aca9c492bc8950b4c14734820f97 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Mon, 19 Feb 2024 14:42:15 -0600 Subject: [PATCH 10/22] Update System.Collections.Immutable to 8.0.0 --- ProjectHeads/App.Head.Uwp.Dependencies.props | 2 +- ToolkitComponent.SampleProject.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ProjectHeads/App.Head.Uwp.Dependencies.props b/ProjectHeads/App.Head.Uwp.Dependencies.props index 0ab4698d..054d587c 100644 --- a/ProjectHeads/App.Head.Uwp.Dependencies.props +++ b/ProjectHeads/App.Head.Uwp.Dependencies.props @@ -4,6 +4,6 @@ - + diff --git a/ToolkitComponent.SampleProject.props b/ToolkitComponent.SampleProject.props index da30b80a..d0d45e6c 100644 --- a/ToolkitComponent.SampleProject.props +++ b/ToolkitComponent.SampleProject.props @@ -9,7 +9,7 @@ - + From 45411e119dbfad75df0880c39f49398e4aef5e7f Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Tue, 20 Feb 2024 11:49:38 -0600 Subject: [PATCH 11/22] Update Microsoft.CodeAnalysis.CSharp.Workspaces to latest stable 4.8.0 --- .../CommunityToolkit.Tooling.SampleGen.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommunityToolkit.Tooling.SampleGen.Tests/CommunityToolkit.Tooling.SampleGen.Tests.csproj b/CommunityToolkit.Tooling.SampleGen.Tests/CommunityToolkit.Tooling.SampleGen.Tests.csproj index aca30032..a04a5fa1 100644 --- a/CommunityToolkit.Tooling.SampleGen.Tests/CommunityToolkit.Tooling.SampleGen.Tests.csproj +++ b/CommunityToolkit.Tooling.SampleGen.Tests/CommunityToolkit.Tooling.SampleGen.Tests.csproj @@ -9,7 +9,7 @@ - + From 5960532e9173247f15c3789178fa6a1e8fc875be Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Tue, 20 Feb 2024 11:51:23 -0600 Subject: [PATCH 12/22] Update Microsoft.CodeAnalysis.CSharp.Workspaces to latest stable 4.8.0 --- .../CommunityToolkit.Tooling.TestGen.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommunityToolkit.Tooling.TestGen.Tests/CommunityToolkit.Tooling.TestGen.Tests.csproj b/CommunityToolkit.Tooling.TestGen.Tests/CommunityToolkit.Tooling.TestGen.Tests.csproj index 556ce585..42048be6 100644 --- a/CommunityToolkit.Tooling.TestGen.Tests/CommunityToolkit.Tooling.TestGen.Tests.csproj +++ b/CommunityToolkit.Tooling.TestGen.Tests/CommunityToolkit.Tooling.TestGen.Tests.csproj @@ -8,7 +8,7 @@ - + From e7e20ee052c89c004b6d18a2a8ff78dbcc8fc310 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 21 Feb 2024 13:44:29 -0600 Subject: [PATCH 13/22] Use RuntimeIdentifiers on both heads and libraries, handle pre-net8 identifiers --- MultiTarget/WinUI.Extra.props | 4 ++++ ProjectHeads/Head.WinAppSdk.props | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/MultiTarget/WinUI.Extra.props b/MultiTarget/WinUI.Extra.props index 83628f0e..a7f5f9d9 100644 --- a/MultiTarget/WinUI.Extra.props +++ b/MultiTarget/WinUI.Extra.props @@ -16,6 +16,10 @@ true + + win-x86;win-x64;win-arm64 + win10-x86;win10-x64;win10-arm64 + win-x86;win-x64;win-arm64 diff --git a/ProjectHeads/Head.WinAppSdk.props b/ProjectHeads/Head.WinAppSdk.props index a874c9b3..9a90fe91 100644 --- a/ProjectHeads/Head.WinAppSdk.props +++ b/ProjectHeads/Head.WinAppSdk.props @@ -3,7 +3,6 @@ WinExe $(WinAppSdkTargetFramework.Split(';')[0]) x86;x64;arm64 - win-x86;win-x64;win-arm64 win-$(Platform).pubxml true true From 5eb8f984d2e616a580e6c118f0f9e514e5495692 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 21 Feb 2024 15:36:37 -0600 Subject: [PATCH 14/22] Enable EnforceExtendedAnalyzerRules in source generators --- .../CommunityToolkit.Tooling.SampleGen.csproj | 1 + .../CommunityToolkit.Tooling.TestGen.csproj | 1 + .../CommunityToolkit.Tooling.XamlNamedPropertyRelay.csproj | 1 + 3 files changed, 3 insertions(+) diff --git a/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj b/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj index 7804110c..e09c1db6 100644 --- a/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj +++ b/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj @@ -5,6 +5,7 @@ enable nullable 11.0 + true diff --git a/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj b/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj index 8694fdb0..3333912f 100644 --- a/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj +++ b/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj @@ -5,6 +5,7 @@ enable nullable 10.0 + true diff --git a/CommunityToolkit.Tooling.XamlNamedPropertyRelay/CommunityToolkit.Tooling.XamlNamedPropertyRelay.csproj b/CommunityToolkit.Tooling.XamlNamedPropertyRelay/CommunityToolkit.Tooling.XamlNamedPropertyRelay.csproj index 8694fdb0..3333912f 100644 --- a/CommunityToolkit.Tooling.XamlNamedPropertyRelay/CommunityToolkit.Tooling.XamlNamedPropertyRelay.csproj +++ b/CommunityToolkit.Tooling.XamlNamedPropertyRelay/CommunityToolkit.Tooling.XamlNamedPropertyRelay.csproj @@ -5,6 +5,7 @@ enable nullable 10.0 + true From 40d4e2f78a50fb5f3166d2e1848e2495ee1caa53 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 21 Feb 2024 15:49:16 -0600 Subject: [PATCH 15/22] Fixed malformed description warnings --- .../Diagnostics/DiagnosticDescriptors.cs | 98 +++++++++---------- .../Diagnostics/DiagnosticDescriptors.cs | 6 +- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/CommunityToolkit.Tooling.SampleGen/Diagnostics/DiagnosticDescriptors.cs b/CommunityToolkit.Tooling.SampleGen/Diagnostics/DiagnosticDescriptors.cs index af900b74..3b4e290e 100644 --- a/CommunityToolkit.Tooling.SampleGen/Diagnostics/DiagnosticDescriptors.cs +++ b/CommunityToolkit.Tooling.SampleGen/Diagnostics/DiagnosticDescriptors.cs @@ -19,27 +19,27 @@ public static class DiagnosticDescriptors /// public static readonly DiagnosticDescriptor SamplePaneOptionAttributeOnNonSample = new( id: "TKSMPL0001", - title: $"Invalid sample option declaration", - messageFormat: $"Cannot generate sample pane options for type {{0}} as it does not use {nameof(Attributes.ToolkitSampleAttribute)}", + title: "Invalid sample option declaration", + messageFormat: "Cannot generate sample pane options for type {{0}} as it does not use ToolkitSampleAttribute", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate sample pane options for a type which does not use {nameof(Attributes.ToolkitSampleAttribute)}."); + description: "Cannot generate sample pane options for a type which does not use ToolkitSampleAttribute."); /// /// Gets a indicating a derived with an empty or invalid name. /// - /// Format: "Cannot generate sample pane options for type {0} as it contains an empty or invalid name.". + /// Format: "Cannot generate sample pane options for type {0} as it contains an empty or invalid name". /// /// public static readonly DiagnosticDescriptor SamplePaneOptionWithBadName = new( id: "TKSMPL0002", - title: $"Invalid sample option declaration", - messageFormat: $"Cannot generate sample pane options for type {{0}} as the provided name is empty or invalid", + title: "Invalid sample option declaration", + messageFormat: "Cannot generate sample pane options for type {{0}} as the provided name is empty or invalid", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate sample pane options when the provided name is empty or invalid."); + description: "Cannot generate sample pane options when the provided name is empty or invalid."); /// /// Gets a indicating a with a that doesn't have a corresponding . @@ -49,12 +49,12 @@ public static class DiagnosticDescriptors /// public static readonly DiagnosticDescriptor OptionsPaneAttributeWithMissingOrInvalidSampleId = new( id: "TKSMPL0003", - title: $"Missing or invalid sample Id", - messageFormat: $"Cannot link sample options pane to type {{0}} as the provided sample ID does not match any known {nameof(Attributes.ToolkitSampleAttribute)}", + title: "Missing or invalid sample Id", + messageFormat: "Cannot link sample options pane to type {{0}} as the provided sample ID does not match any known ToolkitSampleAttribute", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot link sample options pane to a provided sample ID that does not match any known {nameof(Attributes.ToolkitSampleAttribute)}."); + description: "Cannot link sample options pane to a provided sample ID that does not match any known ToolkitSampleAttribute."); /// /// Gets a indicating a derived that contains a name which is already in use by another sample option. @@ -64,12 +64,12 @@ public static class DiagnosticDescriptors /// public static readonly DiagnosticDescriptor SamplePaneOptionWithDuplicateName = new( id: "TKSMPL0004", - title: $"Duplicate sample option name", - messageFormat: $"Cannot generate sample pane option with name {{0}} as the provided name is already in use by another sample option", + title: "Duplicate sample option name", + messageFormat: "Cannot generate sample pane option with name {{0}} as the provided name is already in use by another sample option", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate sample pane option when the provided name is used by another sample option."); + description: "Cannot generate sample pane option when the provided name is used by another sample option."); /// /// Gets a indicating a derived that contains a name which is already defined as a member in the attached class. @@ -79,12 +79,12 @@ public static class DiagnosticDescriptors /// public static readonly DiagnosticDescriptor SamplePaneOptionWithConflictingName = new( id: "TKSMPL0005", - title: $"Conflicting sample option name", - messageFormat: $"Cannot generate sample pane option with name {{0}} as the provided name is already defined as a member in the attached class", + title: "Conflicting sample option name", + messageFormat: "Cannot generate sample pane option with name {{0}} as the provided name is already defined as a member in the attached class", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate sample pane option when the provided name is already defined as a member in the attached class."); + description:"Cannot generate sample pane option when the provided name is already defined as a member in the attached class."); /// /// Gets a indicating a that has no defined options to present to the user. @@ -94,117 +94,117 @@ public static class DiagnosticDescriptors /// public static readonly DiagnosticDescriptor SamplePaneMultiChoiceOptionWithNoChoices = new( id: "TKSMPL0006", - title: $"Missing choices in multi-choice sample option", - messageFormat: $"Cannot generate multiple choice sample pane option with title {{0}} as no choices were provided.", + title: "Missing choices in multi-choice sample option", + messageFormat: "Cannot generate multiple choice sample pane option with title {{0}} as no choices were provided", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate multiple choice sample pane option as there are no choices provided."); + description: "Cannot generate multiple choice sample pane option as there are no choices provided."); /// /// Gets a indicating a that was used on an unsupported type. /// - /// Format: "Cannot generate sample metadata as the attribute was used on an unsupported type.". + /// Format: "Cannot generate sample metadata as the attribute was used on an unsupported type". /// /// public static readonly DiagnosticDescriptor SampleAttributeOnUnsupportedType = new( id: "TKSMPL0007", - title: $"ToolkitSampleAttribute declared on an invalid type", - messageFormat: $"Cannot generate sample metadata as the attribute was used on an unsupported type", + title: "ToolkitSampleAttribute declared on an invalid type", + messageFormat: "Cannot generate sample metadata as the attribute was used on an unsupported type", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate sample metadata as the attribute was used on an unsupported type."); + description: "Cannot generate sample metadata as the attribute was used on an unsupported type."); /// /// Gets a indicating a that was used on an unsupported type. /// - /// Format: "Cannot generate options pane metadata as the attribute was used on an unsupported type.". + /// Format: "Cannot generate options pane metadata as the attribute was used on an unsupported type". /// /// public static readonly DiagnosticDescriptor SampleOptionPaneAttributeOnUnsupportedType = new( id: "TKSMPL0008", - title: $"Toolkit sample options pane declared on an invalid type", - messageFormat: $"Cannot generate options pane metadata as the attribute was used on an unsupported type", + title: "Toolkit sample options pane declared on an invalid type", + messageFormat: "Cannot generate options pane metadata as the attribute was used on an unsupported type", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate options pane metadata as the attribute was used on an unsupported type."); + description: "Cannot generate options pane metadata as the attribute was used on an unsupported type."); /// /// Gets a indicating a derived that was used on an unsupported type. /// - /// Format: "Cannot generate sample option metadata as the attribute was used on an unsupported type.". + /// Format: "Cannot generate sample option metadata as the attribute was used on an unsupported type". /// /// public static readonly DiagnosticDescriptor SampleGeneratedOptionAttributeOnUnsupportedType = new( id: "TKSMPL0009", - title: $"Toolkit sample option declared on an invalid type", - messageFormat: $"Cannot generate sample option metadata as the attribute was used on an unsupported type", + title: "Toolkit sample option declared on an invalid type", + messageFormat: "Cannot generate sample option metadata as the attribute was used on an unsupported type", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate sample option metadata as the attribute was used on an unsupported type."); + description: "Cannot generate sample option metadata as the attribute was used on an unsupported type."); /// /// Gets a indicating an exception occured while parsing the front matter of a markdown sample file. /// public static readonly DiagnosticDescriptor MarkdownYAMLFrontMatterException = new( id: "TKSMPL0010", - title: $"Invalid YAML Front Matter", - messageFormat: $"Cannot generate sample page info for file {{0}} as an error was encountered parsing its YAML front matter: {{1}}", + title: "Invalid YAML Front Matter", + messageFormat: "Cannot generate sample page info for file {{0}} as an error was encountered parsing its YAML front matter: {{1}}", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate sample page info due to a YAML Front Matter parsing exception."); + description: "Cannot generate sample page info due to a YAML Front Matter parsing exception."); /// /// Gets a indicating an expected piece of metadata was missing from the front matter of a markdown sample file. /// public static readonly DiagnosticDescriptor MarkdownYAMLFrontMatterMissingField = new( id: "TKSMPL0011", - title: $"Missing YAML Front Matter", - messageFormat: $"Cannot generate sample page info for file {{0}} as no '{{1}}' field was found in its YAML front matter.", + title: "Missing YAML Front Matter", + messageFormat: "Cannot generate sample page info for file {{0}} as no '{{1}}' field was found in its YAML front matter", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate sample page info due to missing YAML Front Matter."); + description: "Cannot generate sample page info due to missing YAML Front Matter."); /// /// Gets a indicating the sample referenced in the Markdown file couldn't be found. /// public static readonly DiagnosticDescriptor MarkdownSampleIdNotFound = new( id: "TKSMPL0012", - title: $"Sample Id Not Found from Markdown Reference", - messageFormat: $"Cannot find the sample page referenced in file {{0}} with sample id '{{1}}'.", + title: "Sample Id Not Found from Markdown Reference", + messageFormat: "Cannot find the sample page referenced in file {{0}} with sample id '{{1}}'", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot link sample page info due to invalid/unknown id."); + description: "Cannot link sample page info due to invalid or unknown id."); /// /// Gets a indicating the sample is not referenced in any Markdown documentation files. /// public static readonly DiagnosticDescriptor SampleNotReferencedInMarkdown = new( id: "TKSMPL0013", - title: $"Sample Not Referenced In Documentation", - messageFormat: $"The sample with id '{{0}}' is not referenced in any documentation files and will not appear in the full sample app.", + title: "Sample Not Referenced In Documentation", + messageFormat: "The sample with id '{{0}}' is not referenced in any documentation files and will not appear in the full sample app", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, - description: $"Cannot find reference to the sample within the documentation."); + description: "Cannot find reference to the sample within the documentation."); /// /// Gets a indicating the documentation file contains no sample references. /// public static readonly DiagnosticDescriptor DocumentationHasNoSamples = new( id: "TKSMPL0014", - title: $"Documentation Has No Samples", - messageFormat: $"The documentation page '{{0}}' does not reference any sample examples, it is recommended to have at least one code sample per document page.", + title: "Documentation Has No Samples", + messageFormat: "The documentation page '{{0}}' does not reference any sample examples, it is recommended to have at least one code sample per document page", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, - description: $"Document contains no interactive sample code."); + description: "Document contains no interactive sample code."); /// /// Gets a indicating a sample ID is already in use by another sample. @@ -214,10 +214,10 @@ public static class DiagnosticDescriptors /// public static readonly DiagnosticDescriptor SampleIdAlreadyInUse = new( id: "TKSMPL0015", - title: $"Sample ID already in use", - messageFormat: $"Cannot generate sample with id {{0}} as the provided id is already in use by another sample", + title: "Sample ID already in use", + messageFormat: "Cannot generate sample with id {{0}} as the provided id is already in use by another sample", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate sample as the id is already in use by another sample."); + description: "Cannot generate sample as the id is already in use by another sample."); } diff --git a/CommunityToolkit.Tooling.TestGen/Diagnostics/DiagnosticDescriptors.cs b/CommunityToolkit.Tooling.TestGen/Diagnostics/DiagnosticDescriptors.cs index ad54712e..d2df26c7 100644 --- a/CommunityToolkit.Tooling.TestGen/Diagnostics/DiagnosticDescriptors.cs +++ b/CommunityToolkit.Tooling.TestGen/Diagnostics/DiagnosticDescriptors.cs @@ -19,10 +19,10 @@ public static class DiagnosticDescriptors /// public static readonly DiagnosticDescriptor TestControlHasConstructorWithParameters = new( id: "LUITM0001", - title: $"Provided control must not have a constructor with parameters.", - messageFormat: $"Cannot generate test with control {{0}} as it has a constructor with parameters.", + title: "Provided control must not have a constructor with parameters.", + messageFormat: "Cannot generate test with control {{0}} as it has a constructor with parameters", category: typeof(UIThreadTestMethodGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: $"Cannot generate test method with provided control."); + description: "Cannot generate test method with provided control."); } From 33c6a4aa840cbef74805f4a7976e013564eaa220 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 21 Feb 2024 16:20:53 -0600 Subject: [PATCH 16/22] Added AnalyzerReleases for SampleGen and TestGen Diagnostics --- .../AnalyzerReleases.Shipped.md | 3 +++ .../AnalyzerReleases.Unshipped.md | 22 +++++++++++++++++++ .../CommunityToolkit.Tooling.SampleGen.csproj | 5 +++++ .../AnalyzerReleases.Shipped.md | 3 +++ .../AnalyzerReleases.Unshipped.md | 8 +++++++ .../CommunityToolkit.Tooling.TestGen.csproj | 5 +++++ .../Diagnostics/DiagnosticDescriptors.cs | 2 +- 7 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 CommunityToolkit.Tooling.SampleGen/AnalyzerReleases.Shipped.md create mode 100644 CommunityToolkit.Tooling.SampleGen/AnalyzerReleases.Unshipped.md create mode 100644 CommunityToolkit.Tooling.TestGen/AnalyzerReleases.Shipped.md create mode 100644 CommunityToolkit.Tooling.TestGen/AnalyzerReleases.Unshipped.md diff --git a/CommunityToolkit.Tooling.SampleGen/AnalyzerReleases.Shipped.md b/CommunityToolkit.Tooling.SampleGen/AnalyzerReleases.Shipped.md new file mode 100644 index 00000000..60b59dd9 --- /dev/null +++ b/CommunityToolkit.Tooling.SampleGen/AnalyzerReleases.Shipped.md @@ -0,0 +1,3 @@ +; Shipped analyzer releases +; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md + diff --git a/CommunityToolkit.Tooling.SampleGen/AnalyzerReleases.Unshipped.md b/CommunityToolkit.Tooling.SampleGen/AnalyzerReleases.Unshipped.md new file mode 100644 index 00000000..d867079c --- /dev/null +++ b/CommunityToolkit.Tooling.SampleGen/AnalyzerReleases.Unshipped.md @@ -0,0 +1,22 @@ +; Unshipped analyzer release +; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md + +### New Rules + +Rule ID | Category | Severity | Notes +--------|----------|----------|------- +TKSMPL0001 | Usage | Error | DiagnosticDescriptors +TKSMPL0002 | Usage | Error | DiagnosticDescriptors +TKSMPL0003 | Usage | Error | DiagnosticDescriptors +TKSMPL0004 | Usage | Error | DiagnosticDescriptors +TKSMPL0005 | Usage | Error | DiagnosticDescriptors +TKSMPL0006 | Usage | Error | DiagnosticDescriptors +TKSMPL0007 | Usage | Error | DiagnosticDescriptors +TKSMPL0008 | Usage | Error | DiagnosticDescriptors +TKSMPL0009 | Usage | Error | DiagnosticDescriptors +TKSMPL0010 | Usage | Error | DiagnosticDescriptors +TKSMPL0011 | Usage | Error | DiagnosticDescriptors +TKSMPL0012 | Usage | Error | DiagnosticDescriptors +TKSMPL0013 | Usage | Warning | DiagnosticDescriptors +TKSMPL0014 | Usage | Warning | DiagnosticDescriptors +TKSMPL0015 | Usage | Error | DiagnosticDescriptors diff --git a/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj b/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj index e09c1db6..971fe4d9 100644 --- a/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj +++ b/CommunityToolkit.Tooling.SampleGen/CommunityToolkit.Tooling.SampleGen.csproj @@ -16,4 +16,9 @@ + + + + + diff --git a/CommunityToolkit.Tooling.TestGen/AnalyzerReleases.Shipped.md b/CommunityToolkit.Tooling.TestGen/AnalyzerReleases.Shipped.md new file mode 100644 index 00000000..60b59dd9 --- /dev/null +++ b/CommunityToolkit.Tooling.TestGen/AnalyzerReleases.Shipped.md @@ -0,0 +1,3 @@ +; Shipped analyzer releases +; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md + diff --git a/CommunityToolkit.Tooling.TestGen/AnalyzerReleases.Unshipped.md b/CommunityToolkit.Tooling.TestGen/AnalyzerReleases.Unshipped.md new file mode 100644 index 00000000..f19feca7 --- /dev/null +++ b/CommunityToolkit.Tooling.TestGen/AnalyzerReleases.Unshipped.md @@ -0,0 +1,8 @@ +; Unshipped analyzer release +; https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md + +### New Rules + +Rule ID | Category | Severity | Notes +--------|----------|----------|------- +LUITM0001 | Usage | Error | DiagnosticDescriptors diff --git a/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj b/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj index 3333912f..de2ab38c 100644 --- a/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj +++ b/CommunityToolkit.Tooling.TestGen/CommunityToolkit.Tooling.TestGen.csproj @@ -16,4 +16,9 @@ + + + + + diff --git a/CommunityToolkit.Tooling.TestGen/Diagnostics/DiagnosticDescriptors.cs b/CommunityToolkit.Tooling.TestGen/Diagnostics/DiagnosticDescriptors.cs index d2df26c7..5176cbdf 100644 --- a/CommunityToolkit.Tooling.TestGen/Diagnostics/DiagnosticDescriptors.cs +++ b/CommunityToolkit.Tooling.TestGen/Diagnostics/DiagnosticDescriptors.cs @@ -19,7 +19,7 @@ public static class DiagnosticDescriptors /// public static readonly DiagnosticDescriptor TestControlHasConstructorWithParameters = new( id: "LUITM0001", - title: "Provided control must not have a constructor with parameters.", + title: "Provided control must not have a constructor with parameters", messageFormat: "Cannot generate test with control {{0}} as it has a constructor with parameters", category: typeof(UIThreadTestMethodGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, From afc8f87a56a64603ae4e370bec1165598de6fed3 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 21 Feb 2024 17:30:45 -0600 Subject: [PATCH 17/22] Use empty source instead of empty string for sourcegen tests --- .../ToolkitSampleMetadataTests.Documentation.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs b/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs index 7dfefff9..9459ef19 100644 --- a/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs +++ b/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs @@ -31,6 +31,13 @@ public class UserControl { } } """; + private static readonly string EmptySource = """ + namespace MyApp + { + public class MyClass { } + } + """; + [TestMethod] public void MissingFrontMatterSection() { @@ -158,7 +165,7 @@ Which is valid. > [!SAMPLE Sample]"; - var result = SimpleSource.RunSourceGenerator(SAMPLE_ASM_NAME, markdown); + var result = EmptySource.RunSourceGenerator(SAMPLE_ASM_NAME, markdown); result.AssertNoCompilationErrors(); result.AssertDiagnosticsAre(); @@ -183,7 +190,7 @@ public void DocumentationInvalidDiscussionId() # This is some test documentation... Without an invalid discussion-id."; - var result = string.Empty.RunSourceGenerator(SAMPLE_ASM_NAME, markdown); + var result = EmptySource.RunSourceGenerator(SAMPLE_ASM_NAME, markdown); result.AssertNoCompilationErrors(); result.AssertDiagnosticsAre(DiagnosticDescriptors.MarkdownYAMLFrontMatterException, DiagnosticDescriptors.DocumentationHasNoSamples); @@ -211,7 +218,7 @@ public void DocumentationInvalidIssueId() # This is some test documentation... Without an invalid issue-id."; - var result = string.Empty.RunSourceGenerator(SAMPLE_ASM_NAME, markdown); + var result = EmptySource.RunSourceGenerator(SAMPLE_ASM_NAME, markdown); result.AssertNoCompilationErrors(); result.AssertDiagnosticsAre(DiagnosticDescriptors.MarkdownYAMLFrontMatterException, DiagnosticDescriptors.DocumentationHasNoSamples); @@ -240,7 +247,7 @@ public void DocumentationInvalidIsExperimental() # This is some test documentation... Without an invalid experimental value."; - var result = string.Empty.RunSourceGenerator(SAMPLE_ASM_NAME, markdown); + var result = EmptySource.RunSourceGenerator(SAMPLE_ASM_NAME, markdown); result.AssertNoCompilationErrors(); result.AssertDiagnosticsAre(DiagnosticDescriptors.MarkdownYAMLFrontMatterException, DiagnosticDescriptors.DocumentationHasNoSamples); From 14bb2d0e04ef0f6f292185caf0a941f6a04ee309 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 21 Feb 2024 17:31:07 -0600 Subject: [PATCH 18/22] Fixed DiagnosticDescriptors message formatting --- .../Diagnostics/DiagnosticDescriptors.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/CommunityToolkit.Tooling.SampleGen/Diagnostics/DiagnosticDescriptors.cs b/CommunityToolkit.Tooling.SampleGen/Diagnostics/DiagnosticDescriptors.cs index 3b4e290e..376b2db5 100644 --- a/CommunityToolkit.Tooling.SampleGen/Diagnostics/DiagnosticDescriptors.cs +++ b/CommunityToolkit.Tooling.SampleGen/Diagnostics/DiagnosticDescriptors.cs @@ -20,7 +20,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor SamplePaneOptionAttributeOnNonSample = new( id: "TKSMPL0001", title: "Invalid sample option declaration", - messageFormat: "Cannot generate sample pane options for type {{0}} as it does not use ToolkitSampleAttribute", + messageFormat: $"Cannot generate sample pane options for type {{0}} as it does not use ToolkitSampleAttribute", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -35,7 +35,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor SamplePaneOptionWithBadName = new( id: "TKSMPL0002", title: "Invalid sample option declaration", - messageFormat: "Cannot generate sample pane options for type {{0}} as the provided name is empty or invalid", + messageFormat: $"Cannot generate sample pane options for type {{0}} as the provided name is empty or invalid", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -50,7 +50,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor OptionsPaneAttributeWithMissingOrInvalidSampleId = new( id: "TKSMPL0003", title: "Missing or invalid sample Id", - messageFormat: "Cannot link sample options pane to type {{0}} as the provided sample ID does not match any known ToolkitSampleAttribute", + messageFormat: $"Cannot link sample options pane to type {{0}} as the provided sample ID does not match any known ToolkitSampleAttribute", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -65,7 +65,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor SamplePaneOptionWithDuplicateName = new( id: "TKSMPL0004", title: "Duplicate sample option name", - messageFormat: "Cannot generate sample pane option with name {{0}} as the provided name is already in use by another sample option", + messageFormat: $"Cannot generate sample pane option with name {{0}} as the provided name is already in use by another sample option", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -80,7 +80,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor SamplePaneOptionWithConflictingName = new( id: "TKSMPL0005", title: "Conflicting sample option name", - messageFormat: "Cannot generate sample pane option with name {{0}} as the provided name is already defined as a member in the attached class", + messageFormat: $"Cannot generate sample pane option with name {{0}} as the provided name is already defined as a member in the attached class", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -95,7 +95,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor SamplePaneMultiChoiceOptionWithNoChoices = new( id: "TKSMPL0006", title: "Missing choices in multi-choice sample option", - messageFormat: "Cannot generate multiple choice sample pane option with title {{0}} as no choices were provided", + messageFormat: $"Cannot generate multiple choice sample pane option with title {{0}} as no choices were provided", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -110,7 +110,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor SampleAttributeOnUnsupportedType = new( id: "TKSMPL0007", title: "ToolkitSampleAttribute declared on an invalid type", - messageFormat: "Cannot generate sample metadata as the attribute was used on an unsupported type", + messageFormat: $"Cannot generate sample metadata as the attribute was used on an unsupported type", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -125,7 +125,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor SampleOptionPaneAttributeOnUnsupportedType = new( id: "TKSMPL0008", title: "Toolkit sample options pane declared on an invalid type", - messageFormat: "Cannot generate options pane metadata as the attribute was used on an unsupported type", + messageFormat: $"Cannot generate options pane metadata as the attribute was used on an unsupported type", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -140,7 +140,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor SampleGeneratedOptionAttributeOnUnsupportedType = new( id: "TKSMPL0009", title: "Toolkit sample option declared on an invalid type", - messageFormat: "Cannot generate sample option metadata as the attribute was used on an unsupported type", + messageFormat: $"Cannot generate sample option metadata as the attribute was used on an unsupported type", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -152,7 +152,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor MarkdownYAMLFrontMatterException = new( id: "TKSMPL0010", title: "Invalid YAML Front Matter", - messageFormat: "Cannot generate sample page info for file {{0}} as an error was encountered parsing its YAML front matter: {{1}}", + messageFormat: $"Cannot generate sample page info for file {{0}} as an error was encountered parsing its YAML front matter: {{1}}", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -164,7 +164,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor MarkdownYAMLFrontMatterMissingField = new( id: "TKSMPL0011", title: "Missing YAML Front Matter", - messageFormat: "Cannot generate sample page info for file {{0}} as no '{{1}}' field was found in its YAML front matter", + messageFormat: $"Cannot generate sample page info for file {{0}} as no '{{1}}' field was found in its YAML front matter", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -176,7 +176,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor MarkdownSampleIdNotFound = new( id: "TKSMPL0012", title: "Sample Id Not Found from Markdown Reference", - messageFormat: "Cannot find the sample page referenced in file {{0}} with sample id '{{1}}'", + messageFormat: $"Cannot find the sample page referenced in file {{0}} with sample id '{{1}}'", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, @@ -188,7 +188,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor SampleNotReferencedInMarkdown = new( id: "TKSMPL0013", title: "Sample Not Referenced In Documentation", - messageFormat: "The sample with id '{{0}}' is not referenced in any documentation files and will not appear in the full sample app", + messageFormat: $"The sample with id '{{0}}' is not referenced in any documentation files and will not appear in the full sample app", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -200,7 +200,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor DocumentationHasNoSamples = new( id: "TKSMPL0014", title: "Documentation Has No Samples", - messageFormat: "The documentation page '{{0}}' does not reference any sample examples, it is recommended to have at least one code sample per document page", + messageFormat: $"The documentation page '{{0}}' does not reference any sample examples, it is recommended to have at least one code sample per document page", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, @@ -215,7 +215,7 @@ public static class DiagnosticDescriptors public static readonly DiagnosticDescriptor SampleIdAlreadyInUse = new( id: "TKSMPL0015", title: "Sample ID already in use", - messageFormat: "Cannot generate sample with id {{0}} as the provided id is already in use by another sample", + messageFormat: $"Cannot generate sample with id {{0}} as the provided id is already in use by another sample", category: typeof(ToolkitSampleMetadataGenerator).FullName, defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, From 3d7701bfbaf70bc6dd6234fb71e31d15202c428a Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Wed, 21 Feb 2024 17:32:55 -0600 Subject: [PATCH 19/22] Partial revert of afc8f87a56a64603ae4e370bec1165598de6fed3 --- .../ToolkitSampleMetadataTests.Documentation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs b/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs index 9459ef19..a61df3b0 100644 --- a/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs +++ b/CommunityToolkit.Tooling.SampleGen.Tests/ToolkitSampleMetadataTests.Documentation.cs @@ -165,7 +165,7 @@ Which is valid. > [!SAMPLE Sample]"; - var result = EmptySource.RunSourceGenerator(SAMPLE_ASM_NAME, markdown); + var result = SimpleSource.RunSourceGenerator(SAMPLE_ASM_NAME, markdown); result.AssertNoCompilationErrors(); result.AssertDiagnosticsAre(); From 75931cffab0a68a56f7a6dd3e42f753a1027a165 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Fri, 23 Feb 2024 12:30:31 -0600 Subject: [PATCH 20/22] Update to uno-check 1.20.2 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 78a89568..2b898369 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "uno.check": { - "version": "1.13.0", + "version": "1.20.2", "commands": [ "uno-check" ] From 47e5adf0e44e3e1fba6dda2f6f046d94f0ec5339 Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Fri, 23 Feb 2024 15:29:06 -0600 Subject: [PATCH 21/22] Update slngen to latest 11.2.3 --- .config/dotnet-tools.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2b898369..2817fea9 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.visualstudio.slngen.tool": { - "version": "9.5.4", + "version": "11.2.3", "commands": [ "slngen" ] From 812daabc25b16074ff13ac56702b5faaac5dfaad Mon Sep 17 00:00:00 2001 From: Arlo Godfrey Date: Mon, 26 Feb 2024 17:36:36 -0600 Subject: [PATCH 22/22] Fixed Library.props import order --- ToolkitComponent.SourceProject.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ToolkitComponent.SourceProject.props b/ToolkitComponent.SourceProject.props index 1022b2a1..5fac813f 100644 --- a/ToolkitComponent.SourceProject.props +++ b/ToolkitComponent.SourceProject.props @@ -3,6 +3,9 @@ + + + $([System.DateTime]::UtcNow.ToString(yyMMdd)) $(MajorVersion).$(MinorVersion).$(DateForVersion) @@ -16,9 +19,6 @@ false - - -