| 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 |
| 11 | 11 |
| 12 # Setup all paths to find our PYTHON code | 12 # Setup all paths to find our PYTHON code |
| 13 |
| 14 # dart_dir is the location of dart's enlistment dartium (dartium-git/src/dart) |
| 15 # and Dart (dart-git/dart). |
| 13 dart_dir = os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file_
_), '..', '..', '..'))) | 16 dart_dir = os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file_
_), '..', '..', '..'))) |
| 14 sys.path.insert(1, os.path.join(dart_dir, 'tools/dom/new_scripts')) | 17 sys.path.insert(1, os.path.join(dart_dir, 'tools/dom/new_scripts')) |
| 15 sys.path.insert(1, os.path.join(dart_dir, 'third_party/WebCore/bindings/scripts'
)) | 18 sys.path.insert(1, os.path.join(dart_dir, 'third_party/WebCore/bindings/scripts'
)) |
| 16 sys.path.insert(1, os.path.join(dart_dir, 'third_party')) | 19 |
| 20 # Dartium's third_party directory location is dartium-git/src/third_party |
| 21 # and Dart's third_party directory location is dart-git/dart/third_party. |
| 22 third_party_dir = os.path.join(dart_dir, 'third_party') |
| 23 |
| 24 ply_dir = os.path.join(third_party_dir, 'ply') |
| 25 # If ply directory found then we're a Dart enlistment; third_party location |
| 26 # is dart-git/dart/third_party |
| 27 if not os.path.exists(ply_dir): |
| 28 # For Dartium (ply directory is dartium-git/src/third_party/ply) third_party |
| 29 # location is dartium-git/src/third_party |
| 30 third_party_dir = os.path.join(dart_dir, '..', 'third_party') |
| 31 assert(os.path.exists(third_party_dir)) |
| 32 sys.path.insert(1, third_party_dir) |
| 33 |
| 17 sys.path.insert(1, os.path.join(dart_dir, 'tools/dom/scripts')) | 34 sys.path.insert(1, os.path.join(dart_dir, 'tools/dom/scripts')) |
| 18 | 35 |
| 19 import dartgenerator | 36 import dartgenerator |
| 20 import database | 37 import database |
| 21 import fremontcutbuilder | 38 import fremontcutbuilder |
| 22 import logging | 39 import logging |
| 23 import monitored | 40 import monitored |
| 24 import multiemitter | 41 import multiemitter |
| 25 import optparse | 42 import optparse |
| 26 import shutil | 43 import shutil |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 os.path.join('..', '..', '..', 'sdk', 'lib', '_blink', 'dartium')) | 310 os.path.join('..', '..', '..', 'sdk', 'lib', '_blink', 'dartium')) |
| 294 | 311 |
| 295 print '\nGenerating single file %s seconds' % round(time.time() - file_generat
ion_start_time, 2) | 312 print '\nGenerating single file %s seconds' % round(time.time() - file_generat
ion_start_time, 2) |
| 296 | 313 |
| 297 end_time = time.time() | 314 end_time = time.time() |
| 298 | 315 |
| 299 print '\nDone (dartdomgenerator) %s seconds' % round(end_time - start_time, 2) | 316 print '\nDone (dartdomgenerator) %s seconds' % round(end_time - start_time, 2) |
| 300 | 317 |
| 301 if __name__ == '__main__': | 318 if __name__ == '__main__': |
| 302 sys.exit(main()) | 319 sys.exit(main()) |
| OLD | NEW |