build: stand alone from the OpenNest repo

Engines are moving out of OpenNest so they can be published on their own
and so OpenNest checkouts handed to a model for an engine-building run no
longer contain the competing engines. History for Engines/ (and the
pre-move root-level engine folders) was carried over with git filter-repo.

Engines now build against a sibling OpenNest clone via $(OpenNestRoot),
overridable with /p:OpenNestRoot, with a clear error when it is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
aj
2026-09-24 10:01:19 -04:00
co-authored by Claude Opus 5.5
parent fc9e46cad3
commit cfce484952
14 changed files with 335 additions and 39 deletions
+17 -10
View File
@@ -1,29 +1,36 @@
<#
.SYNOPSIS
Builds every plugin engine under Engines/ and deploys it to the benchmark.
Builds every plugin engine in this repo and deploys it to the OpenNest benchmark.
.DESCRIPTION
OpenNest.Benchmark loads plugin engines from an Engines/ folder next to its own
build output. This builds the benchmark plus each Engines/OpenNest.Engine.*/ project
(test subprojects are skipped) and copies each engine DLL into that folder.
build output. This builds the benchmark in the OpenNest checkout plus each
OpenNest.Engine.*/ project here (test subprojects are skipped) and copies each
engine DLL into that folder.
.EXAMPLE
./Engines/Build-Engines.ps1
./Engines/Build-Engines.ps1 -Engines Opus55,Terra -Configuration Debug
./Build-Engines.ps1
./Build-Engines.ps1 -Engines MyEngine -Configuration Debug
./Build-Engines.ps1 -OpenNestRoot D:/src/OpenNest
#>
param(
[string]$Configuration = 'Release',
# Engine names without the OpenNest.Engine. prefix; default is all of them.
[string[]]$Engines
[string[]]$Engines,
# OpenNest checkout to build against; defaults to a sibling clone (../OpenNest).
[string]$OpenNestRoot = (Join-Path (Split-Path $PSScriptRoot -Parent) 'OpenNest')
)
$ErrorActionPreference = 'Stop'
$repoRoot = Split-Path $PSScriptRoot -Parent
if (-not (Test-Path (Join-Path $OpenNestRoot 'OpenNest.Benchmark/OpenNest.Benchmark.csproj'))) {
throw "OpenNest checkout not found at '$OpenNestRoot'. Clone https://git.thecozycat.net/aj/OpenNest.git next to this repo or pass -OpenNestRoot."
}
$OpenNestRoot = (Resolve-Path $OpenNestRoot).Path
dotnet build (Join-Path $repoRoot 'OpenNest.Benchmark/OpenNest.Benchmark.csproj') -c $Configuration
dotnet build (Join-Path $OpenNestRoot 'OpenNest.Benchmark/OpenNest.Benchmark.csproj') -c $Configuration
if ($LASTEXITCODE -ne 0) { throw 'OpenNest.Benchmark build failed.' }
$deployDir = Join-Path $repoRoot "OpenNest.Benchmark/bin/$Configuration/net8.0/Engines"
$deployDir = Join-Path $OpenNestRoot "OpenNest.Benchmark/bin/$Configuration/net8.0/Engines"
New-Item -ItemType Directory -Force $deployDir | Out-Null
$projects = Get-ChildItem $PSScriptRoot -Directory -Filter 'OpenNest.Engine.*' |
@@ -31,7 +38,7 @@ $projects = Get-ChildItem $PSScriptRoot -Directory -Filter 'OpenNest.Engine.*' |
foreach ($dir in $projects) {
$csproj = Join-Path $dir.FullName "$($dir.Name).csproj"
dotnet build $csproj -c $Configuration
dotnet build $csproj -c $Configuration "-p:OpenNestRoot=$OpenNestRoot/"
if ($LASTEXITCODE -ne 0) { throw "$($dir.Name) build failed." }
$dll = Join-Path $dir.FullName "bin/$Configuration/net8.0/$($dir.Name).dll"