| [CmdletBinding()] | |
| param() | |
| $ErrorActionPreference = "Stop" | |
| $Root = Resolve-Path (Join-Path $PSScriptRoot "..\..") | |
| if (!(Get-Command cargo -ErrorAction SilentlyContinue)) { throw "cargo not found. Install Rust toolchain." } | |
| Push-Location $Root | |
| cargo build --release | |
| New-Item -ItemType Directory -Force -Path "$Root\bin" | Out-Null | |
| Copy-Item "$Root\target\release\jackailocald.exe" "$Root\bin\jackailocald.exe" -Force -ErrorAction SilentlyContinue | |
| Copy-Item "$Root\target\release\jackailocald" "$Root\bin\jackailocald" -Force -ErrorAction SilentlyContinue | |
| if (Test-Path "$Root\bin\jackailocald.exe") { | |
| & (Join-Path $PSScriptRoot "Sign-Executables.ps1") -Path "$Root\bin\jackailocald.exe" | |
| } | |
| Pop-Location | |