<# .SYNOPSIS Builds the full solution (and optionally the WebUI) with one version (scripts/Get-Version.ps1: X.Y.Z for a release, X.Y.Z.N between releases). .EXAMPLE ./scripts/Build.ps1 ./scripts/Build.ps1 -Configuration Release -IncludeWebUI #> [CmdletBinding()] param( [ValidateSet('Debug', 'Release')] [string]$Configuration = 'Release', [string]$Version, [switch]$IncludeWebUI ) $ErrorActionPreference = 'Stop' $repoRoot = Split-Path -Parent $PSScriptRoot $Version = & (Join-Path $PSScriptRoot 'Get-Version.ps1') -Version $Version $short = & (Join-Path $PSScriptRoot 'Get-Version.ps1') -Version $Version -Format Short Write-Host "Version: $Version" dotnet build (Join-Path $repoRoot 'ExecuteR.slnx') -c $Configuration --nologo "-p:UnifiedVersion=$Version" "-p:GitCommitShort=$short" if ($LASTEXITCODE -ne 0) { throw "dotnet build failed ($LASTEXITCODE)." } if ($IncludeWebUI) { Push-Location (Join-Path $repoRoot 'src/WebUI') try { if (-not (Test-Path 'node_modules')) { npm ci if ($LASTEXITCODE -ne 0) { throw "npm ci failed ($LASTEXITCODE)." } } $env:PUBLIC_BUILD_VERSION = $Version npm run build if ($LASTEXITCODE -ne 0) { throw "WebUI build failed ($LASTEXITCODE)." } } finally { Pop-Location } } Write-Host "Build complete ($Version)."