DevTools: Include module.json in build.gn presubmit check
Discovered a bug in check_gn.js, which is part of the presubmit check that
verifies all the devtools frontend files are included in devtools/BUILD.gn.
The bug prevents missing module.json files from being reported.
Output of running npm run check-gn
Before the fix:
DevTools BUILD.gn checker passed
After:
DevTools BUILD.gn checker detected errors!
There's an issue with: D:\chromium\src\third_party\blink\renderer\devtools\BUILD.gn
Missing file in BUILD.gn for all_devtools_files: "front_end\elements_test_runner\module.json",
Missing file in BUILD.gn for all_devtools_files: "front_end\persistence\module.json",
Missing file in BUILD.gn for all_devtools_files: "front_end\search\module.json",
Missing file in BUILD.gn for all_devtools_files: "front_end\services\module.json",
Missing file in BUILD.gn for all_devtools_files: "front_end\terminal\module.json",
Missing file in BUILD.gn for all_devtools_files: "front_end\worker_service\module.json",
I added these missing module.json files to BUILD.gn.
Change-Id: I05a72e353475af142c13f0644fd430361edfff72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1576409
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#653018}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 66c0e97960fed83511d320eded9f028e1cb678ad
diff --git a/scripts/check_gn.js b/scripts/check_gn.js
index cbf2f87..b3af5ae 100644
--- a/scripts/check_gn.js
+++ b/scripts/check_gn.js
@@ -88,7 +88,9 @@
const moduleJSON = require(moduleJSONPath);
const scripts = moduleJSON.scripts || [];
const resources = moduleJSON.resources || [];
- const files = scripts.concat(resources)
+ const files = ['module.json']
+ .concat(scripts)
+ .concat(resources)
.map(relativePathFromBuildGN)
.filter(file => excludedFiles.every(excludedFile => !file.includes(excludedFile)));
moduleFiles = moduleFiles.concat(files);