LuckyWorldV2/mac_build.sh

67 lines
2.1 KiB
Bash
Raw Normal View History

#!/bin/bash
# Get the user's home directory
USER_HOME="$HOME"
# Set up Unreal Engine paths
UE_ROOT="/Users/Shared/Epic Games/UE_5.5"
UE_EDITOR="$UE_ROOT/Engine/Binaries/Mac/UnrealEditor.app/Contents/MacOS/UnrealEditor"
UE_UAT="$UE_ROOT/Engine/Build/BatchFiles/RunUAT.command"
# Set up project paths
PROJECT_ROOT="$(pwd)"
PROJECT_FILE="$PROJECT_ROOT/LuckyWorldV2.uproject"
ARCHIVE_DIR="$PROJECT_ROOT/Builds"
2025-04-23 23:56:27 -05:00
# patch UE 5.5 https://github.com/EpicGames/UnrealEngine/pull/13132/commits/578ccdb82c78fbfcab8c1e3a21301893f22a9f64
PATCH_FILE_DST="$UE_ROOT/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Public/StateTreeExecutionContext.h"
# Backup the destination file before modifying
if [ ! -f "${PATCH_FILE_DST}.bak" ]; then cp "$PATCH_FILE_DST" "${PATCH_FILE_DST}.bak"; fi
# Fix line 227
sed -i '' '227s/.*$/\tEventQueue->template ForEachEvent<FStateTreeSharedEvent>(Function);/' "$PATCH_FILE_DST"
# Fix line 242
sed -i '' '242s/.*$/\tEventQueue->template ForEachEvent<FStateTreeSharedEvent>([Function](const FStateTreeSharedEvent& Event)/' "$PATCH_FILE_DST"
# Print confirmation
echo "Patched $PATCH_FILE_DST successfully"
rm -rf DerivedDataCache Intermediate Binaries Saved
"$UE_ROOT/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.sh" -project="$PROJECT_FILE" -game -engine
# Run the build command
"$UE_UAT" -ScriptsForProject="$PROJECT_FILE" Turnkey \
-command=VerifySdk \
-platform=Mac \
-UpdateIfNeeded \
-EditorIO \
-EditorIOPort=59484 \
-project="$PROJECT_FILE" \
BuildCookRun \
-nop4 \
-utf8output \
-cook \
-project="$PROJECT_FILE" \
-target=LuckyWorldV2 \
-unrealexe="$UE_EDITOR" \
-platform=Mac \
-installed \
-stage \
-archive \
-package \
-build \
-iterativecooking \
-pak \
-iostore \
-compressed \
-prereqs \
-archivedirectory="$ARCHIVE_DIR" \
-CrashReporter \
-clientconfig=Shipping \
# -nocompile \
# -nocompileuat \
# -nocompileeditor \
# -skipbuildeditor \
# enable these if you want to test build without pak and iostore (you're just testing the build)
# -skipiostore \
# -skippak \ (disable -pak and -iostore)