2642 Commits

Author SHA1 Message Date
Sergio Pedri b135626dd5 Set version.json to 8.4.2 2026-03-24 15:35:52 -07:00
Sergio Pedri f20707005e Merge pull request #1174 from CommunityToolkit/fix/analyzer-dedup-version-order
Fix incorrect version check order in MVVMToolkitRemoveDuplicateAnalyzers target
2026-03-24 15:03:51 -07:00
Sergio Pedri 02d81da64b Fix incorrect version check order in MVVMToolkitRemoveDuplicateAnalyzers target
MSBuild PropertyGroup elements are evaluated top-to-bottom, with later
assignments overwriting earlier ones. The >= 4.12 check was before the
>= 4.3 check, so for any Roslyn version >= 4.12 (including 5.0), the
4.12 result would be immediately overwritten by the 4.3 match. This
caused the wrong analyzer (roslyn4.3) to be selected instead of the
correct one (roslyn4.12).

Swap the order so the lower version (4.3) is checked first and the
higher version (4.12) is checked last, ensuring the highest compatible
analyzer wins.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-24 14:57:02 -07:00
Sergio Pedri ea17501292 Merge pull request #1171 from CommunityToolkit/dev/roslyn5000-code-fixers
Add MVVM Toolkit code fixer for Roslyn 5.0
2026-03-16 21:29:08 -07:00
Sergio Pedri f8b7609e9e Parameterize tests for multiple C# language versions
Update unit tests to run against different C# language versions: add DataRow(LanguageVersion.Preview) to each test and, under ROSLYN_5_0_0_OR_GREATER, add DataRow(LanguageVersion.CSharp14). Change test methods to accept a LanguageVersion parameter and use it when constructing CSharpCodeFixTest (replace hardcoded LanguageVersion.Preview). Conditional compilation preserves compatibility with older Roslyn targets.
2026-03-16 17:37:02 -07:00
Sergio Pedri 403b96541d Include Roslyn5000 code fixers and analyzer
Add a ProjectReference to CommunityToolkit.Mvvm.CodeFixers.Roslyn5000 (ReferenceOutputAssembly="false") and update the packaged analyzer entry for roslyn5.0 to point at the Roslyn5000 DLL. This ensures the Roslyn 5.0 code fixers are built and included in the package analyzers folder for roslyn5.0 compatibility.
2026-03-16 17:28:10 -07:00
Sergio Pedri bdd4567f9b Use Roslyn API for C# language-version check
Use the Roslyn 5+ API when available to determine the C# language version. Add a conditional compilation branch that calls Compilation.HasLanguageVersionAtLeastEqualTo(LanguageVersion.CSharp14) when ROSLYN_5_0_0_OR_GREATER is defined, and fall back to the previous IsLanguageVersionPreview() check otherwise. This avoids generating invalid code on older Roslyn builds while correctly detecting C#14+ in newer toolchains.
2026-03-16 17:27:01 -07:00
Sergio Pedri e7a54bd5c3 Import shared props in Roslyn5000 project
Replace inline project properties in the Roslyn5000 csproj with imports of the shared props and projitems to centralize configuration. Also add a new conditional DefineConstants in CommunityToolkit.Mvvm.CodeFixers.props to define ROSLYN_5_0_0_OR_GREATER when MvvmToolkitSourceGeneratorRoslynVersion >= 5.0.0, enabling feature flags for Roslyn 5.0.
2026-03-16 17:25:28 -07:00
Sergio Pedri b4537625a2 Add Roslyn5000 CodeFixers project to solution
Add a new CommunityToolkit.Mvvm.CodeFixers.Roslyn5000.csproj targeting net10.0 with ImplicitUsings and Nullable enabled, and include the project in dotnet.slnx. This adds a Roslyn5000-specific CodeFixers project to the solution so it can be built and discovered by the solution tooling.
2026-03-16 17:22:30 -07:00
Sergio Pedri 2f670eee80 Merge pull request #1170 from CommunityToolkit/dev/reproducible-builds
Fix deterministic builds, improve GitHub links
2026-03-16 10:51:03 -07:00
Sergio Pedri 223fb36f1d Add reproducible builds pkg; remove embedded PDB
Add DotNet.ReproducibleBuilds (with comment) alongside Nerdbank.GitVersioning to enable reproducible build tooling. Remove the explicit PublishRepositoryUrl setting from Directory.Build.props. Drop the ContinuousIntegrationBuild property from build/Community.Toolkit.Common.props. Remove forced DebugType=embedded and associated comments from the source generator and codefixer props, reverting to default PDB handling for those projects.
2026-03-16 10:26:45 -07:00
Sergio Pedri 67c676cc01 Merge pull request #1159 from CommunityToolkit/dev/mvvm-analyzers-fixes
Update analyzers for C# 14.0 language version checks
2026-02-02 13:00:31 -08:00
Sergio Pedri 4222078b2d Add analyzer tests for C# 14 language version
Introduces new unit tests under the ROSLYN_5_0_0_OR_GREATER conditional to verify analyzer diagnostics and code generation behavior when using C# 14. These tests ensure correct warnings are produced for observable properties and WinRT compatibility in this language version.
2026-01-27 16:23:21 -08:00
Sergio Pedri ee5e84a75d Update analyzers for C# 14.0 language version checks
Replaced preview language version checks with explicit C# 14.0 or greater checks using HasLanguageVersionAtLeastEqualTo when available. This ensures analyzers correctly handle new language versioning and maintain compatibility with Roslyn 5.0.0 or greater.
2026-01-27 16:16:22 -08:00
Sergio Pedri 52ef1252c4 Merge pull request #1156 from CommunityToolkit/dev/fix-roslyn5.0-packing
Update Roslyn 5.0 analyzer and code fixer paths
2026-01-13 13:04:01 -08:00
Sergio Pedri d395f9f858 Update Roslyn 5.0 analyzer path
Changed the source generator reference for Roslyn 5.0 to use the Roslyn5000 projects instead of Roslyn4120, ensuring the correct analyzer DLL is packaged for Roslyn 5.0.
2026-01-13 11:08:43 -08:00
Sergio Pedri cdb1a18c64 Merge pull request #1155 from CommunityToolkit/dev/update-sdk
Update .NET SDK and NuGet dependencies
2026-01-12 13:51:16 -08:00
Sergio Pedri 2a86742667 Update package dependencies to latest versions
Bump Microsoft.Bcl.AsyncInterfaces, System.Text.Json, and System.Formats.Asn1 to version 10.0.1 in main and test projects to address security and compatibility improvements.
2026-01-12 13:33:27 -08:00
Sergio Pedri 5eb6b29424 Update .NET SDK version to 10.0.101 in global.json
Bump the .NET SDK version from 10.0.100 to 10.0.101 to ensure the project uses the latest patch version.
2026-01-12 13:28:45 -08:00
Sergio Pedri b030dcfaba Set version.json to 8.4.1 2025-11-25 11:53:07 -08:00
Sergio Pedri 52aec6f75b Merge pull request #1025 from Youssef1313/patch-1
Support nested blocks in semi-auto property analyzer, add tests
2025-11-24 22:10:03 -08:00
Sergio Pedri b3c0266aec Handle nested block operations in analyzer
Adds support for analyzing nested block operations in 'get' accessors, improving compatibility with code generated by other tooling. The analyzer now correctly identifies return operations within nested blocks.
2025-11-24 15:39:18 -08:00
Youssef Victor e635084535 More tests for semi auto prop analyzer 2025-11-24 15:39:18 -08:00
Sergio Pedri eb25f101a8 Merge pull request #1130 from marcin-krystianc/dev-20251028-span2d
Eliminate this = default shortcut when height * width = 0
2025-11-24 15:39:01 -08:00
Marcin Krystianc 8323145328 Eliminate this = default shortcut when height * width = 0 2025-11-24 14:52:57 -08:00
Sergio Pedri 02891cee63 Merge pull request #1140 from CommunityToolkit/dev/partial-props-support
Fix C# language version checks for `[ObservableProperty]`
2025-11-24 14:52:22 -08:00
Sergio Pedri 27d43c1188 Update C# language version to 14.0 in test project
Changed the LangVersion property from 'preview' to '14.0' in the CommunityToolkit.Mvvm.Roslyn5000.UnitTests.csproj file to explicitly target C# 14.0 for test builds.
2025-11-24 14:30:28 -08:00
Sergio Pedri ab4e3c21ac Remove Roslyn 5.0.0 workaround and update test dependency
Eliminated the temporary workaround for Roslyn 5.0.0 in the props file and updated the test project's Microsoft.CodeAnalysis.CSharp.Workspaces package reference from 5.0.0-2.final to 5.0.0. This aligns the configuration with the stable Roslyn release.
2025-11-24 14:28:58 -08:00
Sergio Pedri ea014da0fe Add C# 14 partial property tests and fix formatting
Introduces new unit tests for ObservableProperty with value types on partial properties using C# 14 and Roslyn 5.0.0 or greater. Also updates formatting in diagnostics tests for consistency and readability.
2025-11-24 14:28:58 -08:00
Sergio Pedri dffc56d7ee Add Roslyn5000 unit test project and fix project reference
Added CommunityToolkit.Mvvm.SourceGenerators.Roslyn5000.UnitTests project to the solution and corrected the project reference in CommunityToolkit.Mvvm.csproj to point to the correct Roslyn5000 source generator. This enables testing for Roslyn 5.0.0 support.
2025-11-24 14:28:58 -08:00
Sergio Pedri 3d97ed279f Add Roslyn 5.0.0 unit test project
Introduces CommunityToolkit.Mvvm.Roslyn5000.UnitTests.csproj targeting net472, net8.0, and net9.0. Updates the solution file to include the new test project for Roslyn 5.0.0 compatibility testing.
2025-11-24 14:28:58 -08:00
Sergio Pedri 272a9749a7 Update analyzer for C# 14.0 language version support
Renamed RequiresCSharpLanguageVersionPreviewAnalyzer to RequiresCSharpLanguageVersion14OrPreviewAnalyzer and updated logic to check for C# 14.0 or preview language versions. Adjusted generator and unit tests to reference the new analyzer and updated version checks for compatibility with Roslyn 5.0.0 or greater.
2025-11-24 14:28:58 -08:00
Sergio Pedri 6ae2439606 Add Roslyn 5.0 source generator and code fixer support
Added project references and packaging entries for Roslyn 5.0 source generators and code fixers to support analyzers for the latest Roslyn version.
2025-11-24 14:28:58 -08:00
Sergio Pedri 8f23f79c18 Update summary for DiagnosticsExtensions class
Revised the XML summary comment to clarify that the extension methods are for working with diagnostics from incremental generator pipelines, rather than specifically for GeneratorExecutionContext.
2025-11-24 14:28:58 -08:00
Sergio Pedri 55f39c2d75 Update Roslyn 5.0 support in source generators
Refactored the Roslyn 5000 project to import shared props and projitems files. Added support for the ROSLYN_5_0_0_OR_GREATER constant, updated NoWarn conditions for RS2003, and introduced a temporary workaround for Roslyn 5.0.0 versioning in the props file.
2025-11-24 14:28:58 -08:00
Sergio Pedri c62a26480b Add Roslyn5000 source generator project to solution
Created a new CommunityToolkit.Mvvm.SourceGenerators.Roslyn5000 project targeting netstandard2.0 and added it to the solution file.
2025-11-24 14:28:58 -08:00
Sergio Pedri 8b54ba568c Add C# 14.0 support for ObservableProperty on partial properties
Updated the ObservableProperty generator and diagnostics to allow usage with C# 14.0 or 'preview' language versions, not just 'preview'. Added a new helper method for language version comparison and updated diagnostic descriptors and analyzer logic to reflect the new minimum version requirement.
2025-11-24 14:28:58 -08:00
Sergio Pedri 67889e8ea2 Merge pull request #1144 from CommunityToolkit/dev/net10-sdk
Update to .NET 10 SDK, add .NET 10 TFM to test projects
2025-11-24 14:26:06 -08:00
Sergio Pedri 796d8d0956 Add .NET 10.0 target to all unit test projects
Updated the TargetFrameworks property in all unit test .csproj files to include net10.0, enabling tests to run against the latest .NET version.
2025-11-24 13:54:41 -08:00
Sergio Pedri 07062f4301 Update to .NET SDK 10 and revise toolkit requirements
Bump .NET SDK version to 10.0.100 in global.json and update NuGet operations to use 10.0.x in CI workflow. Simplify MVVM Toolkit error message to recommend using the latest .NET SDK version.
2025-11-24 13:52:06 -08:00
Sergio Pedri 65b1a3242f Merge pull request #1047 from CommunityToolkit/dev/update-deps
Update NuGet packages and Windows SDK props
2025-11-10 13:40:44 -08:00
Sergio Pedri 5f2f8174fb Update NuGet packages to latest stable 2025-11-10 12:20:12 -08:00
Sergio Pedri 85d26bf421 Update NuGet packages to latest stable 2025-11-10 12:17:43 -08:00
Sergio Pedri e5ada2ebf1 Fix warning for 'Asn1' package 2025-11-10 12:16:28 -08:00
Sergio Pedri 013b10cd71 Update NuGet packages to latest stable 2025-11-10 11:56:58 -08:00
Sergio Pedri 9be2ae6ee7 Update NuGet packages to latest stable 2025-11-10 11:55:49 -08:00
Sergio Pedri 38c6f4a899 Update CsWinRT references 2025-11-10 11:54:56 -08:00
Sergio Pedri 1abeff602b Mark more members as 'readonly' 2025-11-10 11:54:56 -08:00
Sergio Pedri 3541038a91 Merge pull request #1137 from CommunityToolkit/dev/update-mestest
Update MSTest to latest
2025-11-10 11:54:20 -08:00
Sergio Pedri 6e83642f07 Enable parallel test execution via shared target
Moved the ParallelizeAttribute configuration from individual test project files to the shared Community.Toolkit.Common.targets file. This centralizes the configuration and ensures all test projects run tests in parallel by default.
2025-11-09 18:48:08 -08:00