-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcompile-all-examples.ps1
More file actions
39 lines (33 loc) · 1.05 KB
/
compile-all-examples.ps1
File metadata and controls
39 lines (33 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# compile-all-examples.ps1
# Build all example projects in the examples/ folder using lazbuild
# Usage: ./compile-all-examples.ps1 [lazbuild flags]
param(
[Parameter(ValueFromRemainingArguments=$true)]
[string[]]$LazbuildArgs
)
function Check-Lazbuild {
if (-not (Get-Command lazbuild -ErrorAction SilentlyContinue)) {
Write-Host "❌ Error: lazbuild not found in PATH. Please install Lazarus and ensure lazbuild is available." -ForegroundColor Red
exit 1
}
}
$examples = @(
'ColorDemo',
'ErrorHandlingDemo',
'LongRunningOpDemo',
'ProgressDemo',
'SimpleDemo',
'SubCommandDemo'
)
Check-Lazbuild
foreach ($ex in $examples) {
Write-Host "`n🔨 Building $ex ..." -ForegroundColor Cyan
lazbuild "examples/$ex/$ex.lpi" @LazbuildArgs
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ Build failed for $ex" -ForegroundColor Red
exit 1
} else {
Write-Host "✅ $ex built successfully." -ForegroundColor Green
}
}
Write-Host "`n🎉 All examples built successfully!" -ForegroundColor Green