Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: tools/create_sdk.py

Issue 11226059: Create temp directory for sdk inside the dart directory. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698