# Builds the CrossRelay gateway binary into bin/. # Usage: powershell -File scripts/build-gateway.ps1 [-GOOS windows|darwin|linux] [-GOARCH amd64|arm64] param( [string]$GOOS = "windows", [string]$GOARCH = "amd64" ) $ErrorActionPreference = "Stop" $repoRoot = Split-Path -Parent $PSScriptRoot $binDir = Join-Path $repoRoot "bin" New-Item -ItemType Directory -Force -Path $binDir | Out-Null $exe = if ($GOOS -eq "windows") { "gateway.exe" } else { "gateway" } $out = Join-Path $binDir "$GOOS-$GOARCH-$exe" $env:GOOS = $GOOS $env:GOARCH = $GOARCH go build -o $out ./cmd/gateway # Keep a stable name for the current platform so the Tauri app finds it. $stable = Join-Path $binDir $exe Copy-Item $out $stable -Force Write-Host "built $out (also $stable)"