Skip to content

Commit

Permalink
5.3.0 compat: build Editor target for first-run setup
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrehn committed Sep 8, 2023
1 parent 5ccc0e0 commit 9687c68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://github.com/adamrehn/ue4-docker/issues/141>
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

Expand Down
12 changes: 12 additions & 0 deletions src/ue4docker/dockerfiles/ue4-minimal/linux/print-editor-target.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 9687c68

Please sign in to comment.