OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 # | 6 # |
7 # A script which will be invoked from gyp to create an SDK. | 7 # A script which will be invoked from gyp to create an SDK. |
8 # | 8 # |
9 # Usage: create_sdk.py sdk_directory | 9 # Usage: create_sdk.py sdk_directory |
10 # | 10 # |
11 # The SDK will be used either from the command-line or from the editor. | 11 # The SDK will be used either from the command-line or from the editor. |
12 # Top structure is | 12 # Top structure is |
13 # | 13 # |
14 # ..dart-sdk/ | 14 # ..dart-sdk/ |
15 # ....bin/ | 15 # ....bin/ |
16 # ......dart or dart.exe (executable) | 16 # ......dart or dart.exe (executable) |
17 # ......dart.lib (import library for VM native extensions on Windows) | 17 # ......dart.lib (import library for VM native extensions on Windows) |
18 # ......dart2js | 18 # ......dart2js |
19 # ......dart_analyzer | 19 # ......dart_analyzer |
20 # ......pub | 20 # ......pub |
21 # ....include/ | 21 # ....include/ |
22 # ......dart_api.h | 22 # ......dart_api.h |
23 # ......dart_debugger_api.h | 23 # ......dart_debugger_api.h |
24 # ....lib/ | 24 # ....lib/ |
25 # ......args/ | |
26 # ......builtin/ | 25 # ......builtin/ |
27 # ........builtin_runtime.dart | 26 # ........builtin_runtime.dart |
28 # ......io/ | 27 # ......io/ |
29 # ........io_runtime.dart | 28 # ........io_runtime.dart |
30 # ........runtime/ | 29 # ........runtime/ |
31 # ......compiler/ | 30 # ......compiler/ |
32 # ......core/ | 31 # ......core/ |
33 # ........core_runtime.dart | 32 # ........core_runtime.dart |
34 # ........runtime/ | 33 # ........runtime/ |
35 # ......coreimpl/ | 34 # ......coreimpl/ |
(...skipping 14 matching lines...) Expand all Loading... |
50 # ......json/ | 49 # ......json/ |
51 # ........json_frog.dart | 50 # ........json_frog.dart |
52 #.........json.dart | 51 #.........json.dart |
53 # ........{frog}/ | 52 # ........{frog}/ |
54 # ......uri/ | 53 # ......uri/ |
55 # ........uri.dart | 54 # ........uri.dart |
56 # ......utf/ | 55 # ......utf/ |
57 # ......web/ | 56 # ......web/ |
58 # ........web.dart | 57 # ........web.dart |
59 # ....pkg/ | 58 # ....pkg/ |
| 59 # ......args/ |
60 # ......dartdoc/ | 60 # ......dartdoc/ |
61 # ......i18n/ | 61 # ......i18n/ |
62 # ......logging/ | 62 # ......logging/ |
63 # ......(more will come here) | 63 # ......(more will come here) |
64 # ....util/ | 64 # ....util/ |
65 # ......analyzer/ | 65 # ......analyzer/ |
66 # ........dart_analyzer.jar | 66 # ........dart_analyzer.jar |
67 # ........(third-party libraries for dart_analyzer) | 67 # ........(third-party libraries for dart_analyzer) |
68 # ......pub/ | 68 # ......pub/ |
69 # ......(more will come here) | 69 # ......(more will come here) |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 dom_dest_dir = join(LIB, 'dom') | 327 dom_dest_dir = join(LIB, 'dom') |
328 os.makedirs(dom_dest_dir) | 328 os.makedirs(dom_dest_dir) |
329 | 329 |
330 copyfile(join(dom_src_dir, 'dart2js', 'dom_dart2js.dart'), | 330 copyfile(join(dom_src_dir, 'dart2js', 'dom_dart2js.dart'), |
331 join(dom_dest_dir, 'dom_dart2js.dart')) | 331 join(dom_dest_dir, 'dom_dart2js.dart')) |
332 | 332 |
333 # | 333 # |
334 # Create and populate lib/{crypto, json, uri, utf, ...}. | 334 # Create and populate lib/{crypto, json, uri, utf, ...}. |
335 # | 335 # |
336 | 336 |
337 for library in ['args', 'crypto', 'json', 'math', 'uri', 'utf', 'web']: | 337 for library in ['crypto', 'json', 'math', 'uri', 'utf', 'web']: |
338 src_dir = join(HOME, 'lib', library) | 338 src_dir = join(HOME, 'lib', library) |
339 dest_dir = join(LIB, library) | 339 dest_dir = join(LIB, library) |
340 os.makedirs(dest_dir) | 340 os.makedirs(dest_dir) |
341 | 341 |
342 for filename in os.listdir(src_dir): | 342 for filename in os.listdir(src_dir): |
343 if filename.endswith('.dart'): | 343 if filename.endswith('.dart'): |
344 copyfile(join(src_dir, filename), join(dest_dir, filename)) | 344 copyfile(join(src_dir, filename), join(dest_dir, filename)) |
345 | 345 |
346 # Create and populate lib/isolate | 346 # Create and populate lib/isolate |
347 copytree(join(HOME, 'lib', 'isolate'), join(LIB, 'isolate'), | 347 copytree(join(HOME, 'lib', 'isolate'), join(LIB, 'isolate'), |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 if filename.endswith('.dart') and not filename.endswith('_patch.dart'): | 403 if filename.endswith('.dart') and not filename.endswith('_patch.dart'): |
404 dest_file.write('#source("runtime/' + filename + '");\n') | 404 dest_file.write('#source("runtime/' + filename + '");\n') |
405 dest_file.close() | 405 dest_file.close() |
406 | 406 |
407 | 407 |
408 # Create and copy pkg. | 408 # Create and copy pkg. |
409 PKG = join(SDK_tmp, 'pkg') | 409 PKG = join(SDK_tmp, 'pkg') |
410 os.makedirs(PKG) | 410 os.makedirs(PKG) |
411 | 411 |
412 # | 412 # |
413 # Create and populate pkg/{i18n, logging} | 413 # Create and populate pkg/{args, i18n, logging, unittest} |
414 # | 414 # |
415 | 415 |
416 for library in ['i18n', 'logging', 'unittest']: | 416 for library in ['args', 'i18n', 'logging', 'unittest']: |
417 src_dir = join(HOME, 'pkg', library) | 417 src_dir = join(HOME, 'pkg', library) |
418 dest_dir = join(PKG, library) | 418 dest_dir = join(PKG, library) |
419 os.makedirs(dest_dir) | 419 os.makedirs(dest_dir) |
420 | 420 |
421 for filename in os.listdir(src_dir): | 421 for filename in os.listdir(src_dir): |
422 if filename.endswith('.dart'): | 422 if filename.endswith('.dart'): |
423 copyfile(join(src_dir, filename), join(dest_dir, filename)) | 423 copyfile(join(src_dir, filename), join(dest_dir, filename)) |
424 | 424 |
425 # Create and populate pkg/dartdoc. | 425 # Create and populate pkg/dartdoc. |
426 dartdoc_src_dir = join(HOME, 'pkg', 'dartdoc') | 426 dartdoc_src_dir = join(HOME, 'pkg', 'dartdoc') |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 if revision is not None: | 483 if revision is not None: |
484 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 484 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
485 f.write(revision + '\n') | 485 f.write(revision + '\n') |
486 f.close() | 486 f.close() |
487 | 487 |
488 move(SDK_tmp, SDK) | 488 move(SDK_tmp, SDK) |
489 utils.Touch(os.path.join(SDK, 'create.stamp')) | 489 utils.Touch(os.path.join(SDK, 'create.stamp')) |
490 | 490 |
491 if __name__ == '__main__': | 491 if __name__ == '__main__': |
492 sys.exit(Main(sys.argv)) | 492 sys.exit(Main(sys.argv)) |
OLD | NEW |