Fix reading of minimum MSBuild version

This commit is contained in:
Chet Husk 2024-03-22 13:22:46 -05:00
parent 105947752d
commit ac487ddeb1

View file

@ -1248,11 +1248,13 @@ Copyright (c) .NET Foundation. All rights reserved.
<Target Name="GenerateBundledMSBuildProps" DependsOnTargets="SetupBundledComponents">
<PropertyGroup>
<MinimumMSBuildVersionFile>$(RedistLayoutPath)sdk/$(Version)/minimumMSBuildVersion</MinimumMSBuildVersionFile>
<BundledMSBuildPropsFileName>Microsoft.NETCoreSdk.BundledMSBuildInformation.props</BundledMSBuildPropsFileName>
<MinimumMSBuildVersionFile Condition="$([System.Text.RegularExpressions.Regex]::Match(%(SDKInternalFiles.Identity),'.*minimumMSBuildVersion').Success) ">%(SDKInternalFiles.Identity)</MinimumMSBuildVersionFile>
<BundledMSBuildVersion>$(MSBuildVersion)</BundledMSBuildVersion>
</PropertyGroup>
<Error Text="No MSBuild version file found under '$(RedistLayoutPath)sdk/$(Version)'" Condition="!Exists('$(MinimumMSBuildVersionFile)')" />
<ReadLinesFromFile File="$(MinimumMSBuildVersionFile)">
<Output TaskParameter="Lines" PropertyName="MinimumMSBuildVersion"/>
</ReadLinesFromFile>