| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 | 147 |
| 148 | 148 |
| 149 def Main(argv): | 149 def Main(argv): |
| 150 # Pull in all of the gpyi files which will be munged into the sdk. | 150 # Pull in all of the gpyi files which will be munged into the sdk. |
| 151 io_runtime_sources = \ | 151 io_runtime_sources = \ |
| 152 (eval(open("runtime/bin/io_sources.gypi").read()))['sources'] | 152 (eval(open("runtime/bin/io_sources.gypi").read()))['sources'] |
| 153 | 153 |
| 154 HOME = dirname(dirname(realpath(__file__))) | 154 HOME = dirname(dirname(realpath(__file__))) |
| 155 | 155 |
| 156 SDK_tmp = tempfile.mkdtemp() | |
| 157 SDK = argv[1] | 156 SDK = argv[1] |
| 157 SDK_tmp = '%s.tmp' % SDK |
| 158 | 158 |
| 159 # TODO(dgrove) - deal with architectures that are not ia32. | 159 # TODO(dgrove) - deal with architectures that are not ia32. |
| 160 | 160 |
| 161 if exists(SDK): | 161 if exists(SDK): |
| 162 rmtree(SDK) | 162 rmtree(SDK) |
| 163 | 163 |
| 164 if exists(SDK_tmp): |
| 165 rmtree(SDK_tmp) |
| 166 |
| 167 os.makedirs(SDK_tmp) |
| 168 |
| 164 # Create and populate sdk/bin. | 169 # Create and populate sdk/bin. |
| 165 BIN = join(SDK_tmp, 'bin') | 170 BIN = join(SDK_tmp, 'bin') |
| 166 os.makedirs(BIN) | 171 os.makedirs(BIN) |
| 167 | 172 |
| 168 # Copy the Dart VM binary and the Windows Dart VM link library | 173 # Copy the Dart VM binary and the Windows Dart VM link library |
| 169 # into sdk/bin. | 174 # into sdk/bin. |
| 170 # | 175 # |
| 171 # TODO(dgrove) - deal with architectures that are not ia32. | 176 # TODO(dgrove) - deal with architectures that are not ia32. |
| 172 build_dir = os.path.dirname(argv[1]) | 177 build_dir = os.path.dirname(argv[1]) |
| 173 dart_file_extension = '' | 178 dart_file_extension = '' |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 349 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
| 345 f.write(revision + '\n') | 350 f.write(revision + '\n') |
| 346 f.close() | 351 f.close() |
| 347 | 352 |
| 348 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) | 353 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) |
| 349 | 354 |
| 350 move(SDK_tmp, SDK) | 355 move(SDK_tmp, SDK) |
| 351 | 356 |
| 352 if __name__ == '__main__': | 357 if __name__ == '__main__': |
| 353 sys.exit(Main(sys.argv)) | 358 sys.exit(Main(sys.argv)) |
| OLD | NEW |