| 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 css_code_generator | 8 import css_code_generator |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 metadata.Flush() | 217 metadata.Flush() |
| 218 | 218 |
| 219 monitored.FinishMonitoring(dart2js_output_dir, _logger) | 219 monitored.FinishMonitoring(dart2js_output_dir, _logger) |
| 220 | 220 |
| 221 def GenerateSingleFile(library_path, output_dir, generated_output_dir=None): | 221 def GenerateSingleFile(library_path, output_dir, generated_output_dir=None): |
| 222 library_dir = os.path.dirname(library_path) | 222 library_dir = os.path.dirname(library_path) |
| 223 library_filename = os.path.basename(library_path) | 223 library_filename = os.path.basename(library_path) |
| 224 copy_dart_script = os.path.relpath('../../copy_dart.py', | 224 copy_dart_script = os.path.relpath('../../copy_dart.py', |
| 225 library_dir) | 225 library_dir) |
| 226 output_dir = os.path.relpath(output_dir, library_dir) | 226 output_dir = os.path.relpath(output_dir, library_dir) |
| 227 if not os.path.exists(library_dir): |
| 228 os.makedirs(library_dir) |
| 227 command = ' '.join(['cd', library_dir, ';', | 229 command = ' '.join(['cd', library_dir, ';', |
| 228 copy_dart_script, output_dir, library_filename]) | 230 copy_dart_script, output_dir, library_filename]) |
| 229 subprocess.call([command], shell=True) | 231 subprocess.call([command], shell=True) |
| 230 prebuilt_dartfmt = os.path.join(utils.CheckedInSdkPath(), 'bin', 'dartfmt') | 232 prebuilt_dartfmt = os.path.join(utils.CheckedInSdkPath(), 'bin', 'dartfmt') |
| 231 sdk_file = os.path.join(library_dir, output_dir, library_filename) | 233 sdk_file = os.path.join(library_dir, output_dir, library_filename) |
| 232 formatCommand = ' '.join([prebuilt_dartfmt, '-w', sdk_file]) | 234 formatCommand = ' '.join([prebuilt_dartfmt, '-w', sdk_file]) |
| 233 subprocess.call([formatCommand], shell=True) | 235 subprocess.call([formatCommand], shell=True) |
| 234 | 236 |
| 235 def UpdateCssProperties(): | 237 def UpdateCssProperties(): |
| 236 """Regenerate the CssStyleDeclaration template file with the current CSS | 238 """Regenerate the CssStyleDeclaration template file with the current CSS |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 help='Do not generate the sdk/lib/js/cached_patches.dart fil
e') | 298 help='Do not generate the sdk/lib/js/cached_patches.dart fil
e') |
| 297 | 299 |
| 298 (options, args) = parser.parse_args() | 300 (options, args) = parser.parse_args() |
| 299 | 301 |
| 300 current_dir = os.path.dirname(__file__) | 302 current_dir = os.path.dirname(__file__) |
| 301 database_dir = os.path.join(current_dir, '..', 'database') | 303 database_dir = os.path.join(current_dir, '..', 'database') |
| 302 logging.config.fileConfig(os.path.join(current_dir, 'logging.conf')) | 304 logging.config.fileConfig(os.path.join(current_dir, 'logging.conf')) |
| 303 systems = options.systems.split(',') | 305 systems = options.systems.split(',') |
| 304 | 306 |
| 305 output_dir = options.output_dir or os.path.join( | 307 output_dir = options.output_dir or os.path.join( |
| 306 current_dir, '..', '..', utils.GetBuildDir(utils.GuessOS()), | 308 current_dir, '..', '..', '..', utils.GetBuildDir(utils.GuessOS()), |
| 307 'generated') | 309 'generated') |
| 308 | 310 |
| 309 dart2js_output_dir = None | 311 dart2js_output_dir = None |
| 310 if 'htmldart2js' in systems: | 312 if 'htmldart2js' in systems: |
| 311 dart2js_output_dir = os.path.join(output_dir, 'dart2js') | 313 dart2js_output_dir = os.path.join(output_dir, 'dart2js') |
| 312 dartium_output_dir = None | 314 dartium_output_dir = None |
| 313 if 'htmldartium' in systems: | 315 if 'htmldartium' in systems: |
| 314 dartium_output_dir = os.path.join(output_dir, 'dartium') | 316 dartium_output_dir = os.path.join(output_dir, 'dartium') |
| 315 blink_output_dir = None | 317 blink_output_dir = None |
| 316 if '_blink' in systems: | 318 if '_blink' in systems: |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 os.path.join('..', '..', '..', 'sdk', 'lib', '_blink', 'dartium')) | 373 os.path.join('..', '..', '..', 'sdk', 'lib', '_blink', 'dartium')) |
| 372 | 374 |
| 373 print '\nGenerating single file %s seconds' % round(time.time() - file_generat
ion_start_time, 2) | 375 print '\nGenerating single file %s seconds' % round(time.time() - file_generat
ion_start_time, 2) |
| 374 | 376 |
| 375 end_time = time.time() | 377 end_time = time.time() |
| 376 | 378 |
| 377 print '\nDone (dartdomgenerator) %s seconds' % round(end_time - start_time, 2) | 379 print '\nDone (dartdomgenerator) %s seconds' % round(end_time - start_time, 2) |
| 378 | 380 |
| 379 if __name__ == '__main__': | 381 if __name__ == '__main__': |
| 380 sys.exit(main()) | 382 sys.exit(main()) |
| OLD | NEW |