build: simplify build pipeline a bit

This commit is contained in:
rr- 2021-10-19 16:56:11 +02:00
parent f871f298a7
commit 77e904e56d
No known key found for this signature in database
GPG key ID: CC65E6FD28CAE42A
6 changed files with 27 additions and 25 deletions

View file

@ -1,30 +0,0 @@
from pathlib import Path
import json
import pyjson5
SRC_DIR = Path(__file__).parent
REPO_DIR = SRC_DIR.parent
BUILD_DIR = REPO_DIR / "build"
def main() -> None:
gf = pyjson5.loads(
(REPO_DIR / "cfg/Tomb1Main_gameflow.json5").read_text(encoding="utf-8")
)
with (BUILD_DIR / "init.c").open("w") as handle:
print('#include "init.h"', file=handle)
print(file=handle)
print('#include "global/vars.h"', file=handle)
print(file=handle)
print("void T1MInit()", file=handle)
print("{", file=handle)
for key, value in gf["strings"].items():
print(
f" GF.strings[GS_{key}] = {json.dumps(value)};",
file=handle,
)
print("}", file=handle)
if __name__ == "__main__":
main()