Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: mojo/public/tools/bindings/mojom_bindings_generator.py

Issue 2747653002: Use depfiles for mojom generation. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/tools/bindings/mojom.gni ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/mojom_bindings_generator.py
diff --git a/mojo/public/tools/bindings/mojom_bindings_generator.py b/mojo/public/tools/bindings/mojom_bindings_generator.py
index 78af6499de564493eedd164e091d74b3cd0f428c..3a0b6fc87e25f23febb0e6ff049728f6013fcb42 100755
--- a/mojo/public/tools/bindings/mojom_bindings_generator.py
+++ b/mojo/public/tools/bindings/mojom_bindings_generator.py
@@ -236,6 +236,12 @@ def _Generate(args, remaining_args):
processor.LoadTypemaps(set(args.typemaps))
for filename in args.filename:
processor.ProcessFile(args, remaining_args, generator_modules, filename)
+ if args.depfile:
+ assert args.depfile_target
+ with open(args.depfile, 'w') as f:
+ f.write('%s: %s' % (
+ args.depfile_target,
+ ' '.join(processor._parsed_files.keys())))
return 0
@@ -302,6 +308,12 @@ def main():
generate_parser.add_argument(
"--generate_non_variant_code", action="store_true",
help="Generate code that is shared by different variants.")
+ generate_parser.add_argument(
+ "--depfile", type=str,
+ help="A file into which the list of input files will be written.")
+ generate_parser.add_argument(
+ "--depfile_target", type=str,
+ help="The target name to use in the depfile.")
generate_parser.set_defaults(func=_Generate)
precompile_parser = subparsers.add_parser("precompile",
« no previous file with comments | « mojo/public/tools/bindings/mojom.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698