From ce99bc987e957370f57a4bd47b0587c3d60b572e Mon Sep 17 00:00:00 2001 From: puddly <32534428+puddly@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:16:04 -0400 Subject: [PATCH] Apply patch from @tl-sl --- tools/build_project.py | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/tools/build_project.py b/tools/build_project.py index 7da54683..29efad21 100755 --- a/tools/build_project.py +++ b/tools/build_project.py @@ -370,6 +370,23 @@ def main(): with (args.build_dir / "gbl_metadata.yaml").open("w") as f: yaml.dump(manifest["gbl"], f) + # JSON config + for json_config in manifest.get("json_config", []): + json_path = build_template_path / json_config["file"] + + result = subprocess.run( + [ + "jq", + json_config["jq"], + json_path, + ], + capture_output=True, + check=True, + ) + + with open(json_path, "wb") as f: + f.write(result.stdout) + # Next, generate a chip-specific project from the modified base project print(f"Generating project for {manifest['device']}") @@ -470,20 +487,6 @@ def main(): LOGGER.error("Defines were unused, aborting: %s", unused_defines) sys.exit(1) - # JSON config - for json_config in manifest.get("json_config", []): - json_path = args.build_dir / json_config["file"] - - subprocess.run( - [ - "jq", - json_config["jq"], - json_path, - json_path, - ], - check=True, - ) - # Fix Gecko SDK bugs sl_rail_util_pti_config_h = args.build_dir / "config/sl_rail_util_pti_config.h"