[CmdletBinding()]
param([string]$SevenZip, [switch]$SkipDownloads, [switch]$Build, [string]$PythonPath='python')
$ErrorActionPreference = 'Stop'
$projectRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
$pinnedSdk = (Get-Content -LiteralPath (Join-Path $projectRoot 'global.json') -Raw -Encoding UTF8 | ConvertFrom-Json).sdk.version
if (!(Get-Command dotnet -ErrorAction SilentlyContinue)) { throw ('Install the .NET SDK ' + $pinnedSdk + ' before bootstrapping.') }
$sdkInventory = & dotnet --list-sdks
if ($LASTEXITCODE -ne 0 -or !($sdkInventory -match ('^' + [regex]::Escape($pinnedSdk) + '\s'))) { throw ('The pinned .NET SDK is required: ' + $pinnedSdk) }
if (!$SkipDownloads) {
& (Join-Path $projectRoot 'scripts/fetch-deps.ps1') -SevenZip $SevenZip
}
if ($Build) {
& (Join-Path $PSScriptRoot 'CSharpBoot/BuildBootShim.ps1')
& (Join-Path $PSScriptRoot 'CSharpBoot/BuildKernel.ps1') -PythonPath $PythonPath
}
Write-Host 'C# prerequisites checked. No Rust toolchain, host installer or physical disk operation was run.'
[CmdletBinding()]
param([string]$SevenZip, [switch]$SkipDownloads, [switch]$Build, [string]$PythonPath='python')
$ErrorActionPreference = 'Stop'
$projectRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
$pinnedSdk = (Get-Content -LiteralPath (Join-Path $projectRoot 'global.json') -Raw -Encoding UTF8 | ConvertFrom-Json).sdk.version
if (!(Get-Command dotnet -ErrorAction SilentlyContinue)) { throw ('Install the .NET SDK ' + $pinnedSdk + ' before bootstrapping.') }
$sdkInventory = & dotnet --list-sdks
if ($LASTEXITCODE -ne 0 -or !($sdkInventory -match ('^' + [regex]::Escape($pinnedSdk) + '\s'))) { throw ('The pinned .NET SDK is required: ' + $pinnedSdk) }
if (!$SkipDownloads) {
& (Join-Path $projectRoot 'scripts/fetch-deps.ps1') -SevenZip $SevenZip
}
if ($Build) {
& (Join-Path $PSScriptRoot 'CSharpBoot/BuildBootShim.ps1')
& (Join-Path $PSScriptRoot 'CSharpBoot/BuildKernel.ps1') -PythonPath $PythonPath
}
Write-Host 'C# prerequisites checked. No Rust toolchain, host installer or physical disk operation was run.'