| 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 """This is the entry point to create Dart APIs from the IDL database.""" | 6 """This is the entry point to create Dart APIs from the IDL database.""" |
| 7 | 7 |
| 8 import dartgenerator | 8 import dartgenerator |
| 9 import database | 9 import database |
| 10 import fremontcutbuilder | 10 import fremontcutbuilder |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 HTML_LIBRARY_NAMES, template_loader, 'dartium', dartium_output_dir) | 131 HTML_LIBRARY_NAMES, template_loader, 'dartium', dartium_output_dir) |
| 132 | 132 |
| 133 RunGenerator(dart_libraries, dart_output_dir, | 133 RunGenerator(dart_libraries, dart_output_dir, |
| 134 template_loader, backend_factory) | 134 template_loader, backend_factory) |
| 135 cpp_library_emitter.EmitDerivedSources( | 135 cpp_library_emitter.EmitDerivedSources( |
| 136 template_loader.Load('cpp_derived_sources.template'), | 136 template_loader.Load('cpp_derived_sources.template'), |
| 137 dartium_output_dir) | 137 dartium_output_dir) |
| 138 cpp_library_emitter.EmitResolver( | 138 cpp_library_emitter.EmitResolver( |
| 139 template_loader.Load('cpp_resolver.template'), dartium_output_dir) | 139 template_loader.Load('cpp_resolver.template'), dartium_output_dir) |
| 140 | 140 |
| 141 path = os.path.join(cpp_output_dir, 'DartWebkitClassIds.h') |
| 142 e = emitters.FileEmitter(path) |
| 143 e.Emit(""" |
| 144 // WARNING: Do not edit - generated code. |
| 145 // See dart/tools/dom/scripts/dartdomgenerator.py |
| 146 |
| 147 #ifndef DartWebkitClassIds_h |
| 148 #define DartWebkitClassIds_h |
| 149 |
| 150 namespace WebCore { |
| 151 |
| 152 enum { |
| 153 _HistoryCrossFrameClassId = 0, |
| 154 _LocationCrossFrameClassId, |
| 155 _DOMWindowCrossFrameClassId, |
| 156 _NPObjectClassId, |
| 157 // New types that are not auto-generated should be added here. |
| 158 """) |
| 159 for interface in webkit_database.GetInterfaces(): |
| 160 interface_name = interface.id |
| 161 e.Emit(' %sClassId,\n' % interface_name) |
| 162 e.Emit(""" |
| 163 NumWebkitClassIds |
| 164 }; |
| 165 |
| 166 } // namespace WebCore |
| 167 |
| 168 #endif // DartWebkitClassIds_h |
| 169 """) |
| 170 |
| 141 _logger.info('Flush...') | 171 _logger.info('Flush...') |
| 142 emitters.Flush() | 172 emitters.Flush() |
| 143 | 173 |
| 144 if update_dom_metadata: | 174 if update_dom_metadata: |
| 145 metadata.Flush() | 175 metadata.Flush() |
| 146 | 176 |
| 147 monitored.FinishMonitoring(dart2js_output_dir) | 177 monitored.FinishMonitoring(dart2js_output_dir) |
| 148 | 178 |
| 149 def GenerateSingleFile(library_path, output_dir, generated_output_dir=None): | 179 def GenerateSingleFile(library_path, output_dir, generated_output_dir=None): |
| 150 library_dir = os.path.dirname(library_path) | 180 library_dir = os.path.dirname(library_path) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dart2js')) | 246 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dart2js')) |
| 217 if 'htmldartium' in systems: | 247 if 'htmldartium' in systems: |
| 218 _logger.info('Generating dartium single files.') | 248 _logger.info('Generating dartium single files.') |
| 219 for library_name in HTML_LIBRARY_NAMES: | 249 for library_name in HTML_LIBRARY_NAMES: |
| 220 GenerateSingleFile( | 250 GenerateSingleFile( |
| 221 os.path.join(dartium_output_dir, '%s_dartium.dart' % library_name), | 251 os.path.join(dartium_output_dir, '%s_dartium.dart' % library_name), |
| 222 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dartium')) | 252 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dartium')) |
| 223 | 253 |
| 224 if __name__ == '__main__': | 254 if __name__ == '__main__': |
| 225 sys.exit(main()) | 255 sys.exit(main()) |
| OLD | NEW |