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 logging.config | 10 import logging.config |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 common_database.DeleteInterface('DOMStringMap') | 47 common_database.DeleteInterface('DOMStringMap') |
48 common_database.DeleteInterface('DOMStringList') | 48 common_database.DeleteInterface('DOMStringList') |
49 generator.RenameTypes(common_database, { | 49 generator.RenameTypes(common_database, { |
50 # W3C -> Dart renames | 50 # W3C -> Dart renames |
51 'AbstractView': 'Window', | 51 'AbstractView': 'Window', |
52 'Function': 'EventListener', | 52 'Function': 'EventListener', |
53 'DOMStringMap': 'Map<String, String>', | 53 'DOMStringMap': 'Map<String, String>', |
54 'DOMStringList': 'List<String>', | 54 'DOMStringList': 'List<String>', |
55 }) | 55 }) |
56 generator.FilterMembersWithUnidentifiedTypes(common_database) | 56 generator.FilterMembersWithUnidentifiedTypes(common_database) |
57 webkit_database = common_database.Clone() | |
57 generator.ConvertToDartTypes(common_database) | 58 generator.ConvertToDartTypes(common_database) |
58 webkit_database = common_database.Clone() | 59 generator.ConvertToDartTypes(webkit_database) |
antonm
2012/02/13 18:52:46
I am not acquainted with this stuff, but why clone
podivilov
2012/02/14 12:46:01
Cloned idl types don't appear in _original_idl_typ
| |
59 | 60 |
60 generated_output_dir = os.path.join(output_dir, 'generated') | 61 generated_output_dir = os.path.join(output_dir, 'generated') |
61 if os.path.exists(generated_output_dir): | 62 if os.path.exists(generated_output_dir): |
62 _logger.info('Cleaning output directory %s' % generated_output_dir) | 63 _logger.info('Cleaning output directory %s' % generated_output_dir) |
63 shutil.rmtree(generated_output_dir) | 64 shutil.rmtree(generated_output_dir) |
64 | 65 |
65 | 66 |
66 # Generate Dart interfaces for the WebKit DOM. | 67 # Generate Dart interfaces for the WebKit DOM. |
67 webkit_output_dir = generated_output_dir | 68 webkit_output_dir = generated_output_dir |
68 generator.FilterInterfaces(database = webkit_database, | 69 generator.FilterInterfaces(database = webkit_database, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 # Copy dummy DOM where dartc build expects it. | 113 # Copy dummy DOM where dartc build expects it. |
113 if 'dummy' in systems: | 114 if 'dummy' in systems: |
114 # TODO(sra): Make other tools pick this up directly, or do a copy_dart into | 115 # TODO(sra): Make other tools pick this up directly, or do a copy_dart into |
115 # a specific directory. | 116 # a specific directory. |
116 source = os.path.join(output_dir, 'dom_dummy.dart') | 117 source = os.path.join(output_dir, 'dom_dummy.dart') |
117 target = os.path.join(output_dir, 'dom.dart') | 118 target = os.path.join(output_dir, 'dom.dart') |
118 shutil.copyfile(source, target) | 119 shutil.copyfile(source, target) |
119 | 120 |
120 if __name__ == '__main__': | 121 if __name__ == '__main__': |
121 sys.exit(main()) | 122 sys.exit(main()) |
OLD | NEW |