Index: mojo/public/tools/bindings/mojom.gni |
diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni |
index 61f43e59a3055f52800fce60353c85a02bcf790e..9cd72173a0aa9d7fc8728028eb34f96aa8e42b72 100644 |
--- a/mojo/public/tools/bindings/mojom.gni |
+++ b/mojo/public/tools/bindings/mojom.gni |
@@ -2,6 +2,29 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+mojom_generator_root = "//mojo/public/tools/bindings" |
+mojom_generator_script = "$mojom_generator_root/mojom_bindings_generator.py" |
+mojom_generator_sources = [ |
+ "$mojom_generator_root/generators/mojom_cpp_generator.py", |
+ "$mojom_generator_root/generators/mojom_js_generator.py", |
+ "$mojom_generator_root/generators/mojom_java_generator.py", |
+ "$mojom_generator_root/pylib/mojom/__init__.py", |
+ "$mojom_generator_root/pylib/mojom/error.py", |
+ "$mojom_generator_root/pylib/mojom/generate/__init__.py", |
+ "$mojom_generator_root/pylib/mojom/generate/constant_resolver.py", |
+ "$mojom_generator_root/pylib/mojom/generate/data.py", |
+ "$mojom_generator_root/pylib/mojom/generate/generator.py", |
+ "$mojom_generator_root/pylib/mojom/generate/module.py", |
+ "$mojom_generator_root/pylib/mojom/generate/pack.py", |
+ "$mojom_generator_root/pylib/mojom/generate/template_expander.py", |
+ "$mojom_generator_root/pylib/mojom/parse/__init__.py", |
+ "$mojom_generator_root/pylib/mojom/parse/ast.py", |
+ "$mojom_generator_root/pylib/mojom/parse/lexer.py", |
+ "$mojom_generator_root/pylib/mojom/parse/parser.py", |
+ "$mojom_generator_root/pylib/mojom/parse/translate.py", |
+ "$mojom_generator_script", |
+] |
+ |
# Generate C++/JavaScript/Java source files from mojom files. The output files |
# will go under the generated file directory tree with the same path as each |
# input file. |
@@ -44,71 +67,6 @@ template("mojom") { |
cpp_sources_suffix = "cpp_sources" |
cpp_sources_target_name = "${target_name}_${cpp_sources_suffix}" |
if (defined(invoker.sources)) { |
- generator_root = "//mojo/public/tools/bindings" |
- generator_script = "$generator_root/mojom_bindings_generator.py" |
- generator_sources = [ |
- generator_script, |
- "$generator_root/generators/cpp_templates/enum_macros.tmpl", |
- "$generator_root/generators/cpp_templates/interface_declaration.tmpl", |
- "$generator_root/generators/cpp_templates/interface_definition.tmpl", |
- "$generator_root/generators/cpp_templates/interface_macros.tmpl", |
- "$generator_root/generators/cpp_templates/interface_proxy_declaration.tmpl", |
- "$generator_root/generators/cpp_templates/interface_request_validator_declaration.tmpl", |
- "$generator_root/generators/cpp_templates/interface_response_validator_declaration.tmpl", |
- "$generator_root/generators/cpp_templates/interface_stub_declaration.tmpl", |
- "$generator_root/generators/cpp_templates/module-internal.h.tmpl", |
- "$generator_root/generators/cpp_templates/module.cc.tmpl", |
- "$generator_root/generators/cpp_templates/module.h.tmpl", |
- "$generator_root/generators/cpp_templates/struct_declaration.tmpl", |
- "$generator_root/generators/cpp_templates/struct_definition.tmpl", |
- "$generator_root/generators/cpp_templates/struct_macros.tmpl", |
- "$generator_root/generators/cpp_templates/struct_serialization_declaration.tmpl", |
- "$generator_root/generators/cpp_templates/struct_serialization_definition.tmpl", |
- "$generator_root/generators/cpp_templates/union_declaration.tmpl", |
- "$generator_root/generators/cpp_templates/union_definition.tmpl", |
- "$generator_root/generators/cpp_templates/union_serialization_declaration.tmpl", |
- "$generator_root/generators/cpp_templates/union_serialization_definition.tmpl", |
- "$generator_root/generators/cpp_templates/validation_macros.tmpl", |
- "$generator_root/generators/cpp_templates/wrapper_class_declaration.tmpl", |
- "$generator_root/generators/cpp_templates/wrapper_class_definition.tmpl", |
- "$generator_root/generators/cpp_templates/wrapper_union_class_declaration.tmpl", |
- "$generator_root/generators/cpp_templates/wrapper_union_class_definition.tmpl", |
- "$generator_root/generators/java_templates/constant_definition.tmpl", |
- "$generator_root/generators/java_templates/constants.java.tmpl", |
- "$generator_root/generators/java_templates/data_types_definition.tmpl", |
- "$generator_root/generators/java_templates/enum_definition.tmpl", |
- "$generator_root/generators/java_templates/enum.java.tmpl", |
- "$generator_root/generators/java_templates/header.java.tmpl", |
- "$generator_root/generators/java_templates/interface_definition.tmpl", |
- "$generator_root/generators/java_templates/interface_internal.java.tmpl", |
- "$generator_root/generators/java_templates/interface.java.tmpl", |
- "$generator_root/generators/java_templates/struct.java.tmpl", |
- "$generator_root/generators/java_templates/union.java.tmpl", |
- "$generator_root/generators/js_templates/enum_definition.tmpl", |
- "$generator_root/generators/js_templates/interface_definition.tmpl", |
- "$generator_root/generators/js_templates/module.amd.tmpl", |
- "$generator_root/generators/js_templates/module_definition.tmpl", |
- "$generator_root/generators/js_templates/struct_definition.tmpl", |
- "$generator_root/generators/js_templates/union_definition.tmpl", |
- "$generator_root/generators/js_templates/validation_macros.tmpl", |
- "$generator_root/generators/mojom_cpp_generator.py", |
- "$generator_root/generators/mojom_js_generator.py", |
- "$generator_root/generators/mojom_java_generator.py", |
- "$generator_root/pylib/mojom/__init__.py", |
- "$generator_root/pylib/mojom/error.py", |
- "$generator_root/pylib/mojom/generate/__init__.py", |
- "$generator_root/pylib/mojom/generate/constant_resolver.py", |
- "$generator_root/pylib/mojom/generate/data.py", |
- "$generator_root/pylib/mojom/generate/generator.py", |
- "$generator_root/pylib/mojom/generate/module.py", |
- "$generator_root/pylib/mojom/generate/pack.py", |
- "$generator_root/pylib/mojom/generate/template_expander.py", |
- "$generator_root/pylib/mojom/parse/__init__.py", |
- "$generator_root/pylib/mojom/parse/ast.py", |
- "$generator_root/pylib/mojom/parse/lexer.py", |
- "$generator_root/pylib/mojom/parse/parser.py", |
- "$generator_root/pylib/mojom/parse/translate.py", |
- ] |
if (defined(invoker.variant)) { |
variant = invoker.variant |
generator_cpp_outputs = [ |
@@ -134,20 +92,26 @@ template("mojom") { |
if (defined(invoker.sources)) { |
generator_target_name = target_name + "__generator" |
action_foreach(generator_target_name) { |
- script = generator_script |
- inputs = generator_sources |
+ script = mojom_generator_script |
+ inputs = mojom_generator_sources |
sources = invoker.sources |
+ deps = [ |
+ "//mojo/public/tools/bindings:precompile_templates", |
+ ] |
outputs = |
generator_cpp_outputs + generator_java_outputs + generator_js_outputs |
args = [ |
- "{{source}}", |
"--use_bundled_pylibs", |
+ "generate", |
+ "{{source}}", |
"-d", |
rebase_path("//", root_build_dir), |
"-I", |
rebase_path("//", root_build_dir), |
"-o", |
rebase_path(root_gen_dir), |
+ "--bytecode_path", |
+ rebase_path("$root_gen_dir/mojo/public/tools/bindings"), |
] |
if (defined(invoker.import_dirs)) { |