-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.ps1
More file actions
65 lines (56 loc) · 1.98 KB
/
Copy pathsetup.ps1
File metadata and controls
65 lines (56 loc) · 1.98 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
param([switch]$Clean)
$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
if (-not (Test-Path "local.props")) {
Write-Host "ERROR: local.props not found. Copy local.props.example to local.props." -ForegroundColor Red
exit 1
}
if ($Clean) {
Remove-Item -Recurse -Force .godot -ErrorAction SilentlyContinue
Write-Host "Cleaned .godot"
}
Write-Host "=== Generating images (ImageGen) ==="
dotnet run --project ImageGen/ImageGen.csproj
if ($LASTEXITCODE -ne 0) { throw "ImageGen failed" }
Write-Host "=== Building Downfall ==="
dotnet build Downfall.csproj --nologo -v q
if ($LASTEXITCODE -ne 0) {
Write-Host "Retrying Downfall (cold publicizer cache)..." -ForegroundColor Yellow
dotnet build Downfall.csproj --nologo -v q
if ($LASTEXITCODE -ne 0) { throw "Downfall build failed" }
}
$pubDir = ".godot\mono\temp\obj\Debug\PublicizedAssemblies"
$sts2Pub = Get-ChildItem -Path $pubDir -Recurse -Filter "sts2.dll" -ErrorAction SilentlyContinue | Select-Object -First 1
if (-not $sts2Pub) { throw "Publicized sts2.dll not found" }
Write-Host "Publicized assemblies ready"
$mods = @(
"Automaton", "Awakened", "Champ", "Collector", "Gremlins",
"Guardian", "Hexaghost", "Hermit", "SlimeBoss", "Snecko"
)
$failed = @()
foreach ($mod in $mods) {
Write-Host "=== Building $mod ==="
$ok = $false
for ($retry = 0; $retry -lt 10; $retry++) {
dotnet build "$mod.csproj" --nologo -v q
if ($LASTEXITCODE -eq 0) {
$ok = $true
break
}
if ($retry -lt 2) {
Write-Host " Retry $($retry + 1)/10..." -ForegroundColor Yellow
}
}
if ($ok) {
Write-Host " OK" -ForegroundColor Green
} else {
$failed += $mod
Write-Host " FAILED after 3 attempts" -ForegroundColor Red
}
}
if ($failed.Count -eq 0) {
Write-Host "`nALL $($mods.Count) MODS BUILT SUCCESSFULLY" -ForegroundColor Green
} else {
Write-Host "`nFAILED: $($failed -join ', ')" -ForegroundColor Red
exit 1
}