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

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
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..a458b0d57feb745cb58d608b6b58c559130afc23 100755
--- a/mojo/public/tools/bindings/mojom_bindings_generator_v2.py
+++ b/mojo/public/tools/bindings/mojom_bindings_generator_v2.py
@@ -87,6 +87,8 @@ def RunGenerators(serialized_file_graph, args, remaining_args):
# 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 +121,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)

Powered by Google App Engine
This is Rietveld 408576698