Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions utils/generate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,31 @@ New-Item -ItemType Directory -Force -Path "output/generated/" | Out-Null

dotnet build utils/SkiaSharpGenerator/SkiaSharpGenerator.csproj

$failed = $false
foreach ($proj in $projects) {
$json = $proj.Json;
$output = $proj.Output;
$root = $proj.Root;
$filename = Split-Path $output -Leaf

$cmd = "dotnet run --no-build --no-launch-profile --project=utils/SkiaSharpGenerator/SkiaSharpGenerator.csproj -- generate --config binding/$json --root $root --output binding/$output"
Write-Host $cmd
Invoke-Expression $cmd
if (!$?) {
exit $LASTEXITCODE
$runArgs = @("run", "--no-build", "--no-launch-profile",
"--project=utils/SkiaSharpGenerator/SkiaSharpGenerator.csproj",
"--", "generate",
"--config", "binding/$json",
"--root", $root,
"--output", "binding/$output")
Write-Host "dotnet $($runArgs -join ' ')"
& dotnet @runArgs
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Generation failed for $json with exit code $LASTEXITCODE"
$failed = $true
continue
}

Copy-Item -Path binding/$output -Destination output/generated/$filename -Force
}

if ($failed) {
Write-Host "ERROR: One or more generation steps failed"
exit 1
}
Loading