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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 dartium_output_dir = os.path.join(output_dir, 'dartium') | 188 dartium_output_dir = os.path.join(output_dir, 'dartium') |
189 | 189 |
190 if options.rebuild: | 190 if options.rebuild: |
191 # Parse the IDL and create the database. | 191 # Parse the IDL and create the database. |
192 database = fremontcutbuilder.main(options.parallel) | 192 database = fremontcutbuilder.main(options.parallel) |
193 else: | 193 else: |
194 # Load the previously generated database. | 194 # Load the previously generated database. |
195 database = LoadDatabase(database_dir, options.use_database_cache) | 195 database = LoadDatabase(database_dir, options.use_database_cache) |
196 GenerateFromDatabase(database, dart2js_output_dir, dartium_output_dir) | 196 GenerateFromDatabase(database, dart2js_output_dir, dartium_output_dir) |
197 | 197 |
198 _logger.info('Add documentation to generated classes.') | |
199 html_to_json_script = os.path.relpath( | |
200 '../../html_json_doc/bin/html_json_doc.dart', | |
201 current_dir) | |
202 html_output_dir = os.path.join(output_dir, 'dart2js/dart/html/') | |
203 svg_output_dir = os.path.join(output_dir, 'dart2js/dart/svg/') | |
204 html_json_path = os.path.relpath('../docs/html_docs.json') | |
205 svg_json_path = os.path.relpath('../docs/svg_docs.json') | |
206 | |
207 path_to_dart = utils.DartSdkBinary() | |
208 html_command = ' '.join([path_to_dart, html_to_json_script, | |
209 '--mode=json-to-html', html_output_dir, | |
210 html_json_path]) | |
211 svg_command = ' '.join([path_to_dart, html_to_json_script, | |
212 '--mode=json-to-html', svg_output_dir, svg_json_path]) | |
213 subprocess.call([html_command], shell=True) | |
214 subprocess.call([svg_command], shell=True) | |
215 | |
216 if 'htmldart2js' in systems: | 198 if 'htmldart2js' in systems: |
217 _logger.info('Generating dart2js single files.') | 199 _logger.info('Generating dart2js single files.') |
218 for library_name in _libraries: | 200 for library_name in _libraries: |
219 GenerateSingleFile( | 201 GenerateSingleFile( |
220 os.path.join(dart2js_output_dir, '%s_dart2js.dart' % library_name), | 202 os.path.join(dart2js_output_dir, '%s_dart2js.dart' % library_name), |
221 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dart2js')) | 203 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dart2js')) |
222 if 'htmldartium' in systems: | 204 if 'htmldartium' in systems: |
223 _logger.info('Generating dartium single files.') | 205 _logger.info('Generating dartium single files.') |
224 for library_name in _libraries: | 206 for library_name in _libraries: |
225 GenerateSingleFile( | 207 GenerateSingleFile( |
226 os.path.join(dartium_output_dir, '%s_dartium.dart' % library_name), | 208 os.path.join(dartium_output_dir, '%s_dartium.dart' % library_name), |
227 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dartium')) | 209 os.path.join('..', '..', '..', 'sdk', 'lib', library_name, 'dartium')) |
228 | 210 |
229 if __name__ == '__main__': | 211 if __name__ == '__main__': |
230 sys.exit(main()) | 212 sys.exit(main()) |
OLD | NEW |