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

Unified Diff: tools/create_sdk.py

Issue 9113082: Fix the dart:builtin and dart:io parts of the SDK. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/create_sdk.py
diff --git a/tools/create_sdk.py b/tools/create_sdk.py
index e77e8582ace20feca22c17159bd3606bd698044e..2fef199c9146e2ed780716df1295cbc51bec6ef4 100644
--- a/tools/create_sdk.py
+++ b/tools/create_sdk.py
@@ -10,7 +10,7 @@
#
# The SDK will be used either from the command-line or from the editor.
# Top structure is
-#
+#
# ..dart-sdk/
# ....bin/
# ......dart or dart.exe (executable)
@@ -19,6 +19,8 @@
# ....lib/
# ......builtin/
# ........builtin_runtime.dart
+# ......io/
+# ........io_runtime.dart
# ........runtime/
# ......core/
# ........core_{frog, runtime}.dart
@@ -55,6 +57,8 @@ def Main(argv):
# Pull in all of the gpyi files which will be munged into the sdk.
builtin_runtime_sources = \
(eval(open("runtime/bin/builtin_sources.gypi").read()))['sources']
+ io_runtime_sources = \
+ (eval(open("runtime/bin/io_sources.gypi").read()))['sources']
corelib_sources = \
(eval(open("corelib/src/corelib_sources.gypi").read()))['sources']
corelib_frog_sources = \
@@ -133,24 +137,41 @@ def Main(argv):
#
- # Create and populate lib/runtime.
+ # Create and populate lib/builtin.
#
builtin_dest_dir = join(LIB, 'builtin')
os.makedirs(builtin_dest_dir)
- os.makedirs(join(builtin_dest_dir, 'runtime'))
- for filename in builtin_runtime_sources:
- if filename.endswith('.dart'):
- copyfile(join(HOME, 'runtime', 'bin', filename),
- join(builtin_dest_dir, 'runtime', filename))
+ assert len(builtin_runtime_sources) == 1
+ assert builtin_runtime_sources[0] == 'builtin.dart'
+ copyfile(join(HOME, 'runtime', 'bin', 'builtin.dart'),
+ join(builtin_dest_dir, 'builtin_runtime.dart'))
- # Construct lib/builtin/builtin_runtime.dart from whole cloth.
- dest_file = open(join(builtin_dest_dir, 'builtin_runtime.dart'), 'w')
- dest_file.write('#library("dart:builtin");\n')
- for filename in builtin_runtime_sources:
- if filename.endswith('.dart'):
- dest_file.write('#source("runtime/' + filename + '");\n')
+
+ #
+ # Create and populate lib/io.
+ #
+ io_dest_dir = join(LIB, 'io')
+ os.makedirs(io_dest_dir)
+ os.makedirs(join(io_dest_dir, 'runtime'))
+ for filename in io_runtime_sources:
+ assert filename.endswith('.dart')
+ if filename == 'io.dart':
+ copyfile(join(HOME, 'runtime', 'bin', filename),
+ join(io_dest_dir, 'io_runtime.dart'))
+ else:
+ copyfile(join(HOME, 'runtime', 'bin', filename),
+ join(io_dest_dir, 'runtime', filename))
+
+ # Construct lib/io/io_runtime.dart from whole cloth.
+ dest_file = open(join(io_dest_dir, 'io_runtime.dart'), 'a')
+ for filename in io_runtime_sources:
+ assert filename.endswith('.dart')
+ if filename == 'io.dart':
+ continue
+ dest_file.write('#source("runtime/' + filename + '");\n')
dest_file.close()
+
#
# Create and populate lib/frog.
#
« 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