Files
unitytest/ci/Build-Unity.ps1
T
2026-06-22 22:57:36 +09:30

30 lines
581 B
PowerShell

param(
[Parameter(Mandatory)]
[string]$Target
)
$config = Get-Content ".\ci\toolchain.json" | ConvertFrom-Json
if (-not $config.targets.$Target) {
throw "Unknown target: $Target"
}
$t = $config.targets.$Target
$UnityExe = .\ci\Ensure-UnityToolchain.ps1
Write-Host "Building target: $Target"
Write-Host "Method: $($t.method)"
Write-Host "Output: $($t.outputPath)"
& $UnityExe `
-batchmode `
-nographics `
-quit `
-projectPath $PWD `
-executeMethod $t.method `
-logFile -
if ($LASTEXITCODE -ne 0) {
throw "Unity build failed: $Target"
}