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 11 matching lines...) Expand all Loading... |
22 third_party_dir = os.path.join(dart_dir, 'third_party') | 22 third_party_dir = os.path.join(dart_dir, 'third_party') |
23 | 23 |
24 ply_dir = os.path.join(third_party_dir, 'ply') | 24 ply_dir = os.path.join(third_party_dir, 'ply') |
25 # If ply directory found then we're a Dart enlistment; third_party location | 25 # If ply directory found then we're a Dart enlistment; third_party location |
26 # is dart-git/dart/third_party | 26 # is dart-git/dart/third_party |
27 if not os.path.exists(ply_dir): | 27 if not os.path.exists(ply_dir): |
28 # For Dartium (ply directory is dartium-git/src/third_party/ply) third_party | 28 # For Dartium (ply directory is dartium-git/src/third_party/ply) third_party |
29 # location is dartium-git/src/third_party | 29 # location is dartium-git/src/third_party |
30 third_party_dir = os.path.join(dart_dir, '..', 'third_party') | 30 third_party_dir = os.path.join(dart_dir, '..', 'third_party') |
31 assert(os.path.exists(third_party_dir)) | 31 assert(os.path.exists(third_party_dir)) |
| 32 else: |
| 33 # It's Dart we need to make sure that tools in injected in our search path |
| 34 # because this is where idl_parser is located for a Dart enlistment. Dartium |
| 35 # can firgure out the tools directory because of the location of where the |
| 36 # scripts blink scripts are located. |
| 37 tools_dir = os.path.join(dart_dir, 'tools') |
| 38 sys.path.insert(1, tools_dir) |
| 39 |
32 sys.path.insert(1, third_party_dir) | 40 sys.path.insert(1, third_party_dir) |
33 | 41 |
34 sys.path.insert(1, os.path.join(dart_dir, 'tools/dom/scripts')) | 42 sys.path.insert(1, os.path.join(dart_dir, 'tools/dom/scripts')) |
35 | 43 |
36 import dartgenerator | 44 import dartgenerator |
37 import database | 45 import database |
38 import fremontcutbuilder | 46 import fremontcutbuilder |
39 import logging | 47 import logging |
40 import monitored | 48 import monitored |
41 import multiemitter | 49 import multiemitter |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 os.path.join('..', '..', '..', 'sdk', 'lib', '_blink', 'dartium')) | 336 os.path.join('..', '..', '..', 'sdk', 'lib', '_blink', 'dartium')) |
329 | 337 |
330 print '\nGenerating single file %s seconds' % round(time.time() - file_generat
ion_start_time, 2) | 338 print '\nGenerating single file %s seconds' % round(time.time() - file_generat
ion_start_time, 2) |
331 | 339 |
332 end_time = time.time() | 340 end_time = time.time() |
333 | 341 |
334 print '\nDone (dartdomgenerator) %s seconds' % round(end_time - start_time, 2) | 342 print '\nDone (dartdomgenerator) %s seconds' % round(end_time - start_time, 2) |
335 | 343 |
336 if __name__ == '__main__': | 344 if __name__ == '__main__': |
337 sys.exit(main()) | 345 sys.exit(main()) |
OLD | NEW |