Run json validation as part of the build
We previously ran this as part of the CI, but on more than one
occasion, I've seen engineers get tripped up with missing commas, or
other json things. Given the long time it takes to burn and flash the
BMC, it wastes engineers time to not run this during the build.
Tested: bitbake entity-manager succeed. Changed file in devtooled
environment and it failed the validator.
Requires https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/49848 to
build.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I65fc5511f11b4235c314a7b875e4a95167e95fff
diff --git a/meson.build b/meson.build
index 7cd6510..2869434 100644
--- a/meson.build
+++ b/meson.build
@@ -138,17 +138,33 @@
'Tyan_S7106_Baseboard.json',
'WFT Baseboard.json',
]
-
+filepaths = []
foreach c : configs
+ file = join_paths('configurations', c)
install_data(
- join_paths('configurations', c),
+ file,
install_dir: join_paths(
packagedir,
'configurations',
)
)
+ filepaths += [file]
endforeach
+validate_script = files('scripts/validate-configs.py')
+autojson = custom_target(
+ 'check_syntax',
+ command: [
+ validate_script,
+ '-v',
+ '-k',
+ ],
+ depend_files: files(filepaths),
+ build_by_default: true,
+ capture: true,
+ output: 'validate_configs.log',
+)
+
schemas = [
'global.json',
'legacy.json',