47 for interface, db_Opts
in all_interfaces:
49 def IsIdentified(idl_node):
50 node_name = idl_node.id
if idl_node.id
else 'parent'
54 resolvedType = resolveTypedef(idl_type)
55 if (resolvedType != idl_type):
56 idl_type.id = resolvedType.id
57 idl_type.nullable = resolvedType.nullable
61 interface.constants = list(filter(IsIdentified, interface.constants))
62 interface.attributes = list(filter(IsIdentified, interface.attributes))
63 interface.operations = list(filter(IsIdentified, interface.operations))
64 interface.parents = list(filter(IsIdentified, interface.parents))
70 logging_level=logging.WARNING,
72 """This code reconstructs the FremontCut IDL database from W3C,
73 WebKit and Dart IDL files."""
74 current_dir = os.path.dirname(__file__)
75 logging.config.fileConfig(os.path.join(current_dir,
"logging.conf"))
77 _logger.setLevel(logging_level)
89 webkit_revision =
'63'
93 webkit_defines = [
'LANGUAGE_DART',
'LANGUAGE_JAVASCRIPT']
95 if feature_defines
is None:
96 feature_defines = FEATURE_DEFINES
100 idl_defines=webkit_defines + feature_defines,
102 source_attributes={
'revision': webkit_revision},
103 logging_level=logging_level)
106 builder.import_idl_files(idl_files, webkit_options,
False)
111 rename_operation_arguments_on_merge=
True,
112 logging_level=logging_level)
114 utilities.KNOWN_COMPONENTS = frozenset([
'core',
'modules',
'dart'])
116 builder.import_idl_files(
117 [os.path.join(current_dir,
'..',
'idl',
'dart',
'dart.idl')],
120 start_time = time.time()
126 builder.merge_imported_interfaces()
128 builder.fetch_constructor_data(webkit_options)
129 builder.fix_displacements(
'WebKit')
132 builder.normalize_annotations([
'WebKit',
'Dart'])
135 builder.map_dictionaries()
140 builder.examine_database()
142 conditionals_met = set(
143 'ENABLE_' + conditional
for conditional
in builder.conditionals_met)
144 known_conditionals = set(FEATURE_DEFINES + FEATURE_DISABLED)
146 unused_conditionals = known_conditionals - conditionals_met
147 if unused_conditionals:
148 _logger.warning(
'There are some unused conditionals %s' %
149 sorted(unused_conditionals))
150 _logger.warning(
'Please update fremontcutbuilder.py')
152 unknown_conditionals = conditionals_met - known_conditionals
153 if unknown_conditionals:
154 _logger.warning(
'There are some unknown conditionals %s' %
155 sorted(unknown_conditionals))
156 _logger.warning(
'Please update fremontcutbuilder.py')
158 print(
'Merging interfaces %s seconds' %
round(time.time() - start_time, 2))
163def main(parallel=False, logging_level=logging.WARNING, examine_idls=False):
164 current_dir = os.path.dirname(__file__)
169 webcore_dir = os.path.join(current_dir,
'..',
'..',
'..',
'third_party',
172 if not os.path.exists(webcore_dir):
174 webcore_dir = os.path.join(current_dir,
'..',
'..',
'..',
'..',
175 'third_party',
'WebKit',
'Source')
177 if not os.path.exists(webcore_dir):
178 raise RuntimeError(
'directory not found: %s' % webcore_dir)
192 'InspectorFrontendHostFileSystem.idl',
194 'WebKitGamepadList.idl',
197 for (dir_name, dirs, files)
in os.walk(webcore_dir):
198 if os.path.basename(dir_name)
in DIRS_TO_IGNORE:
202 file_name = os.path.join(dir_name, name)
203 (interface, ext) = os.path.splitext(file_name)
204 if ext ==
'.idl' and not (name
in FILES_TO_IGNORE):
205 idl_files.append(file_name)
207 database_dir = os.path.join(current_dir,
'..',
'database')
212 logging_level=logging_level,
213 examine_idls=examine_idls)