From 77776099bdd3d38cac57dcdcf42e500b2bc01b7d Mon Sep 17 00:00:00 2001 From: Sergio Pedri <sergio0694@live.com> Date: Tue, 21 Jun 2022 16:40:04 +0200 Subject: [PATCH] Add unique prefixes to all .targets properties and items --- CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.targets | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.targets b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.targets index 911484a..7c06e78 100644 --- a/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.targets +++ b/CommunityToolkit.Mvvm/CommunityToolkit.Mvvm.targets @@ -18,27 +18,27 @@ the same version) but Microsoft.Build.Tasks.CodeAnalysis.dll is where MSBuild loads the compiler tasks from so if someone is getting creative with msbuild tasks/targets this is the "most correct" assembly to check. --> <GetAssemblyIdentity AssemblyFiles="$([System.IO.Path]::Combine(`$([System.IO.Path]::GetDirectoryName($(CSharpCoreTargetsPath)))`,`Microsoft.Build.Tasks.CodeAnalysis.dll`))"> - <Output TaskParameter="Assemblies" ItemName="CurrentCompilerAssemblyIdentity"/> + <Output TaskParameter="Assemblies" ItemName="MVVMToolkitCurrentCompilerAssemblyIdentity"/> </GetAssemblyIdentity> <PropertyGroup> <!-- Transform the resulting item from GetAssemblyIdentity into a property representing its assembly version --> - <CurrentCompilerVersion>@(CurrentCompilerAssemblyIdentity->'%(Version)')</CurrentCompilerVersion> + <MVVMToolkitCurrentCompilerVersion>@(MVVMToolkitCurrentCompilerAssemblyIdentity->'%(Version)')</MVVMToolkitCurrentCompilerVersion> <!-- The CurrentCompilerVersionIsNotNewEnough property can now be defined based on the Roslyn assembly version --> - <CurrentCompilerVersionIsNotNewEnough Condition="$([MSBuild]::VersionLessThan($(CurrentCompilerVersion), 4.0))">true</CurrentCompilerVersionIsNotNewEnough> + <MVVMToolkitCurrentCompilerVersionIsNotNewEnough Condition="$([MSBuild]::VersionLessThan($(MVVMToolkitCurrentCompilerVersion), 4.0))">true</MVVMToolkitCurrentCompilerVersionIsNotNewEnough> </PropertyGroup> <!-- If the Roslyn version is < 4.0, disable the source generators --> - <ItemGroup Condition ="'$(CurrentCompilerVersionIsNotNewEnough)' == 'true'"> + <ItemGroup Condition ="'$(MVVMToolkitCurrentCompilerVersionIsNotNewEnough)' == 'true'"> <Analyzer Remove="@(_MVVMToolkitAnalyzer)"/> </ItemGroup> <!-- If the source generators are disabled, also emit a warning. This would've been produced by MSBuild itself as well, but emitting this manually lets us customize the message to inform developers as to why exactly the generators have been disabled, and that the rest of the MVVM Toolkit will still keep working as intended, just without additional features. --> - <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."/> + <Warning Condition ="'$(MVVMToolkitCurrentCompilerVersionIsNotNewEnough)' == '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."/> </Target> <!-- Remove the analyzer if Roslyn is missing -->