Checking in Unreal Engine source. Also some work on LuprexServer
This commit is contained in:
43
build.py
43
build.py
@@ -10,7 +10,8 @@
|
||||
#
|
||||
|
||||
|
||||
import sys, os, json, shutil, subprocess, re, time, tarfile, itertools, hashlib
|
||||
import sys, os, json, shutil, subprocess, re, time, tarfile
|
||||
import itertools, hashlib, zipfile, fnmatch
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
|
||||
@@ -113,6 +114,12 @@ def autodetect_system_config():
|
||||
configuration settings. We haven't tested the Windows version.
|
||||
"""
|
||||
config = SimpleNamespace()
|
||||
# Make sure we're actually inside an integration repository.
|
||||
config.INTEGRATION = os.path.dirname(os.path.abspath(sys.argv[0]))
|
||||
if not Path(f"{config.INTEGRATION}/Source/Integration").is_dir():
|
||||
sys.exit(f"Integration repository is not valid: {config.INTEGRATION}")
|
||||
config.UNREALENGINE = os.path.join(config.INTEGRATION, "UnrealEngine")
|
||||
# Configure other parameters.
|
||||
if sys.platform == "windows":
|
||||
config.OS = "Windows"
|
||||
config.DLL = "dll"
|
||||
@@ -127,12 +134,6 @@ def autodetect_system_config():
|
||||
config.DOT_EXE = ""
|
||||
config.USER = os.environ["USER"]
|
||||
config.BUILD_BAT = "Linux/Build.sh"
|
||||
config.INTEGRATION = os.path.dirname(os.path.abspath(sys.argv[0]))
|
||||
config.UNREALENGINE = os.path.join(os.path.dirname(config.INTEGRATION), "UnrealEngine")
|
||||
test1 = Path(f"{config.INTEGRATION}/Source/Integration")
|
||||
test2 = Path(f"{config.UNREALENGINE}/Engine/Source/Editor")
|
||||
if not test1.is_dir(): sys.exit(f"Integration repository is not valid: {config.INTEGRATION}")
|
||||
if not test2.is_dir(): sys.exit(f"UnrealEngine repository is not valid: {config.UNREALENGINE}")
|
||||
return config
|
||||
|
||||
|
||||
@@ -154,21 +155,21 @@ def store_system_config_in_globals(config):
|
||||
# The actual build steps.
|
||||
#
|
||||
|
||||
def checkout_correct_unreal_engine_branch_and_apply_patch():
|
||||
def unzip_unreal_engine_and_apply_patch():
|
||||
"""
|
||||
Check out the correct branch, then apply a patch to the UnrealEngine
|
||||
source code. Patch application consists of two steps: first, checkout clean,
|
||||
unpatched versions of the files from git. Then, apply the patch to the clean code.
|
||||
Note: don't git-commit the patch in UnrealEngine. Instead,
|
||||
just let this script reapply this patch as necessary.
|
||||
Unzip the unreal engine source, then apply a patch.
|
||||
"""
|
||||
patch = Path(f"{INTEGRATION}/EnginePatches/EnginePatch")
|
||||
patch_lines = patch.read_text().splitlines()
|
||||
patched_files = [line[6:] for line in patch_lines if line.startswith("--- a/")]
|
||||
for file in patched_files:
|
||||
shell(UNREALENGINE, f"git show HEAD:{file} > {file}")
|
||||
shell(UNREALENGINE, f"git checkout 5.3.1-release")
|
||||
shell(UNREALENGINE, f"git apply {INTEGRATION}/EnginePatches/EnginePatch")
|
||||
# Find out the unreal version that we're using
|
||||
if not Path(UNREALENGINE).is_dir():
|
||||
zipfn = f"{INTEGRATION}/UnrealEngine.zip";
|
||||
with zipfile.ZipFile(zipfn, 'r') as z:
|
||||
version = z.namelist()[0].split('/')[0]
|
||||
if not fnmatch.fnmatch(version, 'UnrealEngine-*-release'):
|
||||
sys.exit("UnrealEngine.zip does not contain UnrealEngine-*-release")
|
||||
shell(INTEGRATION, f"rm -rf {version}")
|
||||
shell(INTEGRATION, f"unzip UnrealEngine.zip")
|
||||
shell(INTEGRATION, f"mv {version} UnrealEngine")
|
||||
shell(UNREALENGINE, f"patch -p1 < {INTEGRATION}/EnginePatches/EnginePatch")
|
||||
|
||||
|
||||
def generate_buildconfiguration_xml():
|
||||
@@ -303,7 +304,7 @@ if MODE == "experiment":
|
||||
build_intellisense_database_for_clangd()
|
||||
|
||||
if MODE == "all":
|
||||
checkout_correct_unreal_engine_branch_and_apply_patch()
|
||||
unzip_unreal_engine_and_apply_patch()
|
||||
generate_buildconfiguration_xml()
|
||||
generate_lpx_paths()
|
||||
generate_integration_uproject()
|
||||
|
||||
Reference in New Issue
Block a user