build_executable.ps1 953 B

12345678910111213141516171819202122232425262728
  1. # Build the local headless executor EXE with PyInstaller (P4-M3).
  2. # All strings ASCII only. Generated artifacts (build/, dist/, *.spec) are
  3. # NOT committed (see AGENTS.md "generated artifacts not in repo").
  4. $ErrorActionPreference = "Stop"
  5. $Root = Split-Path -Parent $PSScriptRoot # <repo>
  6. $Src = Join-Path $Root "src"
  7. $Scripts = Join-Path $Root "scripts"
  8. $Entry = Join-Path $Scripts "run_task_executor.py"
  9. Write-Host "Root: $Root"
  10. Write-Host "Entry: $Entry"
  11. if (-not (Test-Path $Entry)) {
  12. Write-Error "Entry point not found: $Entry"
  13. }
  14. # --collect-all ansys.motorcad pulls the pymotorcad package (COM type libs)
  15. # which PyInstaller cannot fully infer statically.
  16. pyinstaller --noconfirm --clean --onefile `
  17. --name "PCB-AFM-Executor" `
  18. --paths $Src --paths $Root `
  19. --hidden-import ansys.motorcad.core `
  20. --collect-all ansys.motorcad `
  21. $Entry
  22. Write-Host "Build done. Artifact:"
  23. Write-Host " $Root\dist\PCB-AFM-Executor.exe"