Skip to content

Commit 0d894ea

Browse files
committed
Minor tweaks to MSBuild checks
1 parent 408c44b commit 0d894ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.targets

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
DependsOnTargets="_MVVMToolkitGatherAnalyzers">
1414

1515
<Choose>
16-
<When Condition="$(CSharpCoreTargetsPath) != ''">
16+
<When Condition="'$(CSharpCoreTargetsPath)' != ''">
1717

1818
<!-- Use the CSharpCoreTargetsPath property to find the version of the compiler we are using. This is the same mechanism
1919
MSBuild uses to find the compiler. We could check the assembly version for any compiler assembly (since they all have
@@ -30,18 +30,18 @@
3030

3131
<!-- The CurrentCompilerVersionIsNotNewEnough property can now be defined based on the Roslyn assembly version -->
3232
<CurrentCompilerVersionIsNotNewEnough Condition="$([MSBuild]::VersionLessThan($(CurrentCompilerVersion), 4.0))">true</CurrentCompilerVersionIsNotNewEnough>
33-
<CurrentCompilerVersionIsNotNewEnough Condition="$(CurrentCompilerVersionIsNotNewEnough) == ''">false</CurrentCompilerVersionIsNotNewEnough>
33+
<CurrentCompilerVersionIsNotNewEnough Condition="'$(CurrentCompilerVersionIsNotNewEnough)' == ''">false</CurrentCompilerVersionIsNotNewEnough>
3434
</PropertyGroup>
3535

3636
<!-- If the Roslyn version is < 4.0, disable the source generators -->
37-
<ItemGroup Condition ="$(CurrentCompilerVersionIsNotNewEnough) == 'true'">
37+
<ItemGroup Condition ="'$(CurrentCompilerVersionIsNotNewEnough)' == 'true'">
3838
<Analyzer Remove="@(_MVVMToolkitAnalyzer)"/>
3939
</ItemGroup>
4040

4141
<!-- If the source generators are disabled, also emit a warning. This would've been produced by MSBuild itself as well, but
4242
emitting this manually lets us customize the message to inform developers as to why exactly the generators have been
4343
disabled, and that the rest of the MVVM Toolkit will still keep working as intended, just without additional features. -->
44-
<Warning Condition ="$(CurrentCompilerVersionIsNotNewEnough) == 'true'" Text="The MVVM Toolkit source generators have been disabled on the current configuration, as they need Roslyn 4.x in order to work. The MVVM Toolkit will work just fine, but features relying on the source generators will not be available."/>
44+
<Warning Condition ="'$(CurrentCompilerVersionIsNotNewEnough)' == 'true'" Text="The MVVM Toolkit source generators have been disabled on the current configuration, as they need Roslyn 4.x in order to work. The MVVM Toolkit will work just fine, but features relying on the source generators will not be available."/>
4545
</When>
4646

4747
<Otherwise>

0 commit comments

Comments
 (0)