Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: lib/dom/scripts/dartdomgenerator.py

Issue 10700006: Make per-interface generators an implementation detail of a system. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: . Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | lib/dom/scripts/dartgenerator.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 {'DARTIUM': False, 'FROG': True}), 90 {'DARTIUM': False, 'FROG': True}),
91 webkit_database, emitters, output_dir) 91 webkit_database, emitters, output_dir)
92 elif system == 'htmldartium': 92 elif system == 'htmldartium':
93 # Generate native wrappers. 93 # Generate native wrappers.
94 native_system = NativeImplementationSystem( 94 native_system = NativeImplementationSystem(
95 TemplateLoader(template_dir, ['dom/native', 'html/dartium', 95 TemplateLoader(template_dir, ['dom/native', 'html/dartium',
96 'html/impl', ''], 96 'html/impl', ''],
97 {'DARTIUM': True, 'FROG': False}), 97 {'DARTIUM': True, 'FROG': False}),
98 webkit_database, emitters, output_dir) 98 webkit_database, emitters, output_dir)
99 generator.Generate(webkit_database, native_system, 99 generator.Generate(webkit_database, native_system,
100 source_filter=['WebKit', 'Dart'],
101 super_database=common_database, 100 super_database=common_database,
102 common_prefix='common',
103 webkit_renames=_webkit_renames) 101 webkit_renames=_webkit_renames)
104 dom_implementation_classes = native_system.DartImplementationFiles() 102 dom_implementation_classes = native_system.DartImplementationFiles()
105 implementation_system = HtmlDartiumSystem( 103 implementation_system = HtmlDartiumSystem(
106 TemplateLoader(template_dir, 104 TemplateLoader(template_dir,
107 ['html/dartium', 'html/impl', 'html', ''], 105 ['html/dartium', 'html/impl', 'html', ''],
108 {'DARTIUM': True, 'FROG': False}), 106 {'DARTIUM': True, 'FROG': False}),
109 webkit_database, emitters, auxiliary_dir, dom_implementation_classes, 107 webkit_database, emitters, auxiliary_dir, dom_implementation_classes,
110 output_dir) 108 output_dir)
111 else: 109 else:
112 raise Exception('Unsupported system %s' % system) 110 raise Exception('Unsupported system %s' % system)
113 111
114 # Makes interface files available for listing in the library for the 112 # Makes interface files available for listing in the library for the
115 # implementation system. 113 # implementation system.
116 implementation_system._interface_system = interface_system 114 implementation_system._interface_system = interface_system
117 115
118 for system in [interface_system, implementation_system]: 116 for system in [interface_system, implementation_system]:
119 generator.Generate(webkit_database, system, 117 generator.Generate(webkit_database, system,
120 source_filter=['WebKit', 'Dart'],
121 super_database=common_database, 118 super_database=common_database,
122 common_prefix='common',
123 webkit_renames=_webkit_renames) 119 webkit_renames=_webkit_renames)
124 120
125 _logger.info('Flush...') 121 _logger.info('Flush...')
126 emitters.Flush() 122 emitters.Flush()
127 123
128 def GenerateSingleFile(systems): 124 def GenerateSingleFile(systems):
129 if 'frog' in systems: 125 if 'frog' in systems:
130 _logger.info('Copy dom_frog to frog/') 126 _logger.info('Copy dom_frog to frog/')
131 subprocess.call(['cd ../generated ; ' 127 subprocess.call(['cd ../generated ; '
132 '../../../tools/copy_dart.py ../frog dom_frog.dart'], 128 '../../../tools/copy_dart.py ../frog dom_frog.dart'],
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 dom_output_dir = options.output_dir or os.path.join(current_dir, 174 dom_output_dir = options.output_dir or os.path.join(current_dir,
179 '../generated') 175 '../generated')
180 html_output_dir = options.output_dir or os.path.join(current_dir, 176 html_output_dir = options.output_dir or os.path.join(current_dir,
181 '../../html/generated') 177 '../../html/generated')
182 Generate(systems, database_dir, options.use_database_cache, 178 Generate(systems, database_dir, options.use_database_cache,
183 dom_output_dir, html_output_dir) 179 dom_output_dir, html_output_dir)
184 GenerateSingleFile(systems) 180 GenerateSingleFile(systems)
185 181
186 if __name__ == '__main__': 182 if __name__ == '__main__':
187 sys.exit(main()) 183 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | lib/dom/scripts/dartgenerator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698