| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 import database | 6 import database |
| 7 import databasebuilder | 7 import databasebuilder |
| 8 import logging.config | 8 import logging.config |
| 9 import os.path | 9 import os.path |
| 10 import sys | 10 import sys |
| 11 import time | 11 import time |
| 12 import utilities |
| 12 | 13 |
| 13 _logger = logging.getLogger('fremontcutbuilder') | 14 _logger = logging.getLogger('fremontcutbuilder') |
| 14 | 15 |
| 15 # See: | 16 # See: |
| 16 # http://src.chromium.org/viewvc/multivm/trunk/webkit/Source/core/features.gypi | 17 # http://src.chromium.org/viewvc/multivm/trunk/webkit/Source/core/features.gypi |
| 17 # for ENABLE_* flags defined in Chromium / Blink. | 18 # for ENABLE_* flags defined in Chromium / Blink. |
| 18 # We list all ENABLE flags used in IDL in one of these two lists. | 19 # We list all ENABLE flags used in IDL in one of these two lists. |
| 19 FEATURE_DISABLED = [ | 20 FEATURE_DISABLED = [ |
| 20 'ENABLE_CUSTOM_SCHEME_HANDLER', | 21 'ENABLE_CUSTOM_SCHEME_HANDLER', |
| 21 'ENABLE_MEDIA_CAPTURE', # Only enabled on Android. | 22 'ENABLE_MEDIA_CAPTURE', # Only enabled on Android. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 71 |
| 71 # Import WebKit IDLs. | 72 # Import WebKit IDLs. |
| 72 builder.import_idl_files(idl_files, webkit_options, False) | 73 builder.import_idl_files(idl_files, webkit_options, False) |
| 73 | 74 |
| 74 # Import Dart idl: | 75 # Import Dart idl: |
| 75 dart_options = databasebuilder.DatabaseBuilderOptions( | 76 dart_options = databasebuilder.DatabaseBuilderOptions( |
| 76 source='Dart', | 77 source='Dart', |
| 77 rename_operation_arguments_on_merge=True, | 78 rename_operation_arguments_on_merge=True, |
| 78 logging_level=logging_level) | 79 logging_level=logging_level) |
| 79 | 80 |
| 81 utilities.KNOWN_COMPONENTS = frozenset(['core', 'modules', 'dart']) |
| 82 |
| 80 builder.import_idl_files( | 83 builder.import_idl_files( |
| 81 [ os.path.join(current_dir, '..', 'idl', 'dart', 'dart.idl') ], | 84 [ os.path.join(current_dir, '..', 'idl', 'dart', 'dart.idl') ], |
| 82 dart_options, True) | 85 dart_options, True) |
| 83 | 86 |
| 84 start_time = time.time() | 87 start_time = time.time() |
| 85 | 88 |
| 86 # Merging: | 89 # Merging: |
| 87 builder.merge_imported_interfaces() | 90 builder.merge_imported_interfaces() |
| 88 | 91 |
| 89 builder.fetch_constructor_data(webkit_options) | 92 builder.fetch_constructor_data(webkit_options) |
| 90 builder.fix_displacements('WebKit') | 93 builder.fix_displacements('WebKit') |
| 91 | 94 |
| 92 # Cleanup: | 95 # Cleanup: |
| 93 builder.normalize_annotations(['WebKit', 'Dart']) | 96 builder.normalize_annotations(['WebKit', 'Dart']) |
| 94 | 97 |
| 98 # Map any IDL defined dictionaries to Dictionary. |
| 99 builder.map_dictionaries() |
| 100 |
| 95 conditionals_met = set( | 101 conditionals_met = set( |
| 96 'ENABLE_' + conditional for conditional in builder.conditionals_met) | 102 'ENABLE_' + conditional for conditional in builder.conditionals_met) |
| 97 known_conditionals = set(FEATURE_DEFINES + FEATURE_DISABLED) | 103 known_conditionals = set(FEATURE_DEFINES + FEATURE_DISABLED) |
| 98 | 104 |
| 99 unused_conditionals = known_conditionals - conditionals_met | 105 unused_conditionals = known_conditionals - conditionals_met |
| 100 if unused_conditionals: | 106 if unused_conditionals: |
| 101 _logger.warning('There are some unused conditionals %s' % | 107 _logger.warning('There are some unused conditionals %s' % |
| 102 sorted(unused_conditionals)) | 108 sorted(unused_conditionals)) |
| 103 _logger.warning('Please update fremontcutbuilder.py') | 109 _logger.warning('Please update fremontcutbuilder.py') |
| 104 | 110 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 idl_files.append(file_name) | 164 idl_files.append(file_name) |
| 159 | 165 |
| 160 os.path.walk(webcore_dir, visitor, webcore_dir) | 166 os.path.walk(webcore_dir, visitor, webcore_dir) |
| 161 | 167 |
| 162 database_dir = os.path.join(current_dir, '..', 'database') | 168 database_dir = os.path.join(current_dir, '..', 'database') |
| 163 | 169 |
| 164 return build_database(idl_files, database_dir, logging_level=logging_level) | 170 return build_database(idl_files, database_dir, logging_level=logging_level) |
| 165 | 171 |
| 166 if __name__ == '__main__': | 172 if __name__ == '__main__': |
| 167 sys.exit(main()) | 173 sys.exit(main()) |
| OLD | NEW |