| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 if exists(SDK): | 88 if exists(SDK): |
| 89 rmtree(SDK) | 89 rmtree(SDK) |
| 90 | 90 |
| 91 # Create and populate sdk/bin. | 91 # Create and populate sdk/bin. |
| 92 BIN = join(SDK_tmp, 'bin') | 92 BIN = join(SDK_tmp, 'bin') |
| 93 os.makedirs(BIN) | 93 os.makedirs(BIN) |
| 94 | 94 |
| 95 # Copy the Dart VM binary into sdk/bin. | 95 # Copy the Dart VM binary into sdk/bin. |
| 96 # TODO(dgrove) - deal with architectures that are not ia32. | 96 # TODO(dgrove) - deal with architectures that are not ia32. |
| 97 build_dir = os.path.dirname(argv[1]) | 97 build_dir = os.path.dirname(argv[1]) |
| 98 frogc_src_binary = join(HOME, 'frog', 'frogc') |
| 99 frogc_dest_binary = join(BIN, 'frogc') |
| 98 if utils.GuessOS() == 'win32': | 100 if utils.GuessOS() == 'win32': |
| 99 # TODO(dgrove) - deal with frogc.bat | 101 # TODO(dgrove) - deal with frogc.bat |
| 100 dart_src_binary = join(HOME, build_dir, 'dart.exe') | 102 dart_src_binary = join(HOME, build_dir, 'dart.exe') |
| 101 dart_dest_binary = join(BIN, 'dart.exe') | 103 dart_dest_binary = join(BIN, 'dart.exe') |
| 102 else: | 104 else: |
| 103 frogc_src_binary = join(HOME, 'frog', 'frogc') | |
| 104 dart_src_binary = join(HOME, build_dir, 'dart') | 105 dart_src_binary = join(HOME, build_dir, 'dart') |
| 105 dart_dest_binary = join(BIN, 'dart') | 106 dart_dest_binary = join(BIN, 'dart') |
| 106 frogc_dest_binary = join(BIN, 'frogc') | |
| 107 copyfile(dart_src_binary, dart_dest_binary) | 107 copyfile(dart_src_binary, dart_dest_binary) |
| 108 copymode(dart_src_binary, dart_dest_binary) | 108 copymode(dart_src_binary, dart_dest_binary) |
| 109 copyfile(frogc_src_binary, frogc_dest_binary) | 109 copyfile(frogc_src_binary, frogc_dest_binary) |
| 110 copymode(frogc_src_binary, frogc_dest_binary) | 110 copymode(frogc_src_binary, frogc_dest_binary) |
| 111 | 111 |
| 112 # Create sdk/bin/frogc.dart, and hack as needed. | 112 # Create sdk/bin/frogc.dart, and hack as needed. |
| 113 frog_src_dir = join(HOME, 'frog') | 113 frog_src_dir = join(HOME, 'frog') |
| 114 | 114 |
| 115 # Convert frogc.dart's imports from import('*') -> import('frog/*'). | 115 # Convert frogc.dart's imports from import('*') -> import('frog/*'). |
| 116 frogc_contents = open(join(frog_src_dir, 'frogc.dart')).read() | 116 frogc_contents = open(join(frog_src_dir, 'frogc.dart')).read() |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 UTIL = join(SDK_tmp, 'util') | 373 UTIL = join(SDK_tmp, 'util') |
| 374 os.makedirs(UTIL) | 374 os.makedirs(UTIL) |
| 375 | 375 |
| 376 copytree(join(HOME, 'utils', 'dartdoc'), join(UTIL, 'dartdoc'), | 376 copytree(join(HOME, 'utils', 'dartdoc'), join(UTIL, 'dartdoc'), |
| 377 ignore=ignore_patterns('.svn')) | 377 ignore=ignore_patterns('.svn')) |
| 378 | 378 |
| 379 move(SDK_tmp, SDK) | 379 move(SDK_tmp, SDK) |
| 380 | 380 |
| 381 if __name__ == '__main__': | 381 if __name__ == '__main__': |
| 382 sys.exit(Main(sys.argv)) | 382 sys.exit(Main(sys.argv)) |
| OLD | NEW |