Chromium Code Reviews| OLD | NEW |
|---|---|
| 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" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 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 # output_file = pickle file to write |
| 31 # deps = dependencies | |
| 31 # | 32 # |
| 32 # FIXME: Note the static/generated split is for consistency with GYP. This | 33 # FIXME: Note the static/generated split is for consistency with GYP. This |
| 33 # split is not necessary in the GN build and could be combined into a single | 34 # split is not necessary in the GN build and could be combined into a single |
| 34 # "sources". | 35 # "sources". |
| 35 template("compute_interfaces_info_individual") { | 36 template("compute_interfaces_info_individual") { |
| 36 action(target_name) { | 37 action(target_name) { |
| 37 script = "$bindings_scripts_dir/compute_interfaces_info_individual.py" | 38 script = "$bindings_scripts_dir/compute_interfaces_info_individual.py" |
| 38 if (defined(invoker.visibility)) { | 39 if (defined(invoker.visibility)) { |
| 39 visibility = invoker.visibility | 40 visibility = invoker.visibility |
| 40 } | 41 } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 54 ] | 55 ] |
| 55 | 56 |
| 56 args = [ | 57 args = [ |
| 57 "--idl-files-list", rebase_path(file_list, root_build_dir), | 58 "--idl-files-list", rebase_path(file_list, root_build_dir), |
| 58 "--interfaces-info-file", | 59 "--interfaces-info-file", |
| 59 rebase_path(invoker.output_file, root_build_dir), | 60 rebase_path(invoker.output_file, root_build_dir), |
| 60 "--write-file-only-if-changed=1", | 61 "--write-file-only-if-changed=1", |
| 61 "--", | 62 "--", |
| 62 ] + rebase_path(invoker.sources_generated, root_build_dir) | 63 ] + rebase_path(invoker.sources_generated, root_build_dir) |
| 63 | 64 |
| 64 deps = [ | 65 deps = invoker.deps |
| 65 # FIXME: should be {modules|core}_generated_idls | |
| 66 # http://crbug.com/358074 | |
| 67 "//third_party/WebKit/Source/bindings:generated_idls", | |
| 68 ] | |
| 69 } | 66 } |
| 70 } | 67 } |
| 71 | 68 |
| 72 # Calls generate_event_interfaces | 69 # Calls generate_event_interfaces |
| 73 # | 70 # |
| 74 # Parameters: | 71 # Parameters: |
| 75 # sources = A list of IDL files to process. | 72 # sources = A list of IDL files to process. |
| 76 # output_file = The .in file to write, relative to the blink_gen_dir. | 73 # output_file = The .in file to write, relative to the blink_gen_dir. |
| 77 # suffix = (Optional) String to be passed to script via --suffix | 74 # suffix = (Optional) String to be passed to script via --suffix |
| 78 template("generate_event_interfaces") { | 75 template("generate_event_interfaces") { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 outputs = invoker.outputs | 228 outputs = invoker.outputs |
| 232 | 229 |
| 233 args = [ | 230 args = [ |
| 234 invoker.component_dir, | 231 invoker.component_dir, |
| 235 rebase_path(idl_files_list, root_build_dir), | 232 rebase_path(idl_files_list, root_build_dir), |
| 236 "--", | 233 "--", |
| 237 ] | 234 ] |
| 238 args += rebase_path(invoker.outputs, root_build_dir) | 235 args += rebase_path(invoker.outputs, root_build_dir) |
| 239 } | 236 } |
| 240 } | 237 } |
| 238 | |
| 239 # Calls the compute_global_objects script. | |
| 240 # | |
| 241 # Parameters: | |
| 242 # sources = a list of source IDL files. | |
| 243 # sources_generated = a list of generated pickle sources. | |
| 244 # output_file = a pickle file to write to (need to specify directory) | |
| 245 # | |
| 246 template("compute_global_objects") { | |
| 247 action(target_name) { | |
| 248 script = "//third_party/WebKit/Source/bindings/scripts/compute_global_object s.py" | |
| 249 | |
| 250 # Write the file list to a unique temp file to avoid blowing out the | |
| 251 # command line length limit. | |
| 252 idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp" | |
| 253 write_file(idl_files_list, | |
| 254 rebase_path(invoker.sources, root_build_dir)) | |
| 255 | |
| 256 inputs = [ | |
| 257 "//third_party/WebKit/Source/bindings/scripts/utilities.py", | |
| 258 idl_files_list, | |
| 259 ] + invoker.sources_generated + invoker.sources | |
| 260 | |
| 261 outputs = [ invoker.output_file ] | |
| 262 | |
| 263 args = [ | |
| 264 "--idl-files-list", | |
| 265 rebase_path(idl_files_list, root_build_dir), | |
| 266 "--write-file-only-if-changed=1", # Always true for Ninja. | |
| 267 "--", | |
| 268 ] | |
| 269 args += rebase_path(invoker.sources_generated, root_build_dir) | |
| 270 args += [ rebase_path(invoker.output_file, root_build_dir) ] | |
| 271 } | |
| 272 } | |
| 273 | |
| 274 # Calls the generate_global_constructors script. | |
| 275 # | |
| 276 # Parameters: | |
| 277 # sources = a list of source IDL files. | |
| 278 # global_objects_file = a global objects file generated by compute_global_obje cts | |
| 279 # interfaces = interfaces to generate global constructors for. | |
| 280 # output_idl_file = a list of IDL files to write to. | |
|
brettw
2014/10/08 18:28:33
you need an "s" at the end of the var name. I thin
tasak
2014/10/14 11:51:33
Done.
Autogenerated the .idl names and headers.
| |
| 281 # output_header_file = a list of cpp header files to write to. | |
| 282 # deps = dependencies | |
| 283 # | |
| 284 template("generate_global_constructors") { | |
| 285 action(target_name) { | |
| 286 script = "//third_party/WebKit/Source/bindings/scripts/generate_global_const ructors.py" | |
| 287 | |
| 288 # Write the file list to a unique temp file to avoid blowing out the | |
| 289 # command line length limit. | |
| 290 idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp" | |
| 291 write_file(idl_files_list, | |
| 292 rebase_path(invoker.sources, root_build_dir)) | |
| 293 | |
| 294 inputs = [ | |
| 295 "//third_party/WebKit/Source/bindings/scripts/utilities.py", | |
| 296 idl_files_list, | |
| 297 invoker.global_objects_file, | |
| 298 ] + invoker.sources | |
| 299 | |
| 300 outputs = invoker.output_idl_files + invoker.output_header_files | |
| 301 | |
| 302 args = [ | |
| 303 "--idl-files-list", | |
| 304 rebase_path(idl_files_list, root_build_dir), | |
| 305 "--global-objects-file", | |
| 306 rebase_path(invoker.global_objects_file, root_build_dir), | |
| 307 "--write-file-only-if-changed=1", # Always true for Ninja. | |
| 308 "--", | |
| 309 ] | |
| 310 | |
| 311 # Generate zip(interfaces, output_idl_files), because | |
| 312 # generate_global_constructors.py requries | |
| 313 # -- interace output_idl_file (interface output_idl_file)* | |
| 314 i = 0 | |
| 315 output_idl_files = invoker.output_idl_files | |
| 316 foreach(interface, invoker.interfaces) { | |
| 317 args += [ interface ] | |
| 318 args += [ rebase_path(output_idl_files[i], root_build_dir) ] | |
| 319 i = i + 1 | |
| 320 } | |
| 321 | |
| 322 deps = invoker.deps | |
| 323 } | |
| 324 } | |
| 325 | |
| OLD | NEW |