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

Side by Side Diff: tools/create_sdk.py

Issue 9704067: Move print from builtin to core in runtime SDK sources only (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 months 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) 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 # 157 #
158 # Create and populate lib/builtin. 158 # Create and populate lib/builtin.
159 # 159 #
160 builtin_dest_dir = join(LIB, 'builtin') 160 builtin_dest_dir = join(LIB, 'builtin')
161 os.makedirs(builtin_dest_dir) 161 os.makedirs(builtin_dest_dir)
162 assert len(builtin_runtime_sources) == 1 162 assert len(builtin_runtime_sources) == 1
163 assert builtin_runtime_sources[0] == 'builtin.dart' 163 assert builtin_runtime_sources[0] == 'builtin.dart'
164 copyfile(join(HOME, 'runtime', 'bin', 'builtin.dart'), 164 copyfile(join(HOME, 'runtime', 'bin', 'builtin.dart'),
165 join(builtin_dest_dir, 'builtin_runtime.dart')) 165 join(builtin_dest_dir, 'builtin_runtime.dart'))
166 166 #
167 # rename the print function in dart:builtin
168 # so that it does not conflict with the print function in dart:core
169 #
170 ReplaceInFiles([
171 join(builtin_dest_dir, 'builtin_runtime.dart')
172 ], [
173 ('void print\(', 'void builtinPrint(')
174 ])
devoncarew 2012/03/15 22:06:26 If I understand the chronology correctly, dart:bui
167 175
168 # 176 #
169 # Create and populate lib/io. 177 # Create and populate lib/io.
170 # 178 #
171 io_dest_dir = join(LIB, 'io') 179 io_dest_dir = join(LIB, 'io')
172 os.makedirs(io_dest_dir) 180 os.makedirs(io_dest_dir)
173 os.makedirs(join(io_dest_dir, 'runtime')) 181 os.makedirs(join(io_dest_dir, 'runtime'))
174 for filename in io_runtime_sources: 182 for filename in io_runtime_sources:
175 assert filename.endswith('.dart') 183 assert filename.endswith('.dart')
176 if filename == 'io.dart': 184 if filename == 'io.dart':
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 342
335 # construct lib/core_runtime.dart from whole cloth. 343 # construct lib/core_runtime.dart from whole cloth.
336 dest_file = open(join(corelib_dest_dir, 'core_runtime.dart'), 'w') 344 dest_file = open(join(corelib_dest_dir, 'core_runtime.dart'), 'w')
337 dest_file.write('#library("dart:core");\n') 345 dest_file.write('#library("dart:core");\n')
338 dest_file.write('#import("dart:coreimpl");\n') 346 dest_file.write('#import("dart:coreimpl");\n')
339 for filename in corelib_sources: 347 for filename in corelib_sources:
340 dest_file.write('#source("runtime/' + filename + '");\n') 348 dest_file.write('#source("runtime/' + filename + '");\n')
341 for filename in corelib_runtime_sources: 349 for filename in corelib_runtime_sources:
342 if filename.endswith('.dart'): 350 if filename.endswith('.dart'):
343 dest_file.write('#source("runtime/' + filename + '");\n') 351 dest_file.write('#source("runtime/' + filename + '");\n')
352 # include the missing print function
353 dest_file.write('void print(String arg) { /* native */ }\n')
344 dest_file.close() 354 dest_file.close()
345 355
346 # 356 #
347 # Create and populate lib/coreimpl. 357 # Create and populate lib/coreimpl.
348 # 358 #
349 359
350 # First, copy corelib/src/implementation to corelib/{frog, runtime}. 360 # First, copy corelib/src/implementation to corelib/{frog, runtime}.
351 for filename in coreimpl_sources: 361 for filename in coreimpl_sources:
352 for target_dir in ['frog', 'runtime']: 362 for target_dir in ['frog', 'runtime']:
353 copyfile(join('corelib', 'src', 'implementation', filename), 363 copyfile(join('corelib', 'src', 'implementation', filename),
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 395
386 # Create and copy tools. 396 # Create and copy tools.
387 397
388 UTIL = join(SDK_tmp, 'util') 398 UTIL = join(SDK_tmp, 'util')
389 os.makedirs(UTIL) 399 os.makedirs(UTIL)
390 400
391 move(SDK_tmp, SDK) 401 move(SDK_tmp, SDK)
392 402
393 if __name__ == '__main__': 403 if __name__ == '__main__':
394 sys.exit(Main(sys.argv)) 404 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