| 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 idlparser | 8 import idlparser |
| 9 import logging.config | 9 import logging.config |
| 10 import os.path | 10 import os.path |
| 11 import sys | 11 import sys |
| 12 | 12 |
| 13 _logger = logging.getLogger('fremontcutbuilder') |
| 14 |
| 13 FEATURE_DISABLED = [ | 15 FEATURE_DISABLED = [ |
| 14 'ENABLE_BATTERY_STATUS', | 16 'ENABLE_BATTERY_STATUS', |
| 15 'ENABLE_CSS3_CONDITIONAL_RULES', | 17 'ENABLE_CSS3_CONDITIONAL_RULES', |
| 16 'ENABLE_CSS_DEVICE_ADAPTATION', | 18 'ENABLE_CSS_DEVICE_ADAPTATION', |
| 17 'ENABLE_CUSTOM_SCHEME_HANDLER', | 19 'ENABLE_CUSTOM_SCHEME_HANDLER', |
| 18 'ENABLE_ENCRYPTED_MEDIA_V2', | 20 'ENABLE_ENCRYPTED_MEDIA_V2', |
| 19 'ENABLE_MEDIA_CAPTURE', # Only enabled on Android. | 21 'ENABLE_MEDIA_CAPTURE', # Only enabled on Android. |
| 20 'ENABLE_ORIENTATION_EVENTS', # Only enabled on Android. | 22 'ENABLE_ORIENTATION_EVENTS', # Only enabled on Android. |
| 21 'ENABLE_SPEECH_SYNTHESIS', | 23 'ENABLE_SPEECH_SYNTHESIS', |
| 22 'ENABLE_WEBVTT_REGIONS', | 24 'ENABLE_WEBVTT_REGIONS', |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 102 |
| 101 # Cleanup: | 103 # Cleanup: |
| 102 builder.normalize_annotations(['WebKit', 'Dart']) | 104 builder.normalize_annotations(['WebKit', 'Dart']) |
| 103 | 105 |
| 104 conditionals_met = set( | 106 conditionals_met = set( |
| 105 'ENABLE_' + conditional for conditional in builder.conditionals_met) | 107 'ENABLE_' + conditional for conditional in builder.conditionals_met) |
| 106 known_conditionals = set(FEATURE_DEFINES + FEATURE_DISABLED) | 108 known_conditionals = set(FEATURE_DEFINES + FEATURE_DISABLED) |
| 107 | 109 |
| 108 unused_conditionals = known_conditionals - conditionals_met | 110 unused_conditionals = known_conditionals - conditionals_met |
| 109 if unused_conditionals: | 111 if unused_conditionals: |
| 110 raise Exception('There are some unused conditionals %s' % | 112 _logger.warning('There are some unused conditionals %s' % |
| 111 sorted(unused_conditionals)) | 113 sorted(unused_conditionals)) |
| 112 | 114 |
| 113 unknown_conditionals = conditionals_met - known_conditionals | 115 unknown_conditionals = conditionals_met - known_conditionals |
| 114 if unknown_conditionals: | 116 if unknown_conditionals: |
| 115 raise Exception('There are some unknown conditionals %s' % | 117 _logger.warning('There are some unknown conditionals %s' % |
| 116 sorted(unknown_conditionals)) | 118 sorted(unknown_conditionals)) |
| 117 | 119 |
| 118 db.Save() | 120 db.Save() |
| 119 return db | 121 return db |
| 120 | 122 |
| 121 def main(parallel=False): | 123 def main(parallel=False): |
| 122 current_dir = os.path.dirname(__file__) | 124 current_dir = os.path.dirname(__file__) |
| 123 | 125 |
| 124 idl_files = [] | 126 idl_files = [] |
| 125 | 127 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 144 if ext == '.idl': | 146 if ext == '.idl': |
| 145 idl_files.append(file_name) | 147 idl_files.append(file_name) |
| 146 | 148 |
| 147 os.path.walk(webcore_dir, visitor, webcore_dir) | 149 os.path.walk(webcore_dir, visitor, webcore_dir) |
| 148 | 150 |
| 149 database_dir = os.path.join(current_dir, '..', 'database') | 151 database_dir = os.path.join(current_dir, '..', 'database') |
| 150 return build_database(idl_files, database_dir, parallel=parallel) | 152 return build_database(idl_files, database_dir, parallel=parallel) |
| 151 | 153 |
| 152 if __name__ == '__main__': | 154 if __name__ == '__main__': |
| 153 sys.exit(main()) | 155 sys.exit(main()) |
| OLD | NEW |