| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 # ........(implementation files) | 50 # ........(implementation files) |
| 51 # ......json/ | 51 # ......json/ |
| 52 # ........json_frog.dart | 52 # ........json_frog.dart |
| 53 #.........json.dart | 53 #.........json.dart |
| 54 # ........{frog}/ | 54 # ........{frog}/ |
| 55 # ......uri/ | 55 # ......uri/ |
| 56 # ........uri.dart | 56 # ........uri.dart |
| 57 # ......utf/ | 57 # ......utf/ |
| 58 # ......web/ | 58 # ......web/ |
| 59 # ........web.dart | 59 # ........web.dart |
| 60 # ....pkg/ |
| 61 # ......i18n/ |
| 62 # ......logging/ |
| 60 # ......(more will come here) | 63 # ......(more will come here) |
| 61 # ....util/ | 64 # ....util/ |
| 62 # ......analyzer/ | 65 # ......analyzer/ |
| 63 # ........dart_analyzer.jar | 66 # ........dart_analyzer.jar |
| 64 # ........(third-party libraries for dart_analyzer) | 67 # ........(third-party libraries for dart_analyzer) |
| 65 # ......pub/ | 68 # ......pub/ |
| 66 # ......(more will come here) | 69 # ......(more will come here) |
| 67 | 70 |
| 68 | 71 |
| 69 | 72 |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 dom_dest_dir = join(LIB, 'dom') | 330 dom_dest_dir = join(LIB, 'dom') |
| 328 os.makedirs(dom_dest_dir) | 331 os.makedirs(dom_dest_dir) |
| 329 | 332 |
| 330 copyfile(join(dom_src_dir, 'dart2js', 'dom_dart2js.dart'), | 333 copyfile(join(dom_src_dir, 'dart2js', 'dom_dart2js.dart'), |
| 331 join(dom_dest_dir, 'dom_dart2js.dart')) | 334 join(dom_dest_dir, 'dom_dart2js.dart')) |
| 332 | 335 |
| 333 # | 336 # |
| 334 # Create and populate lib/{crypto, json, uri, utf, ...}. | 337 # Create and populate lib/{crypto, json, uri, utf, ...}. |
| 335 # | 338 # |
| 336 | 339 |
| 337 for library in ['args', 'crypto', 'i18n', 'json', 'math', 'unittest', 'uri', | 340 for library in ['args', 'crypto', 'json', 'math', 'unittest', 'uri', |
| 338 'utf', 'web']: | 341 'utf', 'web']: |
| 339 src_dir = join(HOME, 'lib', library) | 342 src_dir = join(HOME, 'lib', library) |
| 340 dest_dir = join(LIB, library) | 343 dest_dir = join(LIB, library) |
| 341 os.makedirs(dest_dir) | 344 os.makedirs(dest_dir) |
| 342 | 345 |
| 343 for filename in os.listdir(src_dir): | 346 for filename in os.listdir(src_dir): |
| 344 if filename.endswith('.dart'): | 347 if filename.endswith('.dart'): |
| 345 copyfile(join(src_dir, filename), join(dest_dir, filename)) | 348 copyfile(join(src_dir, filename), join(dest_dir, filename)) |
| 346 | 349 |
| 347 # Create and populate lib/dartdoc. | 350 # Create and populate lib/dartdoc. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 # Construct lib/coreimpl/coreimpl_runtime.dart from whole cloth. | 415 # Construct lib/coreimpl/coreimpl_runtime.dart from whole cloth. |
| 413 dest_file = open(join(coreimpl_dest_dir, 'coreimpl_runtime.dart'), 'w') | 416 dest_file = open(join(coreimpl_dest_dir, 'coreimpl_runtime.dart'), 'w') |
| 414 dest_file.write('#library("dart:coreimpl");\n') | 417 dest_file.write('#library("dart:coreimpl");\n') |
| 415 for filename in coreimpl_sources: | 418 for filename in coreimpl_sources: |
| 416 dest_file.write('#source("runtime/' + filename + '");\n') | 419 dest_file.write('#source("runtime/' + filename + '");\n') |
| 417 for filename in coreimpl_runtime_sources: | 420 for filename in coreimpl_runtime_sources: |
| 418 if filename.endswith('.dart'): | 421 if filename.endswith('.dart'): |
| 419 dest_file.write('#source("runtime/' + filename + '");\n') | 422 dest_file.write('#source("runtime/' + filename + '");\n') |
| 420 dest_file.close() | 423 dest_file.close() |
| 421 | 424 |
| 425 |
| 426 # Create and copy pkg. |
| 427 PKG = join(SDK_tmp, 'pkg') |
| 428 os.makedirs(PKG) |
| 429 |
| 430 # |
| 431 # Create and populate pkg/{i18n, logging} |
| 432 # |
| 433 |
| 434 for library in ['i18n', 'logging']: |
| 435 src_dir = join(HOME, 'pkg', library) |
| 436 dest_dir = join(PKG, library) |
| 437 os.makedirs(dest_dir) |
| 438 |
| 439 for filename in os.listdir(src_dir): |
| 440 if filename.endswith('.dart'): |
| 441 copyfile(join(src_dir, filename), join(dest_dir, filename)) |
| 442 |
| 422 # Create and copy tools. | 443 # Create and copy tools. |
| 423 UTIL = join(SDK_tmp, 'util') | 444 UTIL = join(SDK_tmp, 'util') |
| 424 os.makedirs(UTIL) | 445 os.makedirs(UTIL) |
| 425 | 446 |
| 426 if ShouldCopyAnalyzer(): | 447 if ShouldCopyAnalyzer(): |
| 427 # Create and copy Analyzer library into 'util' | 448 # Create and copy Analyzer library into 'util' |
| 428 ANALYZER_DEST = join(UTIL, 'analyzer') | 449 ANALYZER_DEST = join(UTIL, 'analyzer') |
| 429 os.makedirs(ANALYZER_DEST) | 450 os.makedirs(ANALYZER_DEST) |
| 430 | 451 |
| 431 analyzer_src_jar = join(ANALYZER_HOME, 'util', 'analyzer', | 452 analyzer_src_jar = join(ANALYZER_HOME, 'util', 'analyzer', |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 if revision is not None: | 486 if revision is not None: |
| 466 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 487 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
| 467 f.write(revision + '\n') | 488 f.write(revision + '\n') |
| 468 f.close() | 489 f.close() |
| 469 | 490 |
| 470 move(SDK_tmp, SDK) | 491 move(SDK_tmp, SDK) |
| 471 utils.Touch(os.path.join(SDK, 'create.stamp')) | 492 utils.Touch(os.path.join(SDK, 'create.stamp')) |
| 472 | 493 |
| 473 if __name__ == '__main__': | 494 if __name__ == '__main__': |
| 474 sys.exit(Main(sys.argv)) | 495 sys.exit(Main(sys.argv)) |
| OLD | NEW |