Chromium Code Reviews| 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 # |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 #.........json.dart | 51 #.........json.dart |
| 52 # ........{frog}/ | 52 # ........{frog}/ |
| 53 # ......uri/ | 53 # ......uri/ |
| 54 # ........uri.dart | 54 # ........uri.dart |
| 55 # ......utf/ | 55 # ......utf/ |
| 56 # ......web/ | 56 # ......web/ |
| 57 # ........web.dart | 57 # ........web.dart |
| 58 # ....pkg/ | 58 # ....pkg/ |
| 59 # ......args/ | 59 # ......args/ |
| 60 # ......dartdoc/ | 60 # ......dartdoc/ |
| 61 # ......i18n/ | 61 # ......intl/ |
| 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) |
| 70 | 70 |
| 71 | 71 |
| (...skipping 331 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/{args, i18n, logging, unittest} | 413 # Create and populate pkg/{args, intl, logging, unittest} |
| 414 # | 414 # |
| 415 | 415 |
| 416 for library in ['args', 'i18n', 'logging', 'unittest']: | 416 for library in ['args', 'intl', '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 if exists(join(src_dir, 'lib')): | |
| 425 copytree(join(src_dir, 'lib'), join(dest_dir, 'lib')) | |
|
Emily Fortuna
2012/08/21 00:47:47
what are these lines for?
Alan Knight
2012/08/21 04:49:55
Packages can have a lib directory with pieces that
| |
| 424 | 426 |
| 425 # Create and populate pkg/dartdoc. | 427 # Create and populate pkg/dartdoc. |
| 426 dartdoc_src_dir = join(HOME, 'pkg', 'dartdoc') | 428 dartdoc_src_dir = join(HOME, 'pkg', 'dartdoc') |
| 427 dartdoc_dest_dir = join(PKG, 'dartdoc') | 429 dartdoc_dest_dir = join(PKG, 'dartdoc') |
| 428 copytree(dartdoc_src_dir, dartdoc_dest_dir, | 430 copytree(dartdoc_src_dir, dartdoc_dest_dir, |
| 429 ignore=ignore_patterns('.svn', 'docs')) | 431 ignore=ignore_patterns('.svn', 'docs')) |
| 430 | 432 |
| 431 # Fixup dart2js dependencies. | 433 # Fixup dart2js dependencies. |
| 432 ReplaceInFiles([ | 434 ReplaceInFiles([ |
| 433 join(PKG, 'dartdoc', 'dartdoc.dart'), | 435 join(PKG, 'dartdoc', 'dartdoc.dart'), |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 483 if revision is not None: | 485 if revision is not None: |
| 484 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 486 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
| 485 f.write(revision + '\n') | 487 f.write(revision + '\n') |
| 486 f.close() | 488 f.close() |
| 487 | 489 |
| 488 move(SDK_tmp, SDK) | 490 move(SDK_tmp, SDK) |
| 489 utils.Touch(os.path.join(SDK, 'create.stamp')) | 491 utils.Touch(os.path.join(SDK, 'create.stamp')) |
| 490 | 492 |
| 491 if __name__ == '__main__': | 493 if __name__ == '__main__': |
| 492 sys.exit(Main(sys.argv)) | 494 sys.exit(Main(sys.argv)) |
| OLD | NEW |