| 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 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 _logger.warning('Please update fremontcutbuilder.py') | 108 _logger.warning('Please update fremontcutbuilder.py') |
| 109 | 109 |
| 110 db.Save() | 110 db.Save() |
| 111 return db | 111 return db |
| 112 | 112 |
| 113 def main(parallel=False): | 113 def main(parallel=False): |
| 114 current_dir = os.path.dirname(__file__) | 114 current_dir = os.path.dirname(__file__) |
| 115 | 115 |
| 116 idl_files = [] | 116 idl_files = [] |
| 117 | 117 |
| 118 # Check default location in a regular dart enlistment. |
| 118 webcore_dir = os.path.join(current_dir, '..', '..', '..', 'third_party', | 119 webcore_dir = os.path.join(current_dir, '..', '..', '..', 'third_party', |
| 119 'WebCore') | 120 'WebCore') |
| 121 |
| 122 if not os.path.exists(webcore_dir): |
| 123 # Check default location in a dartium enlistment. |
| 124 webcore_dir = os.path.join(current_dir, '..', '..', '..', '..', |
| 125 'third_party', 'WebKit', 'Source') |
| 126 |
| 120 if not os.path.exists(webcore_dir): | 127 if not os.path.exists(webcore_dir): |
| 121 raise RuntimeError('directory not found: %s' % webcore_dir) | 128 raise RuntimeError('directory not found: %s' % webcore_dir) |
| 122 | 129 |
| 123 DIRS_TO_IGNORE = [ | 130 DIRS_TO_IGNORE = [ |
| 124 'bindings', # Various test IDLs | 131 'bindings', # Various test IDLs |
| 125 'testing', # IDLs to expose testing APIs | 132 'testing', # IDLs to expose testing APIs |
| 126 'networkinfo', # Not yet used in Blink yet | 133 'networkinfo', # Not yet used in Blink yet |
| 127 'vibration', # Not yet used in Blink yet | 134 'vibration', # Not yet used in Blink yet |
| 135 'inspector', |
| 128 ] | 136 ] |
| 129 | 137 |
| 130 def visitor(arg, dir_name, names): | 138 def visitor(arg, dir_name, names): |
| 131 if os.path.basename(dir_name) in DIRS_TO_IGNORE: | 139 if os.path.basename(dir_name) in DIRS_TO_IGNORE: |
| 132 names[:] = [] # Do not go underneath | 140 names[:] = [] # Do not go underneath |
| 133 for name in names: | 141 for name in names: |
| 134 file_name = os.path.join(dir_name, name) | 142 file_name = os.path.join(dir_name, name) |
| 135 (interface, ext) = os.path.splitext(file_name) | 143 (interface, ext) = os.path.splitext(file_name) |
| 136 if ext == '.idl': | 144 if ext == '.idl': |
| 137 idl_files.append(file_name) | 145 idl_files.append(file_name) |
| 138 | 146 |
| 139 os.path.walk(webcore_dir, visitor, webcore_dir) | 147 os.path.walk(webcore_dir, visitor, webcore_dir) |
| 140 | 148 |
| 141 database_dir = os.path.join(current_dir, '..', 'database') | 149 database_dir = os.path.join(current_dir, '..', 'database') |
| 142 return build_database(idl_files, database_dir, parallel=parallel) | 150 return build_database(idl_files, database_dir, parallel=parallel) |
| 143 | 151 |
| 144 if __name__ == '__main__': | 152 if __name__ == '__main__': |
| 145 sys.exit(main()) | 153 sys.exit(main()) |
| OLD | NEW |