Skip to content

Commit

Permalink
Remove hardcoded values from bootstrap scripts (dotnet#10908)
Browse files Browse the repository at this point in the history
  • Loading branch information
YuliiaKovalova authored Nov 4, 2024
1 parent 5facb26 commit c5f2d38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions eng/cibuild_bootstrapped_msbuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ try {
}
else
{
$buildToolPath = Join-Path $bootstrapRoot "core\dotnet.exe"
# The version must be consistent with BootstrapSdkVersion
$buildToolCommand = Join-Path $bootstrapRoot "core\sdk\9.0.200-preview.0.24523.19\MSBuild.dll"
$buildToolPath = "$bootstrapRoot\core\dotnet.exe"
$propsFile = Join-Path $PSScriptRoot "Versions.props"
$bootstrapSdkVersion = ([xml](Get-Content $propsFile)).SelectSingleNode("//PropertyGroup/BootstrapSdkVersion").InnerText
$buildToolCommand = "$bootstrapRoot\core\sdk\$bootstrapSdkVersion\MSBuild.dll"
$buildToolFramework = "net9.0"
}

Expand Down
9 changes: 6 additions & 3 deletions eng/cibuild_bootstrapped_msbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ bootstrapRoot="$Stage1Dir/bin/bootstrap"

if [ $host_type = "core" ]
then
_InitializeBuildTool="$bootstrapRoot/core/dotnet"
# The version must be consistent with BootstrapSdkVersion
_InitializeBuildToolCommand="$bootstrapRoot/core/sdk/9.0.200-preview.0.24523.19/MSBuild.dll"
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
props_file="$script_dir/Versions.props"
sdk_version=$(grep -A1 "BootstrapSdkVersion" "$props_file" | grep -o ">.*<" | sed 's/[><]//g')

_InitializeBuildTool="${bootstrapRoot}/core/dotnet"
_InitializeBuildToolCommand="${bootstrapRoot}/core/sdk/${sdk_version}/MSBuild.dll"
_InitializeBuildToolFramework="net9.0"
else
echo "Unsupported hostType ($host_type)"
Expand Down

0 comments on commit c5f2d38

Please sign in to comment.