OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright (C) 2013 Google Inc. All rights reserved. | 3 # Copyright (C) 2013 Google Inc. All rights reserved. |
4 # | 4 # |
5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
7 # met: | 7 # met: |
8 # | 8 # |
9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 else: | 280 else: |
281 dependencies_other_component_full_paths.append(full_path) | 281 dependencies_other_component_full_paths.append(full_path) |
282 | 282 |
283 for include_path in partial_interfaces_include_paths: | 283 for include_path in partial_interfaces_include_paths: |
284 partial_interface_component = idl_filename_to_component(include_path
) | 284 partial_interface_component = idl_filename_to_component(include_path
) |
285 if component == partial_interface_component: | 285 if component == partial_interface_component: |
286 dependencies_include_paths.append(include_path) | 286 dependencies_include_paths.append(include_path) |
287 else: | 287 else: |
288 dependencies_other_component_include_paths.append(include_path) | 288 dependencies_other_component_include_paths.append(include_path) |
289 | 289 |
290 for union_type in interface_info.get('union_types', []): | 290 if interface_info['has_union_types']: |
291 if union_type.is_nullable: | |
292 union_type = union_type.inner_type | |
293 dependencies_include_paths.append( | 291 dependencies_include_paths.append( |
294 'bindings/%s/v8/%s.h' % (component, union_type.name)) | 292 'bindings/%s/v8/UnionTypes%s.h' % (component, component.capitali
ze())) |
295 | 293 |
296 interface_info.update({ | 294 interface_info.update({ |
297 'dependencies_full_paths': dependencies_full_paths, | 295 'dependencies_full_paths': dependencies_full_paths, |
298 'dependencies_include_paths': dependencies_include_paths, | 296 'dependencies_include_paths': dependencies_include_paths, |
299 'dependencies_other_component_full_paths': | 297 'dependencies_other_component_full_paths': |
300 dependencies_other_component_full_paths, | 298 dependencies_other_component_full_paths, |
301 'dependencies_other_component_include_paths': | 299 'dependencies_other_component_include_paths': |
302 dependencies_other_component_include_paths, | 300 dependencies_other_component_include_paths, |
303 }) | 301 }) |
304 | 302 |
305 # Clean up temporary private information | 303 # Clean up temporary private information |
306 for interface_info in interfaces_info.itervalues(): | 304 for interface_info in interfaces_info.itervalues(): |
307 del interface_info['extended_attributes'] | 305 del interface_info['extended_attributes'] |
308 del interface_info['union_types'] | 306 del interface_info['has_union_types'] |
309 del interface_info['is_legacy_treat_as_partial_interface'] | 307 del interface_info['is_legacy_treat_as_partial_interface'] |
310 | 308 |
311 # Compute global_type_info to interfaces_info so that idl_compiler does | 309 # Compute global_type_info to interfaces_info so that idl_compiler does |
312 # not need to always calculate the info in __init__. | 310 # not need to always calculate the info in __init__. |
313 compute_global_type_info() | 311 compute_global_type_info() |
314 | 312 |
315 | 313 |
316 ################################################################################ | 314 ################################################################################ |
317 | 315 |
318 def main(): | 316 def main(): |
319 options, args = parse_options() | 317 options, args = parse_options() |
320 # args = Input1, Input2, ..., Output | 318 # args = Input1, Input2, ..., Output |
321 interfaces_info_filename = args.pop() | 319 interfaces_info_filename = args.pop() |
322 info_individuals = read_pickle_files(args) | 320 info_individuals = read_pickle_files(args) |
323 | 321 |
324 compute_interfaces_info_overall(info_individuals) | 322 compute_interfaces_info_overall(info_individuals) |
325 write_pickle_file(interfaces_info_filename, | 323 write_pickle_file(interfaces_info_filename, |
326 interfaces_info, | 324 interfaces_info, |
327 options.write_file_only_if_changed) | 325 options.write_file_only_if_changed) |
328 | 326 |
329 | 327 |
330 if __name__ == '__main__': | 328 if __name__ == '__main__': |
331 sys.exit(main()) | 329 sys.exit(main()) |
OLD | NEW |