Improved build.py

This commit is contained in:
2025-06-11 19:10:14 -04:00
parent 5a81b2d8ae
commit 893c0acf93
2 changed files with 15 additions and 27 deletions

View File

@@ -59,40 +59,26 @@
}, },
"tasks": { "tasks": {
"version": "2.0.0", "version": "2.0.0",
"tasks": [ "tasks": {
{ "for-each" : [
"label": "build.py c++", { "CMD" : "python3 build.py c++", "DEFAULT":true },
{ "CMD" : "python3 build.py all", "DEFAULT":false },
{ "CMD" : "python3 build.py clean", "DEFAULT":false }
],
"body" : {
"label": "[CMD]",
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": "[DEFAULT]"
}, },
"command": "python3 build.py c++", "command": "[CMD]",
"presentation": {
"clear": true
},
"problemMatcher": "$msCompile",
"type": "shell"
},
{
"label": "build.py all",
"command": "python3 build.py all",
"presentation": {
"clear": true
},
"problemMatcher": "$msCompile",
"type": "shell"
},
{
"label": "build.py clean",
"group": "build",
"command": "python3 build.py clean",
"presentation": { "presentation": {
"clear": true "clear": true
}, },
"problemMatcher": "$msCompile", "problemMatcher": "$msCompile",
"type": "shell" "type": "shell"
} }
] }
}, },
"launch": { "launch": {
"version": "0.2.0", "version": "0.2.0",
@@ -105,7 +91,7 @@
"name": "Server=[SERVER]", "name": "Server=[SERVER]",
"request": "launch", "request": "launch",
"program": "[UNREALENGINE]/Engine/Binaries/Linux/UnrealEditor-Linux-DebugGame", "program": "[UNREALENGINE]/Engine/Binaries/Linux/UnrealEditor-Linux-DebugGame",
"preLaunchTask": "Make All", "preLaunchTask": "python3 build.py c++",
"args": [ "args": [
"[INTEGRATION]/Integration.uproject", "[INTEGRATION]/Integration.uproject",
"-userdir=User/[USER]", "-userdir=User/[USER]",

View File

@@ -84,7 +84,9 @@ def expand_json(data, vars):
elif isinstance(data, list): elif isinstance(data, list):
return [ expand_json(item, vars) for item in data ] return [ expand_json(item, vars) for item in data ]
elif isinstance(data, str): elif isinstance(data, str):
return JSON_VAR_REGEX.sub(lambda m: str(vars.get(m.group(1), m.group(0))), data) full = JSON_VAR_REGEX.fullmatch(data)
if full: return vars.get(full.group(1), data)
else: return JSON_VAR_REGEX.sub(lambda m: str(vars.get(m.group(1), m.group(0))), data)
else: else:
return data return data