Skip to content

Commit be027fd

Browse files
committed
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.
1 parent 6423696 commit be027fd

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

dotnet.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<Project Path="tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn4001.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn4001.UnitTests.csproj" />
4242
<Project Path="tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn4031.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn4031.UnitTests.csproj" />
4343
<Project Path="tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120.UnitTests.csproj" />
44+
<Project Path="tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn5000.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn5000.UnitTests.csproj" />
4445
<Project Path="tests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.UnitTests.shproj" />
4546
<Project Path="tests/CommunityToolkit.Mvvm.UnitTests/CommunityToolkit.Mvvm.UnitTests.shproj" />
4647
</Folder>

src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4001\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4001.csproj" ReferenceOutputAssembly="false" />
7070
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4031\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4031.csproj" ReferenceOutputAssembly="false" />
7171
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120.csproj" ReferenceOutputAssembly="false" />
72-
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120\CommunityToolkit.Mvvm.SourceGenerators.Roslyn5000.csproj" ReferenceOutputAssembly="false" />
72+
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn5000\CommunityToolkit.Mvvm.SourceGenerators.Roslyn5000.csproj" ReferenceOutputAssembly="false" />
7373
<ProjectReference Include="..\CommunityToolkit.Mvvm.CodeFixers.Roslyn4001\CommunityToolkit.Mvvm.CodeFixers.Roslyn4001.csproj" ReferenceOutputAssembly="false" />
7474
<ProjectReference Include="..\CommunityToolkit.Mvvm.CodeFixers.Roslyn4120\CommunityToolkit.Mvvm.CodeFixers.Roslyn4120.csproj" ReferenceOutputAssembly="false" />
7575
</ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net472;net8.0;net9.0</TargetFrameworks>
5+
<DefineConstants>$(DefineConstants);ROSLYN_4_3_1_OR_GREATER;ROSLYN_4_12_0_OR_GREATER;ROSLYN_5_0_0_OR_GREATER</DefineConstants>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<Compile Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120.UnitTests\Test_SourceGeneratorsCodegen.cs" Link="Test_SourceGeneratorsCodegen.cs" />
10+
<Compile Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120.UnitTests\Test_SourceGeneratorsDiagnostics.cs" Link="Test_SourceGeneratorsDiagnostics.cs" />
11+
<Compile Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120.UnitTests\Test_UseObservablePropertyOnSemiAutoPropertyCodeFixer.cs" Link="Test_UseObservablePropertyOnSemiAutoPropertyCodeFixer.cs" />
12+
<Compile Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn4120.UnitTests\Test_UsePartialPropertyForObservablePropertyCodeFixer.cs" Link="Test_UsePartialPropertyForObservablePropertyCodeFixer.cs" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="1.1.2" />
17+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.2" />
18+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.0.0-2.final" />
19+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
20+
<PackageReference Include="MSTest.TestAdapter" Version="4.0.1" />
21+
<PackageReference Include="MSTest.TestFramework" Version="4.0.1" />
22+
23+
<!-- Top-level override to fix address security vulnerability warnings -->
24+
<PackageReference Include="System.Formats.Asn1" Version="9.0.10" />
25+
</ItemGroup>
26+
27+
<ItemGroup>
28+
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />
29+
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.CodeFixers.Roslyn4120\CommunityToolkit.Mvvm.CodeFixers.Roslyn4120.csproj" />
30+
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.SourceGenerators.Roslyn5000\CommunityToolkit.Mvvm.SourceGenerators.Roslyn5000.csproj" />
31+
</ItemGroup>
32+
33+
<Import Project="..\CommunityToolkit.Mvvm.SourceGenerators.UnitTests\CommunityToolkit.Mvvm.SourceGenerators.UnitTests.projitems" Label="Shared" />
34+
35+
</Project>

0 commit comments

Comments
 (0)