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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 dom_dest_dir = join(LIB, 'dom') | 330 dom_dest_dir = join(LIB, 'dom') |
331 os.makedirs(dom_dest_dir) | 331 os.makedirs(dom_dest_dir) |
332 | 332 |
333 copyfile(join(dom_src_dir, 'dart2js', 'dom_dart2js.dart'), | 333 copyfile(join(dom_src_dir, 'dart2js', 'dom_dart2js.dart'), |
334 join(dom_dest_dir, 'dom_dart2js.dart')) | 334 join(dom_dest_dir, 'dom_dart2js.dart')) |
335 | 335 |
336 # | 336 # |
337 # Create and populate lib/{crypto, json, uri, utf, ...}. | 337 # Create and populate lib/{crypto, json, uri, utf, ...}. |
338 # | 338 # |
339 | 339 |
340 for library in ['args', 'crypto', 'json', 'math', 'unittest', 'uri', | 340 for library in ['args', 'crypto', 'json', 'math', 'uri', 'utf', 'web']: |
341 'utf', 'web']: | |
342 src_dir = join(HOME, 'lib', library) | 341 src_dir = join(HOME, 'lib', library) |
343 dest_dir = join(LIB, library) | 342 dest_dir = join(LIB, library) |
344 os.makedirs(dest_dir) | 343 os.makedirs(dest_dir) |
345 | 344 |
346 for filename in os.listdir(src_dir): | 345 for filename in os.listdir(src_dir): |
347 if filename.endswith('.dart'): | 346 if filename.endswith('.dart'): |
348 copyfile(join(src_dir, filename), join(dest_dir, filename)) | 347 copyfile(join(src_dir, filename), join(dest_dir, filename)) |
349 | 348 |
350 # Create and populate lib/dartdoc. | 349 # Create and populate lib/dartdoc. |
351 dartdoc_src_dir = join(HOME, 'lib', 'dartdoc') | 350 dartdoc_src_dir = join(HOME, 'lib', 'dartdoc') |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 | 423 |
425 | 424 |
426 # Create and copy pkg. | 425 # Create and copy pkg. |
427 PKG = join(SDK_tmp, 'pkg') | 426 PKG = join(SDK_tmp, 'pkg') |
428 os.makedirs(PKG) | 427 os.makedirs(PKG) |
429 | 428 |
430 # | 429 # |
431 # Create and populate pkg/{i18n, logging} | 430 # Create and populate pkg/{i18n, logging} |
432 # | 431 # |
433 | 432 |
434 for library in ['i18n', 'logging']: | 433 for library in ['i18n', 'logging', 'unittest']: |
435 src_dir = join(HOME, 'pkg', library) | 434 src_dir = join(HOME, 'pkg', library) |
436 dest_dir = join(PKG, library) | 435 dest_dir = join(PKG, library) |
437 os.makedirs(dest_dir) | 436 os.makedirs(dest_dir) |
438 | 437 |
439 for filename in os.listdir(src_dir): | 438 for filename in os.listdir(src_dir): |
440 if filename.endswith('.dart'): | 439 if filename.endswith('.dart'): |
441 copyfile(join(src_dir, filename), join(dest_dir, filename)) | 440 copyfile(join(src_dir, filename), join(dest_dir, filename)) |
442 | 441 |
443 # Create and copy tools. | 442 # Create and copy tools. |
444 UTIL = join(SDK_tmp, 'util') | 443 UTIL = join(SDK_tmp, 'util') |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 if revision is not None: | 485 if revision is not None: |
487 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 486 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
488 f.write(revision + '\n') | 487 f.write(revision + '\n') |
489 f.close() | 488 f.close() |
490 | 489 |
491 move(SDK_tmp, SDK) | 490 move(SDK_tmp, SDK) |
492 utils.Touch(os.path.join(SDK, 'create.stamp')) | 491 utils.Touch(os.path.join(SDK, 'create.stamp')) |
493 | 492 |
494 if __name__ == '__main__': | 493 if __name__ == '__main__': |
495 sys.exit(Main(sys.argv)) | 494 sys.exit(Main(sys.argv)) |
OLD | NEW |