Skip to content

Commit

Permalink
fix(codegen): Enhance roslyn version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed May 18, 2022
1 parent 2cd9ffe commit ce9ef6e
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@

<PropertyGroup>
<_isRoslynAnalyzerAvailable Condition="'$(MSBuildVersion)' &gt;= '16.8'">true</_isRoslynAnalyzerAvailable>
<_canUseRoslynAnalyzer Condition="'$(LangVersion)' == 'preview' or ('$(LangVersion)'!='' and $(LangVersion.Contains('.')) and '$(LangVersion)'&gt;='9.0')">true</_canUseRoslynAnalyzer>

<_canUseRoslynAnalyzer Condition="
'$(LangVersion)' == 'preview'
Or '$(LangVersion)' == 'latest'
Or '$(LangVersion)' == 'latestMajor'
Or '$(LangVersion)' == 'default'
Or (
'$(LangVersion)'!=''
and $([MSBuild]::VersionGreaterThan($(LangVersion), '9.0'))
)">true</_canUseRoslynAnalyzer>

<UnoUIUseRoslynSourceGenerators Condition="'$(UnoUIUseRoslynSourceGenerators)'=='' and '$(_isRoslynAnalyzerAvailable)' == 'true' and '$(_canUseRoslynAnalyzer)'=='true'">true</UnoUIUseRoslynSourceGenerators>
<UnoUIUseRoslynSourceGenerators Condition="'$(UnoUIUseRoslynSourceGenerators)'==''">false</UnoUIUseRoslynSourceGenerators>

Expand Down Expand Up @@ -372,7 +382,7 @@
</Target>

<Target Name="UnoLogGeneratorsType" BeforeTargets="CoreCompile;_UnoSourceGenerator">
<Message
<Message Importance="high"
Condition="'$(UnoUIUseRoslynSourceGenerators)'=='true'"
Text="Uno.UI is using Roslyn generators" />
<Message Importance="high"
Expand Down

0 comments on commit ce9ef6e

Please sign in to comment.