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

Side by Side Diff: mojo/public/tools/bindings/mojom.gni

Issue 674383002: Initial work on Dart bindings for Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Merge. Work on templates. Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # Generate C++ and JavaScript source files from mojom files. The output files 5 # Generate C++ and JavaScript source files from mojom files. The output files
6 # will go under the generated file directory tree with the same path as each 6 # will go under the generated file directory tree with the same path as each
7 # input file. 7 # input file.
8 # 8 #
9 # Parameters: 9 # Parameters:
10 # 10 #
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 "$generator_root/generators/java_templates/struct.java.tmpl", 58 "$generator_root/generators/java_templates/struct.java.tmpl",
59 "$generator_root/generators/java_templates/struct_definition.tmpl", 59 "$generator_root/generators/java_templates/struct_definition.tmpl",
60 "$generator_root/generators/js_templates/enum_definition.tmpl", 60 "$generator_root/generators/js_templates/enum_definition.tmpl",
61 "$generator_root/generators/js_templates/interface_definition.tmpl", 61 "$generator_root/generators/js_templates/interface_definition.tmpl",
62 "$generator_root/generators/js_templates/module.amd.tmpl", 62 "$generator_root/generators/js_templates/module.amd.tmpl",
63 "$generator_root/generators/js_templates/module.sky.tmpl", 63 "$generator_root/generators/js_templates/module.sky.tmpl",
64 "$generator_root/generators/js_templates/module_definition.tmpl", 64 "$generator_root/generators/js_templates/module_definition.tmpl",
65 "$generator_root/generators/js_templates/struct_definition.tmpl", 65 "$generator_root/generators/js_templates/struct_definition.tmpl",
66 "$generator_root/generators/python_templates/module_macros.tmpl", 66 "$generator_root/generators/python_templates/module_macros.tmpl",
67 "$generator_root/generators/python_templates/module.py.tmpl", 67 "$generator_root/generators/python_templates/module.py.tmpl",
68 "$generator_root/generators/dart_templates/module.lib.tmpl",
69 "$generator_root/generators/dart_templates/module_definition.tmpl",
70 "$generator_root/generators/dart_templates/enum_definition.tmpl",
71 "$generator_root/generators/dart_templates/struct_definition.tmpl",
72 "$generator_root/generators/dart_templates/interface_definition.tmpl",
68 "$generator_root/generators/mojom_cpp_generator.py", 73 "$generator_root/generators/mojom_cpp_generator.py",
69 "$generator_root/generators/mojom_js_generator.py", 74 "$generator_root/generators/mojom_js_generator.py",
70 "$generator_root/generators/mojom_java_generator.py", 75 "$generator_root/generators/mojom_java_generator.py",
71 "$generator_root/generators/mojom_python_generator.py", 76 "$generator_root/generators/mojom_python_generator.py",
77 "$generator_root/generators/mojom_dart_generator.py",
72 "$generator_root/pylib/mojom/__init__.py", 78 "$generator_root/pylib/mojom/__init__.py",
73 "$generator_root/pylib/mojom/error.py", 79 "$generator_root/pylib/mojom/error.py",
74 "$generator_root/pylib/mojom/generate/__init__.py", 80 "$generator_root/pylib/mojom/generate/__init__.py",
75 "$generator_root/pylib/mojom/generate/data.py", 81 "$generator_root/pylib/mojom/generate/data.py",
76 "$generator_root/pylib/mojom/generate/generator.py", 82 "$generator_root/pylib/mojom/generate/generator.py",
77 "$generator_root/pylib/mojom/generate/module.py", 83 "$generator_root/pylib/mojom/generate/module.py",
78 "$generator_root/pylib/mojom/generate/pack.py", 84 "$generator_root/pylib/mojom/generate/pack.py",
79 "$generator_root/pylib/mojom/generate/template_expander.py", 85 "$generator_root/pylib/mojom/generate/template_expander.py",
80 "$generator_root/pylib/mojom/parse/__init__.py", 86 "$generator_root/pylib/mojom/parse/__init__.py",
81 "$generator_root/pylib/mojom/parse/ast.py", 87 "$generator_root/pylib/mojom/parse/ast.py",
82 "$generator_root/pylib/mojom/parse/lexer.py", 88 "$generator_root/pylib/mojom/parse/lexer.py",
83 "$generator_root/pylib/mojom/parse/parser.py", 89 "$generator_root/pylib/mojom/parse/parser.py",
84 "$generator_root/pylib/mojom/parse/translate.py", 90 "$generator_root/pylib/mojom/parse/translate.py",
85 ] 91 ]
86 generator_cpp_outputs = [ 92 generator_cpp_outputs = [
87 "{{source_gen_dir}}/{{source_name_part}}.mojom.cc", 93 "{{source_gen_dir}}/{{source_name_part}}.mojom.cc",
88 "{{source_gen_dir}}/{{source_name_part}}.mojom.h", 94 "{{source_gen_dir}}/{{source_name_part}}.mojom.h",
89 "{{source_gen_dir}}/{{source_name_part}}.mojom-internal.h", 95 "{{source_gen_dir}}/{{source_name_part}}.mojom-internal.h",
90 ] 96 ]
91 generator_java_outputs = [ 97 generator_java_outputs = [
92 "{{source_gen_dir}}/{{source_name_part}}.mojom.srcjar", 98 "{{source_gen_dir}}/{{source_name_part}}.mojom.srcjar",
93 ] 99 ]
94 generator_js_outputs = [ 100 generator_js_outputs = [
95 "{{source_gen_dir}}/{{source_name_part}}.mojom.js", 101 "{{source_gen_dir}}/{{source_name_part}}.mojom.js",
96 ] 102 ]
97 generator_python_outputs = [ 103 generator_python_outputs = [
98 "{{source_gen_dir}}/{{source_name_part}}_mojom.py", 104 "{{source_gen_dir}}/{{source_name_part}}_mojom.py",
99 ] 105 ]
106 generator_dart_outputs = [
107 "{{source_gen_dir}}/{{source_name_part}}.mojom.dart",
108 ]
100 109
101 if (defined(invoker.visibility)) { 110 if (defined(invoker.visibility)) {
102 # Need to save this because the the target_name is overwritten inside the 111 # Need to save this because the the target_name is overwritten inside the
103 # action to be that of the action itself. Only define this in the case the 112 # action to be that of the action itself. Only define this in the case the
104 # var is used to avoid unused var error. 113 # var is used to avoid unused var error.
105 target_visibility = [ ":$target_name" ] 114 target_visibility = [ ":$target_name" ]
106 } 115 }
107 116
108 generator_target_name = target_name + "__generator" 117 generator_target_name = target_name + "__generator"
109 action_foreach(generator_target_name) { 118 action_foreach(generator_target_name) {
110 if (defined(invoker.visibility)) { 119 if (defined(invoker.visibility)) {
111 visibility = target_visibility + invoker.visibility 120 visibility = target_visibility + invoker.visibility
112 } 121 }
113 script = generator_script 122 script = generator_script
114 inputs = generator_sources 123 inputs = generator_sources
115 sources = invoker.sources 124 sources = invoker.sources
116 outputs = generator_cpp_outputs + 125 outputs = generator_cpp_outputs +
117 generator_java_outputs + 126 generator_java_outputs +
118 generator_js_outputs + 127 generator_js_outputs +
119 generator_python_outputs 128 generator_python_outputs +
129 generator_dart_outputs
120 args = [ 130 args = [
121 "{{source}}", 131 "{{source}}",
122 "--use_chromium_bundled_pylibs", 132 "--use_chromium_bundled_pylibs",
123 "-d", rebase_path("//", root_build_dir), 133 "-d", rebase_path("//", root_build_dir),
124 "-I", rebase_path("//", root_build_dir), 134 "-I", rebase_path("//", root_build_dir),
125 "-o", rebase_path(root_gen_dir), 135 "-o", rebase_path(root_gen_dir),
126 ] 136 ]
127 } 137 }
128 138
129 source_set(target_name) { 139 source_set(target_name) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 # //mojo/something:something and we can append "_java" to get the java 194 # //mojo/something:something and we can append "_java" to get the java
185 # dependency name. 195 # dependency name.
186 full_name = get_label_info(d, "label_no_toolchain") 196 full_name = get_label_info(d, "label_no_toolchain")
187 deps += [ "${full_name}_java" ] 197 deps += [ "${full_name}_java" ]
188 } 198 }
189 199
190 srcjars = process_file_template(invoker.sources, generator_java_outputs) 200 srcjars = process_file_template(invoker.sources, generator_java_outputs)
191 } 201 }
192 } 202 }
193 } 203 }
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/generators/mojom_dart_generator.py ('k') | mojo/public/tools/bindings/mojom_bindings_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698