diff --git a/init-tools.ps1 b/init-tools.ps1 index 250505650..b68837bdb 100644 --- a/init-tools.ps1 +++ b/init-tools.ps1 @@ -8,33 +8,8 @@ param( $RepoRoot = "$PSScriptRoot" -# Load Branch Info -cat "$RepoRoot\branchinfo.txt" | ForEach-Object { - if(!$_.StartsWith("#") -and ![String]::IsNullOrWhiteSpace($_)) { - $splat = $_.Split([char[]]@("="), 2) - Set-Content "env:\$($splat[0])" -Value $splat[1] - } -} - -# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot -if (!$env:DOTNET_INSTALL_DIR) -{ - $env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\$Architecture" -} - -if (!(Test-Path $env:DOTNET_INSTALL_DIR)) -{ - mkdir $env:DOTNET_INSTALL_DIR | Out-Null -} - # Install a stage 0 Write-Host "Installing .NET Core CLI Stage 0 from branchinfo channel" & "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Channel $env:CHANNEL -Architecture $Architecture -Verbose -if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" } - -# Put the stage0 on the path -$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" - -# Disable first run since we want to control all package sources -$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 \ No newline at end of file +if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" } \ No newline at end of file diff --git a/run-build.ps1 b/run-build.ps1 index 07a620c3c..c64bf991d 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -34,8 +34,33 @@ else $env:DOTNET_BUILD_SKIP_PACKAGING=0 } +# Load Branch Info +cat "$RepoRoot\branchinfo.txt" | ForEach-Object { + if(!$_.StartsWith("#") -and ![String]::IsNullOrWhiteSpace($_)) { + $splat = $_.Split([char[]]@("="), 2) + Set-Content "env:\$($splat[0])" -Value $splat[1] + } +} + +# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot +if (!$env:DOTNET_INSTALL_DIR) +{ + $env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\$Architecture" +} + +if (!(Test-Path $env:DOTNET_INSTALL_DIR)) +{ + mkdir $env:DOTNET_INSTALL_DIR | Out-Null +} + & "$RepoRoot\init-tools.ps1" -Architecture $Architecture if($LASTEXITCODE -ne 0) { throw "Failed to install Init Tools" } +# Put the stage0 on the path +$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" + +# Disable first run since we want to control all package sources +$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + dotnet build3 build.proj /p:Architecture=$Architecture if($LASTEXITCODE -ne 0) { throw "Failed to build" } diff --git a/run-build.sh b/run-build.sh index d7e5cd3bf..2aff94d99 100755 --- a/run-build.sh +++ b/run-build.sh @@ -36,6 +36,10 @@ while [[ $# > 0 ]]; do # Allow CI to disable prereqs check since the CI has the pre-reqs but not ldconfig it seems export DOTNET_INSTALL_SKIP_PREREQS=1 ;; + --architecture) + ARCHITECTURE=$2 + shift + ;; --help) echo "Usage: $0 [--configuration ] [--targets ] [--skip-prereqs] [--nopackage] [--docker ] [--help]" echo ""