Skip to content

Commit

Permalink
Fixed a compiler error being forced when targeting latest runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
ByronMayne committed Jul 27, 2024
1 parent 375278a commit 11f285d
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,20 @@
</Target>
<!-- Validates they are at least using LangVersion 7.3 for nullable refernece types-->
<Target Name="SGF_LangVersionValidation" BeforeTargets="CoreCompile">
<ItemGroup>
<NamedVersion Include="preview"/>
<NamedVersion Include="preview"/>
<NamedVersion Include="latest"/>
<NamedVersion Include="latestMajor"/>
</ItemGroup>
<PropertyGroup>
<MinLangVersion>7.2</MinLangVersion>
<IsNamedVersion>false</IsNamedVersion>
<IsNamedVersion Condition="'%(NamedVersion.Identity)' == '$(LangVersion)'">true</IsNamedVersion>
</PropertyGroup>
<Error
Condition="$([MSBuild]::VersionGreaterThan('$(MinLangVersion)', '$(LangVersion)'))"
Condition="!$(IsNamedVersion) AND $([MSBuild]::VersionGreaterThan('$(MinLangVersion)', '$(LangVersion)'))"
Text="[SourceGenerator.Foundations] The project $(MSBuildProjectName) is currently using the language version $(LangVersion) which does not meet the minimum required of $(MinLangVersion). Read how to change it here https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version" />
</Target>

</Project>

0 comments on commit 11f285d

Please sign in to comment.