# Build the local headless executor EXE with PyInstaller (P4-M3). # All strings ASCII only. Generated artifacts (build/, dist/, *.spec) are # NOT committed (see AGENTS.md "generated artifacts not in repo"). $ErrorActionPreference = "Stop" $Root = Split-Path -Parent $PSScriptRoot # $Src = Join-Path $Root "src" $Scripts = Join-Path $Root "scripts" $Entry = Join-Path $Scripts "run_task_executor.py" Write-Host "Root: $Root" Write-Host "Entry: $Entry" if (-not (Test-Path $Entry)) { Write-Error "Entry point not found: $Entry" } # --collect-all ansys.motorcad pulls the pymotorcad package (COM type libs) # which PyInstaller cannot fully infer statically. pyinstaller --noconfirm --clean --onefile ` --name "PCB-AFM-Executor" ` --paths $Src --paths $Root ` --hidden-import ansys.motorcad.core ` --collect-all ansys.motorcad ` $Entry Write-Host "Build done. Artifact:" Write-Host " $Root\dist\PCB-AFM-Executor.exe"