| 1 | #Requires -Version 5.1 |
| 2 | param( |
| 3 | [switch]$SkipTests |
| 4 | ) |
| 5 | |
| 6 | $ErrorActionPreference = "Stop" |
| 7 | $Root = Split-Path -Parent $PSScriptRoot |
| 8 | Set-Location $Root |
| 9 | |
| 10 | Write-Host "Building posprint for Windows (x64)..." |
| 11 | |
| 12 | if (-not $SkipTests) { |
| 13 | cargo test |
| 14 | if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } |
| 15 | } |
| 16 | |
| 17 | cargo build --release |
| 18 | if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } |
| 19 | |
| 20 | $exe = Join-Path $Root "target\release\posprint.exe" |
| 21 | if (-not (Test-Path $exe)) { |
| 22 | Write-Error "Build failed: $exe not found" |
| 23 | } |
| 24 | |
| 25 | Write-Host "OK: $exe" |
| 26 | Get-Item $exe | Select-Object FullName, Length, LastWriteTime |