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

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

Issue 1566203002: Only generate code for files that are specified, not their imports. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 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') | mojo/public/tools/bindings/run_code_generators.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/mojom_bindings_generator_v2.py
diff --git a/mojo/public/tools/bindings/mojom_bindings_generator_v2.py b/mojo/public/tools/bindings/mojom_bindings_generator_v2.py
index 5599c816166f1dcc76499e6e1884a3169057d215..fb0763142be2d574a6629e0ed207dbf3c6652363 100755
--- a/mojo/public/tools/bindings/mojom_bindings_generator_v2.py
+++ b/mojo/public/tools/bindings/mojom_bindings_generator_v2.py
@@ -83,10 +83,14 @@ def RunGenerators(serialized_file_graph, args, remaining_args):
for name, value in cmd_args.iteritems():
cmd.extend([name, value])
+ if args.no_gen_imports:
+ cmd.extend("--no-gen-imports")
# Some language-specific args may be found in remaining_args. See
# run_code_generators.py and look for GENERATOR_PREFIX for more information.
cmd.extend(remaining_args)
+ if not args.no_gen_imports:
+ cmd.extend(args.filename)
process = subprocess.Popen(cmd, stdin=subprocess.PIPE)
process.communicate(serialized_file_graph)
@@ -119,6 +123,11 @@ def main(argv):
parser.add_argument("-p", "--python-sdk-dir", dest="python_sdk_dir",
help="Location of the compiled python bindings",
default="")
+ parser.add_argument("--no-gen-imports", action="store_true",
+ help="Generate code only for the files that are "
+ "specified on the command line. By default, code "
+ "is generated for all specified files and their "
+ "transitive imports.")
(args, remaining_args) = parser.parse_known_args(argv)
serialized_file_graph = RunParser(args)
« no previous file with comments | « mojo/public/tools/bindings/mojom.gni ('k') | mojo/public/tools/bindings/run_code_generators.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698