From 9687c68d177adde464216325b036c0499c2353d0 Mon Sep 17 00:00:00 2001 From: Adam Rehn Date: Fri, 8 Sep 2023 14:01:55 +1000 Subject: [PATCH] 5.3.0 compat: build Editor target for first-run setup --- .../dockerfiles/ue4-minimal/linux/Dockerfile | 4 +++- .../ue4-minimal/linux/print-editor-target.py | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/ue4docker/dockerfiles/ue4-minimal/linux/print-editor-target.py diff --git a/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile b/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile index bda41250..2a752787 100644 --- a/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile +++ b/src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile @@ -97,7 +97,9 @@ LABEL com.adamrehn.ue4-docker.excluded.templates={% if excluded_components.templ # Perform first-run setup for Mono, UnrealBuildTool and AutomationTool, which makes it possible to build Unreal projects and plugins as users other than `ue4` # (Note that this will only work with 4.26.0 and newer, older Engine versions will always require write access to `/home/ue4/UnrealEngine`) # See the comments on this issue for details, including the need to ensure $HOME is set correctly: -RUN ./Engine/Build/BatchFiles/Linux/Build.sh ShaderCompileWorker Linux Development -SkipBuild && \ +COPY print-editor-target.py /tmp/print-editor-target.py +RUN EDITOR_TARGET=$(python3 /tmp/print-editor-target.py /home/ue4/UnrealEngine) && \ + ./Engine/Build/BatchFiles/Linux/Build.sh "$EDITOR_TARGET" Linux Development -SkipBuild && \ mkdir -p ./Engine/Programs/AutomationTool/Saved && \ chmod a+rw ./Engine/Programs/AutomationTool/Saved diff --git a/src/ue4docker/dockerfiles/ue4-minimal/linux/print-editor-target.py b/src/ue4docker/dockerfiles/ue4-minimal/linux/print-editor-target.py new file mode 100644 index 00000000..d1619bf3 --- /dev/null +++ b/src/ue4docker/dockerfiles/ue4-minimal/linux/print-editor-target.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python3 +from pathlib import Path +import json, sys + +# Parse the Unreal Engine version information +engineRoot = Path(sys.argv[1]) +versionFile = engineRoot / "Engine" / "Build" / "Build.version" +versionDetails = json.loads(versionFile.read_text("utf-8")) + +# Determine the name of the Editor target based on the version +target = "UE4Editor" if versionDetails["MajorVersion"] == 4 else "UnrealEditor" +print(target)