Lots of work on lua call interface, also improved makefiles
This commit is contained in:
@@ -140,109 +140,154 @@ shell(UNREALENGINE, f"{UNREALENGINE}/Setup.{BAT}")
|
||||
|
||||
#
|
||||
# Use UnrealBuildTool to generate a rough draft of Integration.code-workspace.
|
||||
# We're not going to use it, but we set it aside as a reference that you can
|
||||
# study to make changes to this script.
|
||||
#
|
||||
|
||||
Path(f"{INTEGRATION}/Integration.code-workspace").unlink(missing_ok=True)
|
||||
Path(f"{INTEGRATION}/Integration.code-workspace.old").unlink(missing_ok=True)
|
||||
shell(INTEGRATION, f'{UNREALENGINE}/GenerateProjectFiles.{BAT} -projectfiles -project="{INTEGRATION}/Integration.uproject" -game')
|
||||
Path(f"{INTEGRATION}/Integration.code-workspace").rename(f"{INTEGRATION}/Integration.code-workspace.old")
|
||||
|
||||
#
|
||||
# Load the rough Integration.code-workspace into RAM, then delete the rough draft.
|
||||
# Create a trivial makefile that calls into the unreal build system.
|
||||
#
|
||||
|
||||
with open(f"{INTEGRATION}/Integration.code-workspace") as original:
|
||||
WORKSPACE=json.load(original)
|
||||
Path(f"{INTEGRATION}/Integration.code-workspace").unlink()
|
||||
writefile(f"{INTEGRATION}/Makefile", f"""
|
||||
# This makefile just invokes the unreal build system, then the luprex build system.
|
||||
|
||||
all:
|
||||
\t{UNREALENGINE}/Engine/Build/BatchFiles/Linux/Build.sh IntegrationEditor Linux DebugGame {INTEGRATION}/Integration.uproject -waitmutex
|
||||
\t(cd luprex ; make all)
|
||||
|
||||
clean:
|
||||
\t{UNREALENGINE}/Engine/Build/BatchFiles/Linux/Build.sh IntegrationEditor Linux DebugGame {INTEGRATION}/Integration.uproject -waitmutex -clean
|
||||
\t(cd luprex ; make clean)
|
||||
""")
|
||||
|
||||
#
|
||||
# Configure the correct build task as the default task.
|
||||
# Build our own Integration.code-workspace from scratch.
|
||||
#
|
||||
|
||||
for task in WORKSPACE["tasks"]["tasks"]:
|
||||
if task["label"] == f"IntegrationEditor {OS} DebugGame Build":
|
||||
task["group"] = { "kind": "build", "isDefault": True }
|
||||
WORKSPACE={}
|
||||
|
||||
#
|
||||
# Delete all build tasks that aren't relevant.
|
||||
#
|
||||
WORKSPACE["folders"] = []
|
||||
WORKSPACE["folders"].append({ "name": "Integration", "path": "." })
|
||||
WORKSPACE["folders"].append({ "name": "UE5", "path": UNREALENGINE })
|
||||
|
||||
def goodtask(task):
|
||||
return task["label"].startswith(f"IntegrationEditor {OS} DebugGame")
|
||||
WORKSPACE["settings"] = {}
|
||||
WORKSPACE["settings"]["typescript.tsc.autoDetect"] = "off"
|
||||
WORKSPACE["settings"]["lldb.dereferencePointers"] = False
|
||||
WORKSPACE["settings"]["npm.autoDetect"] = "off"
|
||||
|
||||
WORKSPACE["tasks"]["tasks"] = [x for x in WORKSPACE["tasks"]["tasks"] if goodtask(x)]
|
||||
|
||||
#
|
||||
# Add a build task for Luprex
|
||||
#
|
||||
|
||||
LUPREXBUILDTASK={}
|
||||
WORKSPACE["tasks"]["tasks"].append(LUPREXBUILDTASK)
|
||||
LUPREXBUILDTASK["label"] = "Build Luprex"
|
||||
LUPREXBUILDTASK["group"] = "build"
|
||||
LUPREXBUILDTASK["command"] = "make"
|
||||
LUPREXBUILDTASK["problemMatcher"] = "$msCompile"
|
||||
LUPREXBUILDTASK["type"] = "shell"
|
||||
LUPREXBUILDTASK["options"] = {}
|
||||
LUPREXBUILDTASK["options"]["cwd"] = f"{INTEGRATION}/luprex"
|
||||
|
||||
#
|
||||
# Add a presentation { clear=true } to all build tasks.
|
||||
#
|
||||
|
||||
for task in WORKSPACE["tasks"]["tasks"]:
|
||||
task["presentation"] = {}
|
||||
task["presentation"]["clear"] = True
|
||||
|
||||
#
|
||||
# Convert all launch configurations to lldb.
|
||||
#
|
||||
|
||||
LLDBINIT=[
|
||||
f'command script import {UNREALENGINE}/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py',
|
||||
f'settings set target.inline-breakpoint-strategy always',
|
||||
f'target stop-hook add --one-liner "p ::UngrabAllInputImpl()"',
|
||||
]
|
||||
|
||||
for config in WORKSPACE["launch"]["configurations"]:
|
||||
config["type"] = "lldb"
|
||||
config["initCommands"] = LLDBINIT
|
||||
config["args"] = [ f"{INTEGRATION}/Integration.uproject", f"-userdir=User/{USER}" ]
|
||||
config.pop("visualizerFile", None)
|
||||
config.pop("showDisplayString", None)
|
||||
|
||||
#
|
||||
# Delete all but the relevant launch configuration.
|
||||
#
|
||||
|
||||
def goodconf(config):
|
||||
return config["name"] == "Launch IntegrationEditor (DebugGame)"
|
||||
|
||||
WORKSPACE["launch"]["configurations"] = [x for x in WORKSPACE["launch"]["configurations"] if goodconf(x)]
|
||||
|
||||
#
|
||||
# Add some recommended extensions.
|
||||
#
|
||||
|
||||
EXTENSIONS=set(WORKSPACE["extensions"]["recommendations"])
|
||||
EXTENSIONS.add("ms-python.python")
|
||||
EXTENSIONS.add("vadimcn.vscode-lldb")
|
||||
WORKSPACE["extensions"]["recommendations"] = list(EXTENSIONS)
|
||||
|
||||
#
|
||||
# Tell vscode not to try watching all the UnrealEngine source code for modifications.
|
||||
# Attempting this overruns a Linux hardwired limit on file watches.
|
||||
#
|
||||
|
||||
WORKSPACE["settings"]["files.watcherExclude"] = {
|
||||
f'{UNREALENGINE}/Engine/**' : True,
|
||||
f'{UNREALENGINE}/Samples/**' : True,
|
||||
f'{UNREALENGINE}/Templates/**' : True
|
||||
WORKSPACE["settings"]["files.watcherExclude"] = {}
|
||||
WORKSPACE["settings"]["files.watcherExclude"]["/home/jyelon/UnrealEngine/Engine/**"] = True
|
||||
WORKSPACE["settings"]["files.watcherExclude"]["/home/jyelon/UnrealEngine/Samples/**"] = True
|
||||
WORKSPACE["settings"]["files.watcherExclude"]["/home/jyelon/UnrealEngine/Templates/**"] = True
|
||||
WORKSPACE["settings"]["files.associations"] = {
|
||||
"*.ipp": "cpp",
|
||||
"locale": "cpp",
|
||||
"random": "cpp",
|
||||
"queue": "cpp",
|
||||
"stack": "cpp",
|
||||
"__locale": "cpp",
|
||||
"functional": "cpp",
|
||||
"sstream": "cpp",
|
||||
"regex": "cpp",
|
||||
"*.inc": "cpp",
|
||||
"strstream": "cpp",
|
||||
"string_view": "cpp",
|
||||
"typeindex": "cpp",
|
||||
"typeinfo": "cpp",
|
||||
"scoped_allocator": "cpp",
|
||||
"array": "cpp",
|
||||
"hash_map": "cpp",
|
||||
"hash_set": "cpp",
|
||||
"bitset": "cpp",
|
||||
"slist": "cpp",
|
||||
"initializer_list": "cpp",
|
||||
"valarray": "cpp",
|
||||
"__hash_table": "cpp",
|
||||
"__split_buffer": "cpp",
|
||||
"__tree": "cpp",
|
||||
"deque": "cpp",
|
||||
"list": "cpp",
|
||||
"map": "cpp",
|
||||
"set": "cpp",
|
||||
"span": "cpp",
|
||||
"string": "cpp",
|
||||
"unordered_map": "cpp",
|
||||
"unordered_set": "cpp",
|
||||
"vector": "cpp",
|
||||
"ranges": "cpp",
|
||||
"utility": "cpp",
|
||||
"ratio": "cpp",
|
||||
"system_error": "cpp",
|
||||
"tuple": "cpp",
|
||||
"type_traits": "cpp",
|
||||
"__bit_reference": "cpp",
|
||||
"__node_handle": "cpp",
|
||||
"atomic": "cpp",
|
||||
"__memory": "cpp",
|
||||
"limits": "cpp",
|
||||
"optional": "cpp",
|
||||
"variant": "cpp"
|
||||
}
|
||||
|
||||
#
|
||||
# Tell the LLDB plugin not to dereference pointers. This is dumb behavior,
|
||||
# it dereferences "char *" and shows only the first character. Not dereferencing
|
||||
# the pointer shows the whole string.
|
||||
#
|
||||
WORKSPACE["settings"]["lldb.dereferencePointers"] = False
|
||||
WORKSPACE["extensions"] = {}
|
||||
WORKSPACE["extensions"]["recommendations"] = [
|
||||
"vadimcn.vscode-lldb",
|
||||
"dfarley1.file-picker",
|
||||
"ms-python.python",
|
||||
"ms-vscode.cpptools",
|
||||
"ms-dotnettools.csharp",
|
||||
"ms-vscode.mono-debug"
|
||||
]
|
||||
|
||||
|
||||
WORKSPACE["tasks"] = {}
|
||||
WORKSPACE["tasks"]["version"] = "2.0.0"
|
||||
WORKSPACE["tasks"]["tasks"] = []
|
||||
WORKSPACE["tasks"]["tasks"].append({
|
||||
"label": "Make All",
|
||||
"group": { "kind": "build", "isDefault": True },
|
||||
"command": "make all",
|
||||
"presentation" : { "clear" : True },
|
||||
"problemMatcher": "$msCompile",
|
||||
"type": "shell",
|
||||
})
|
||||
|
||||
WORKSPACE["tasks"]["tasks"].append({
|
||||
"label": "Make Clean",
|
||||
"group": "build",
|
||||
"command": "make clean",
|
||||
"presentation" : { "clear" : True },
|
||||
"problemMatcher": "$msCompile",
|
||||
"type": "shell",
|
||||
})
|
||||
|
||||
|
||||
WORKSPACE["launch"] = {}
|
||||
WORKSPACE["launch"]["version"] = "0.2.0"
|
||||
WORKSPACE["launch"]["configurations"] = []
|
||||
WORKSPACE["launch"]["configurations"].append({
|
||||
"name": "Launch Editor with Luprex",
|
||||
"request": "launch",
|
||||
"program": f"{UNREALENGINE}/Engine/Binaries/Linux/UnrealEditor-Linux-DebugGame",
|
||||
"preLaunchTask": "Make All",
|
||||
"args": [
|
||||
f"{INTEGRATION}/Integration.uproject",
|
||||
"-userdir=User/jyelon"
|
||||
],
|
||||
"cwd": UNREALENGINE,
|
||||
"type": "lldb",
|
||||
"initCommands": [
|
||||
f"command script import {UNREALENGINE}/Engine/Extras/LLDBDataFormatters/UEDataFormatters_2ByteChars.py",
|
||||
"settings set target.inline-breakpoint-strategy always",
|
||||
"target stop-hook add --one-liner \"p ::UngrabAllInputImpl()\""
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
#
|
||||
# Write Integration.code-workspace.
|
||||
|
||||
Reference in New Issue
Block a user