Skip to content

Commit 1be2fa1

Browse files
committed
Pack code fixer project in the MVVM Toolkit package
1 parent 6ee8d7c commit 1be2fa1

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/CommunityToolkit.Mvvm.Fixers/CommunityToolkit.Mvvm.Fixers.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5+
<IsPackable>false</IsPackable>
56
</PropertyGroup>
67

78
<ItemGroup>

src/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.csproj

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
3535
</ItemGroup>
3636

37-
<!-- Reference the various multi-targeted versions of the source generator project (one per Roslyn version) -->
37+
<!-- Reference the various multi-targeted versions of the source generator project (one per Roslyn version), and the code fixer -->
3838
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
3939
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj" ReferenceOutputAssembly="false" />
4040
<ProjectReference Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn431\CommunityToolkit.Mvvm.SourceGenerators.Roslyn431.csproj" ReferenceOutputAssembly="false" />
41+
<ProjectReference Include="..\CommunityToolkit.Mvvm.Fixers\CommunityToolkit.Mvvm.Fixers.csproj" ReferenceOutputAssembly="false" />
4142
</ItemGroup>
4243

4344
<!-- Add the [InternalsVisibleTo] attribute for the test project -->
@@ -73,9 +74,17 @@
7374
<!--
7475
Pack the source generator to the right package folders (each matching the target Roslyn version).
7576
Roslyn will automatically load the highest version compatible with Roslyn's version in the SDK.
77+
Also pack the code fixer along with each target analyzer, the multi-targeting take care of it.
78+
Note: the code fixer is not currently multi-targeting, as there are no Roslyn APIs it needs from
79+
versions later than 4.0.1. As such, we can just use a single project (without the shared project
80+
and two multi-targeted ones), and pack the resulting assembly twice along with the generators.
81+
Even though the fixer only references the 4.0.1 generator target, both versions export the same
82+
APIs that the code fixer project needs, and Roslyn versions are also forward compatible.
7683
-->
7784
<None Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.SourceGenerators.dll" PackagePath="analyzers\dotnet\roslyn4.0\cs" Pack="true" Visible="false" />
7885
<None Include="..\CommunityToolkit.Mvvm.SourceGenerators.Roslyn431\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.SourceGenerators.dll" PackagePath="analyzers\dotnet\roslyn4.3\cs" Pack="true" Visible="false" />
86+
<None Include="..\CommunityToolkit.Mvvm.Fixers\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.Fixers.dll" PackagePath="analyzers\dotnet\roslyn4.0\cs" Pack="true" Visible="false" />
87+
<None Include="..\CommunityToolkit.Mvvm.Fixers\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Mvvm.Fixers.dll" PackagePath="analyzers\dotnet\roslyn4.3\cs" Pack="true" Visible="false" />
7988
</ItemGroup>
8089

8190
</Project>

tests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests/CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.Fixers\CommunityToolkit.Mvvm.Fixers.csproj" />
1918
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm\CommunityToolkit.Mvvm.csproj" />
19+
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.Fixers\CommunityToolkit.Mvvm.Fixers.csproj" />
2020
<ProjectReference Include="..\..\src\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401\CommunityToolkit.Mvvm.SourceGenerators.Roslyn401.csproj" />
2121
</ItemGroup>
2222

0 commit comments

Comments
 (0)