| 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 src_dir = join(HOME, 'pkg', library) | 420 src_dir = join(HOME, 'pkg', library) |
| 421 dest_dir = join(PKG, library) | 421 dest_dir = join(PKG, library) |
| 422 os.makedirs(dest_dir) | 422 os.makedirs(dest_dir) |
| 423 | 423 |
| 424 for filename in os.listdir(src_dir): | 424 for filename in os.listdir(src_dir): |
| 425 if filename.endswith('.dart'): | 425 if filename.endswith('.dart'): |
| 426 copyfile(join(src_dir, filename), join(dest_dir, filename)) | 426 copyfile(join(src_dir, filename), join(dest_dir, filename)) |
| 427 | 427 |
| 428 # Create and populate pkg/dartdoc. | 428 # Create and populate pkg/dartdoc. |
| 429 dartdoc_src_dir = join(HOME, 'pkg', 'dartdoc') | 429 dartdoc_src_dir = join(HOME, 'pkg', 'dartdoc') |
| 430 dartdoc_dest_dir = join(LIB, 'dartdoc') | 430 dartdoc_dest_dir = join(PKG, 'dartdoc') |
| 431 copytree(dartdoc_src_dir, dartdoc_dest_dir, | 431 copytree(dartdoc_src_dir, dartdoc_dest_dir, |
| 432 ignore=ignore_patterns('.svn', 'docs')) | 432 ignore=ignore_patterns('.svn', 'docs')) |
| 433 | 433 |
| 434 # Fixup dart2js dependencies. | 434 # Fixup dart2js dependencies. |
| 435 ReplaceInFiles([ | 435 ReplaceInFiles([ |
| 436 join(LIB, 'dartdoc', 'dartdoc.dart'), | 436 join(PKG, 'dartdoc', 'dartdoc.dart'), |
| 437 ], [ | 437 ], [ |
| 438 ("final bool IN_SDK = false;", | 438 ("final bool IN_SDK = false;", |
| 439 "final bool IN_SDK = true;"), | 439 "final bool IN_SDK = true;"), |
| 440 ]) | 440 ]) |
| 441 | 441 |
| 442 | 442 |
| 443 # Create and copy tools. | 443 # Create and copy tools. |
| 444 UTIL = join(SDK_tmp, 'util') | 444 UTIL = join(SDK_tmp, 'util') |
| 445 os.makedirs(UTIL) | 445 os.makedirs(UTIL) |
| 446 | 446 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 if revision is not None: | 486 if revision is not None: |
| 487 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 487 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
| 488 f.write(revision + '\n') | 488 f.write(revision + '\n') |
| 489 f.close() | 489 f.close() |
| 490 | 490 |
| 491 move(SDK_tmp, SDK) | 491 move(SDK_tmp, SDK) |
| 492 utils.Touch(os.path.join(SDK, 'create.stamp')) | 492 utils.Touch(os.path.join(SDK, 'create.stamp')) |
| 493 | 493 |
| 494 if __name__ == '__main__': | 494 if __name__ == '__main__': |
| 495 sys.exit(Main(sys.argv)) | 495 sys.exit(Main(sys.argv)) |
| OLD | NEW |