30 lines
581 B
PowerShell
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"
|
|
} |