diff options
author | Mateo Torres-Ruiz <mateoatr@users.noreply.github.com> | 2021-09-03 11:45:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-03 11:45:59 +0300 |
commit | 2122ca10c517f3fe26a97d1588d19737e23b8f7b (patch) | |
tree | 0d042c6a1f4cc2bdf32d8e4213754fc8de263cb4 /eng/build.ps1 | |
parent | 807c4ad950034dcb853957f8228ce57fc2ec37b0 (diff) |
Add support for build.cmd -vs corehost.sln (#58520)
* Add support for -vs corehost.sln
* Avoid variable dup
Diffstat (limited to 'eng/build.ps1')
-rw-r--r-- | eng/build.ps1 | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/eng/build.ps1 b/eng/build.ps1 index af253dfb3db..894c53eea4f 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -127,17 +127,18 @@ if ($subset -eq 'help') { } if ($vs) { + $archToOpen = $arch[0] + $configToOpen = $configuration[0] + $repoRoot = Split-Path $PSScriptRoot -Parent + if ($runtimeConfiguration) { + $configToOpen = $runtimeConfiguration + } + if ($vs -ieq "coreclr.sln") { # If someone passes in coreclr.sln (case-insensitive), # launch the generated CMake solution. - $archToOpen = $arch[0] - $configToOpen = $configuration[0] - if ($runtimeConfiguration) { - $configToOpen = $runtimeConfiguration - } $vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "artifacts\obj\coreclr" | Join-Path -ChildPath "windows.$archToOpen.$((Get-Culture).TextInfo.ToTitleCase($configToOpen))" | Join-Path -ChildPath "ide" | Join-Path -ChildPath "CoreCLR.sln" if (-Not (Test-Path $vs)) { - $repoRoot = Split-Path $PSScriptRoot -Parent Invoke-Expression "& `"$repoRoot/src/coreclr/build-runtime.cmd`" -configureonly -$archToOpen -$configToOpen -msbuild" if ($lastExitCode -ne 0) { Write-Error "Failed to generate the CoreCLR solution file." @@ -148,6 +149,19 @@ if ($vs) { } } } + elseif ($vs -ieq "corehost.sln") { + $vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "artifacts\obj\" | Join-Path -ChildPath "win-$archToOpen.$((Get-Culture).TextInfo.ToTitleCase($configToOpen))" | Join-Path -ChildPath "corehost" | Join-Path -ChildPath "ide" | Join-Path -ChildPath "corehost.sln" + if (-Not (Test-Path $vs)) { + Invoke-Expression "& `"$repoRoot/eng/common/msbuild.ps1`" $repoRoot/src/native/corehost/corehost.proj /clp:nosummary /restore /p:Ninja=false" + if ($lastExitCode -ne 0) { + Write-Error "Failed to generate the CoreHost solution file." + exit 1 + } + if (-Not (Test-Path $vs)) { + Write-Error "Unable to find the CoreHost solution file at $vs." + } + } + } elseif (-Not (Test-Path $vs)) { $solution = $vs |