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

Side by Side Diff: Source/bindings/scripts/scripts.gni

Issue 680193003: IDL: Generate union type containers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 import("//third_party/WebKit/Source/bindings/core/v8/generated.gni") 5 import("//third_party/WebKit/Source/bindings/core/v8/generated.gni")
6 import("//third_party/WebKit/Source/bindings/modules/idl.gni") 6 import("//third_party/WebKit/Source/bindings/modules/idl.gni")
7 import("//third_party/WebKit/Source/bindings/modules/modules.gni") 7 import("//third_party/WebKit/Source/bindings/modules/modules.gni")
8 8
9 bindings_scripts_dir = get_path_info(".", "abspath") 9 bindings_scripts_dir = get_path_info(".", "abspath")
10 bindings_scripts_output_dir = "$root_gen_dir/blink/bindings/scripts" 10 bindings_scripts_output_dir = "$root_gen_dir/blink/bindings/scripts"
11 11
12 # Replacing <(DEPTH) with "/" makes paths like "<(DEPTH)/foo" absolute. 12 # Replacing <(DEPTH) with "/" makes paths like "<(DEPTH)/foo" absolute.
13 _gypi = exec_script( 13 _gypi = exec_script(
14 "//build/gypi_to_gn.py", 14 "//build/gypi_to_gn.py",
15 [ rebase_path("scripts.gypi"), 15 [ rebase_path("scripts.gypi"),
16 "--replace=<(DEPTH)=/" ], 16 "--replace=<(DEPTH)=/" ],
17 "scope", 17 "scope",
18 [ "scripts.gypi" ]) 18 [ "scripts.gypi" ])
19 19
20 jinja_module_files = get_path_info(_gypi.jinja_module_files, "abspath") 20 jinja_module_files = get_path_info(_gypi.jinja_module_files, "abspath")
21 idl_lexer_parser_files = get_path_info(_gypi.idl_lexer_parser_files, "abspath") 21 idl_lexer_parser_files = get_path_info(_gypi.idl_lexer_parser_files, "abspath")
22 idl_compiler_files = get_path_info(_gypi.idl_compiler_files, "abspath") 22 idl_compiler_files = get_path_info(_gypi.idl_compiler_files, "abspath")
23 23
24 # Calls the compute_interfaces_info_individual script. 24 # Calls the compute_interfaces_info_individual script.
25 # 25 #
26 # Parameters: 26 # Parameters:
27 # sources_static = list of IDL files to pass as inputs 27 # sources_static = list of IDL files to pass as inputs
28 # sources_generated = list of generated IDL files to pass as inputs 28 # sources_generated = list of generated IDL files to pass as inputs
29 # component_dir = name if subdirectory (one word, no slashes) of component. 29 # component_dir = name if subdirectory (one word, no slashes) of component.
30 # output_file = pickle file to write 30 # interfaces_info_file = output pickle file for interfaces info.
31 # component_wide_info_file = output pickle file for component wide info.
31 # deps = dependencies 32 # deps = dependencies
32 # 33 #
33 # FIXME: Note the static/generated split is for consistency with GYP. This 34 # FIXME: Note the static/generated split is for consistency with GYP. This
34 # split is not necessary in the GN build and could be combined into a single 35 # split is not necessary in the GN build and could be combined into a single
35 # "sources". 36 # "sources".
36 template("compute_interfaces_info_individual") { 37 template("compute_interfaces_info_individual") {
37 action(target_name) { 38 action(target_name) {
38 script = "$bindings_scripts_dir/compute_interfaces_info_individual.py" 39 script = "$bindings_scripts_dir/compute_interfaces_info_individual.py"
39 if (defined(invoker.visibility)) { 40 if (defined(invoker.visibility)) {
40 visibility = invoker.visibility 41 visibility = invoker.visibility
41 } 42 }
42 43
43 # Save static list to temp file to avoid blowing out command-line length 44 # Save static list to temp file to avoid blowing out command-line length
44 # limit. 45 # limit.
45 file_list = "$target_gen_dir/${target_name}_file_list.txt" 46 file_list = "$target_gen_dir/${target_name}_file_list.txt"
46 write_file(file_list, rebase_path(invoker.sources_static, root_build_dir)) 47 write_file(file_list, rebase_path(invoker.sources_static, root_build_dir))
47 48
48 inputs = [ 49 inputs = [
49 "$bindings_scripts_dir/utilities.py", 50 "$bindings_scripts_dir/utilities.py",
50 file_list, 51 file_list,
51 ] + invoker.sources_static + invoker.sources_generated 52 ] + invoker.sources_static + invoker.sources_generated
52 53
53 outputs = [ 54 outputs = [
54 invoker.output_file 55 invoker.interfaces_info_file,
56 invoker.component_wide_info_file,
55 ] 57 ]
56 58
57 args = [ 59 args = [
58 "--cache-directory", 60 "--cache-directory",
59 rebase_path(bindings_scripts_output_dir, root_build_dir), 61 rebase_path(bindings_scripts_output_dir, root_build_dir),
60 "--idl-files-list", rebase_path(file_list, root_build_dir), 62 "--idl-files-list", rebase_path(file_list, root_build_dir),
61 "--interfaces-info-file", 63 "--interfaces-info-file",
62 rebase_path(invoker.output_file, root_build_dir), 64 rebase_path(invoker.interfaces_info_file, root_build_dir),
65 "--component-info-file",
66 rebase_path(invoker.component_wide_info_file, root_build_dir),
63 "--write-file-only-if-changed=1", 67 "--write-file-only-if-changed=1",
64 "--", 68 "--",
65 ] + rebase_path(invoker.sources_generated, root_build_dir) 69 ] + rebase_path(invoker.sources_generated, root_build_dir)
66 70
67 deps = [ 71 deps = [
68 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables", 72 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables",
69 ] + invoker.deps 73 ] + invoker.deps
70 } 74 }
71 } 75 }
72 76
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 # http://crbug.com/358074 176 # http://crbug.com/358074
173 "//third_party/WebKit/Source/bindings/modules:interfaces_info", 177 "//third_party/WebKit/Source/bindings/modules:interfaces_info",
174 178
175 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables", 179 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables",
176 "//third_party/WebKit/Source/bindings/scripts:cached_jinja_templates", 180 "//third_party/WebKit/Source/bindings/scripts:cached_jinja_templates",
177 "//third_party/WebKit/Source/core:generated_testing_idls", 181 "//third_party/WebKit/Source/core:generated_testing_idls",
178 ] 182 ]
179 } 183 }
180 } 184 }
181 185
182 # Runs the idl_compiler to generate IDL dictionary impl files. 186 # Runs the idl_compiler to generate IDL dictionary and union impl files.
183 # 187 #
184 # Parameters: 188 # Parameters:
185 # sources = a list of IDL files to process 189 # sources = a list of IDL files to process
186 # outputs = a list of files to write to 190 # outputs = a list of files to write to
187 template("idl_dictionary") { 191 # output_dir = the directory to put the output files
188 output_dir = "$root_gen_dir/blink/" 192 # component_wide_info = a filename of pickle file which contains component
193 # wide information
194 # target_component = component to generate code for
195 template("idl_impl") {
196 dictionary_impl_output_dir = "$root_gen_dir/blink/"
189 197
190 action(target_name) { 198 action(target_name) {
191 script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py" 199 script = "//third_party/WebKit/Source/bindings/scripts/idl_compiler.py"
192 idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp" 200 idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp"
193 write_file(idl_files_list, rebase_path(invoker.sources, root_build_dir)) 201 write_file(idl_files_list, rebase_path(invoker.sources, root_build_dir))
194 202
195 inputs = [ idl_files_list ] + invoker.sources 203 inputs = [ idl_files_list ] + invoker.sources
196 outputs = invoker.outputs 204 outputs = invoker.outputs
197 205
198 args = [ 206 args = [
199 "--cache-dir", 207 "--cache-dir",
200 rebase_path(bindings_scripts_output_dir, root_build_dir), 208 rebase_path(bindings_scripts_output_dir, root_build_dir),
201 "--output-dir", 209 "--output-dir",
202 rebase_path(output_dir, root_build_dir), 210 rebase_path(invoker.output_dir, root_build_dir),
211 "--impl-output-dir",
212 rebase_path(dictionary_impl_output_dir, root_build_dir),
203 "--interfaces-info", 213 "--interfaces-info",
204 rebase_path("$bindings_modules_output_dir/InterfacesInfoModules.pickle", 214 rebase_path("$bindings_modules_output_dir/InterfacesInfoModules.pickle",
205 root_build_dir), 215 root_build_dir),
216 "--component-info",
217 rebase_path(invoker.component_wide_info, root_build_dir),
218 "--target-component",
219 invoker.target_component,
206 "--write-file-only-if-changed=1", 220 "--write-file-only-if-changed=1",
207 "--generate-dictionary-impl", 221 "--generate-impl",
208 rebase_path(idl_files_list, root_build_dir), 222 rebase_path(idl_files_list, root_build_dir),
209 ] 223 ]
210 224
211 deps = [ 225 deps = [
212 # FIXME: should be interfaces_info_core (w/o modules) 226 # FIXME: should be interfaces_info_core (w/o modules)
213 # http://crbug.com/358074 227 # http://crbug.com/358074
228 "//third_party/WebKit/Source/bindings/core:interfaces_info_individual_core ",
214 "//third_party/WebKit/Source/bindings/modules:interfaces_info", 229 "//third_party/WebKit/Source/bindings/modules:interfaces_info",
230 "//third_party/WebKit/Source/bindings/modules:interfaces_info_individual_m odules",
215 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables", 231 "//third_party/WebKit/Source/bindings/scripts:cached_lex_yacc_tables",
216 "//third_party/WebKit/Source/bindings/scripts:cached_jinja_templates", 232 "//third_party/WebKit/Source/bindings/scripts:cached_jinja_templates",
217 ] 233 ]
218 } 234 }
219 } 235 }
220 236
221 # Calls the aggregate_generated_bindings script. 237 # Calls the aggregate_generated_bindings script.
222 # 238 #
223 # Parameters: 239 # Parameters:
224 # sources = a list of source IDL files. 240 # sources = a list of source IDL files.
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 output_header_files += [ 347 output_header_files += [
332 "$output_dir/${interface}${component}Constructors.h" 348 "$output_dir/${interface}${component}Constructors.h"
333 ] 349 ]
334 } 350 }
335 351
336 outputs = output_idl_files + output_header_files 352 outputs = output_idl_files + output_header_files
337 deps = invoker.deps 353 deps = invoker.deps
338 } 354 }
339 } 355 }
340 356
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698