From ce9ef6e39b0012f696aacd10dc5dfdec269eb0f8 Mon Sep 17 00:00:00 2001 From: Jerome Laban Date: Tue, 17 May 2022 21:39:27 -0400 Subject: [PATCH] fix(codegen): Enhance roslyn version detection --- .../Content/Uno.UI.SourceGenerators.props | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/SourceGenerators/Uno.UI.SourceGenerators/Content/Uno.UI.SourceGenerators.props b/src/SourceGenerators/Uno.UI.SourceGenerators/Content/Uno.UI.SourceGenerators.props index b059c43644d1..d0c3976ca896 100644 --- a/src/SourceGenerators/Uno.UI.SourceGenerators/Content/Uno.UI.SourceGenerators.props +++ b/src/SourceGenerators/Uno.UI.SourceGenerators/Content/Uno.UI.SourceGenerators.props @@ -7,7 +7,17 @@ <_isRoslynAnalyzerAvailable Condition="'$(MSBuildVersion)' >= '16.8'">true - <_canUseRoslynAnalyzer Condition="'$(LangVersion)' == 'preview' or ('$(LangVersion)'!='' and $(LangVersion.Contains('.')) and '$(LangVersion)'>='9.0')">true + + <_canUseRoslynAnalyzer Condition=" + '$(LangVersion)' == 'preview' + Or '$(LangVersion)' == 'latest' + Or '$(LangVersion)' == 'latestMajor' + Or '$(LangVersion)' == 'default' + Or ( + '$(LangVersion)'!='' + and $([MSBuild]::VersionGreaterThan($(LangVersion), '9.0')) + )">true + true false @@ -372,7 +382,7 @@ -