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

Side by Side Diff: sky/engine/bindings2/scripts/compute_interfaces_info_individual.py

Issue 914413004: Add a new bindings2/scripts directory for Dart bindings (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove idlrenderer.py it's not used Created 5 years, 10 months 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 #!/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 29 matching lines...) Expand all
40 40
41 Design doc: http://www.chromium.org/developers/design-documents/idl-build 41 Design doc: http://www.chromium.org/developers/design-documents/idl-build
42 """ 42 """
43 43
44 from collections import defaultdict 44 from collections import defaultdict
45 import optparse 45 import optparse
46 import os 46 import os
47 import posixpath 47 import posixpath
48 import sys 48 import sys
49 49
50 from utilities import get_file_contents, read_file_to_list, idl_filename_to_inte rface_name, write_pickle_file, get_interface_extended_attributes_from_idl, is_ca llback_interface_from_idl, is_dictionary_from_idl, get_partial_interface_name_fr om_idl, get_implements_from_idl, get_parent_interface, get_put_forward_interface s_from_idl 50 from utilities import get_file_contents, read_file_to_list, idl_filename_to_inte rface_name, write_pickle_file, get_interface_extended_attributes_from_idl, is_ca llback_interface_from_idl, get_partial_interface_name_from_idl, get_implements_f rom_idl, get_parent_interface, get_put_forward_interfaces_from_idl
51 51
52 module_path = os.path.dirname(__file__) 52 module_path = os.path.dirname(__file__)
53 source_path = os.path.normpath(os.path.join(module_path, os.pardir, os.pardir)) 53 source_path = os.path.normpath(os.path.join(module_path, os.pardir, os.pardir))
54 54
55 # Global variables (filled in and exported) 55 # Global variables (filled in and exported)
56 interfaces_info = {} 56 interfaces_info = {}
57 partial_interface_files = defaultdict(lambda: { 57 partial_interface_files = defaultdict(lambda: {
58 'full_paths': [], 58 'full_paths': [],
59 'include_paths': [], 59 'include_paths': [],
60 }) 60 })
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 interfaces_info[interface_name] = { 141 interfaces_info[interface_name] = {
142 'component_dir': component_dir, 142 'component_dir': component_dir,
143 'extended_attributes': extended_attributes, 143 'extended_attributes': extended_attributes,
144 'full_path': full_path, 144 'full_path': full_path,
145 'implemented_as': implemented_as, 145 'implemented_as': implemented_as,
146 'implemented_by_interfaces': left_interfaces, # private, merged to next 146 'implemented_by_interfaces': left_interfaces, # private, merged to next
147 'implements_interfaces': right_interfaces, 147 'implements_interfaces': right_interfaces,
148 'include_path': this_include_path, 148 'include_path': this_include_path,
149 'is_callback_interface': is_callback_interface_from_idl(idl_file_content s), 149 'is_callback_interface': is_callback_interface_from_idl(idl_file_content s),
150 'is_dictionary': is_dictionary_from_idl(idl_file_contents),
151 # FIXME: temporary private field, while removing old treatement of 150 # FIXME: temporary private field, while removing old treatement of
152 # 'implements': http://crbug.com/360435 151 # 'implements': http://crbug.com/360435
153 'is_legacy_treat_as_partial_interface': 'LegacyTreatAsPartialInterface' in extended_attributes, 152 'is_legacy_treat_as_partial_interface': 'LegacyTreatAsPartialInterface' in extended_attributes,
154 'parent': get_parent_interface(idl_file_contents), 153 'parent': get_parent_interface(idl_file_contents),
155 # Interfaces that are referenced (used as types) and that we introspect 154 # Interfaces that are referenced (used as types) and that we introspect
156 # during code generation (beyond interface-level data ([ImplementedAs], 155 # during code generation (beyond interface-level data ([ImplementedAs],
157 # is_callback_interface, ancestors, and inherited extended attributes): 156 # is_callback_interface, ancestors, and inherited extended attributes):
158 # deep dependencies. 157 # deep dependencies.
159 # These cause rebuilds of referrers, due to the dependency, so these 158 # These cause rebuilds of referrers, due to the dependency, so these
160 # should be minimized; currently only targets of [PutForwards]. 159 # should be minimized; currently only targets of [PutForwards].
(...skipping 30 matching lines...) Expand all
191 for idl_filename in idl_files: 190 for idl_filename in idl_files:
192 compute_info_individual(idl_filename, options.component_dir) 191 compute_info_individual(idl_filename, options.component_dir)
193 192
194 write_pickle_file(options.interfaces_info_file, 193 write_pickle_file(options.interfaces_info_file,
195 info_individual(), 194 info_individual(),
196 options.write_file_only_if_changed) 195 options.write_file_only_if_changed)
197 196
198 197
199 if __name__ == '__main__': 198 if __name__ == '__main__':
200 sys.exit(main()) 199 sys.exit(main())
OLDNEW
« no previous file with comments | « sky/engine/bindings2/scripts/compiler.py ('k') | sky/engine/bindings2/scripts/compute_interfaces_info_overall.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698