Monorepo for Aesthetic.Computer
aesthetic.computer
1# Build SpiderLily with automatic FMOD header fix
2$ErrorActionPreference = "Continue"
3
4$RunUAT = "C:\Program Files\Epic Games\UE_5.6\Engine\Build\BatchFiles\RunUAT.bat"
5$Project = "C:\Perforce\SpiderLily\SL_main\SpiderLily.uproject"
6$Output = "C:\Users\me\Desktop\SpiderLily-Build"
7
8Write-Host "Starting build..." -ForegroundColor Cyan
9
10& $RunUAT BuildCookRun -project="$Project" -platform=Win64 -clientconfig=Shipping -cook -build -stage -pak -archive -archivedirectory="$Output" -noP4 -utf8output -NoLiveCoding -nocompileeditor -iterate -IgnoreCookErrors -noshaderworker
11
12if ($LASTEXITCODE -ne 0) {
13 Write-Host "`nBuild failed! Checking for FMOD header bug..." -ForegroundColor Yellow
14
15 # Fix any corrupted FMOD gen files
16 $fmodFiles = Get-ChildItem -Path "C:\Perforce\SpiderLily\SL_main\Plugins\FMODStudio*\Intermediate\Build\Win64\UnrealGame\Inc" -Recurse -Filter "*.gen.cpp" | Where-Object { $_.Name -like "*CallbackHandler*" }
17
18 if ($fmodFiles) {
19 Write-Host "Found FMOD CallbackHandler files, applying fix..." -ForegroundColor Red
20
21 foreach ($file in $fmodFiles) {
22 # Remove read-only attribute
23 attrib -R $file.FullName
24
25 # Read and fix content
26 $content = Get-Content -Path $file.FullName -Raw
27 if ($content -match '"allbackHandler\.h"') {
28 $fixed = $content -replace '"allbackHandler\.h"', '"FMODCallbackHandler.h"'
29 Set-Content -Path $file.FullName -Value $fixed -NoNewline
30 Write-Host " Fixed: $($file.FullName)" -ForegroundColor Green
31 }
32 }
33
34 Write-Host "`nRetrying build..." -ForegroundColor Cyan
35
36 & $RunUAT BuildCookRun -project="$Project" -platform=Win64 -clientconfig=Shipping -cook -build -stage -pak -archive -archivedirectory="$Output" -noP4 -utf8output -NoLiveCoding -nocompileeditor -iterate -IgnoreCookErrors -noshaderworker
37
38 if ($LASTEXITCODE -eq 0) {
39 Write-Host "`nBuild SUCCESS after FMOD fix!" -ForegroundColor Green
40 } else {
41 Write-Host "`nBuild FAILED even after fix" -ForegroundColor Red
42 }
43 } else {
44 Write-Host "No FMOD CallbackHandler files found" -ForegroundColor Yellow
45 }
46} else {
47 Write-Host "`nBuild SUCCESS!" -ForegroundColor Green
48}