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

Side by Side Diff: dart/tools/create_sdk.py

Issue 11187028: Generate snapshot for dartj2s; use it in the SDK. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 Copy(os.path.join(build_dir, 'dart2js'), dart2js) 124 Copy(os.path.join(build_dir, 'dart2js'), dart2js)
125 dartdoc = os.path.join(sdk_root, 'bin', 'dartdoc') 125 dartdoc = os.path.join(sdk_root, 'bin', 'dartdoc')
126 Copy(os.path.join(build_dir, 'dartdoc'), dartdoc) 126 Copy(os.path.join(build_dir, 'dartdoc'), dartdoc)
127 127
128 # TODO(dgrove) - fix this once issue 4788 is addressed. 128 # TODO(dgrove) - fix this once issue 4788 is addressed.
129 ReplaceInFiles([dart2js], 129 ReplaceInFiles([dart2js],
130 [(r'\$BIN_DIR/\.\./\.\./lib', r'$BIN_DIR/../pkg')]) 130 [(r'\$BIN_DIR/\.\./\.\./lib', r'$BIN_DIR/../pkg')])
131 ReplaceInFiles([dartdoc], 131 ReplaceInFiles([dartdoc],
132 [(r'\$BIN_DIR/\.\./\.\.', r'$BIN_DIR/..')]) 132 [(r'\$BIN_DIR/\.\./\.\.', r'$BIN_DIR/..')])
133 133
134 # TODO(ahe): Enable for Windows as well.
135 subprocess.call([os.path.join(build_dir, 'gen_snapshot'),
136 '--script_snapshot=%s' %
137 os.path.join(sdk_root, 'pkg', 'compiler',
138 'implementation', 'dart2js.dart.snapshot'),
139 os.path.join(sdk_root, 'pkg', 'compiler',
140 'implementation', 'dart2js.dart')])
141
142
134 143
135 def Main(argv): 144 def Main(argv):
136 # Pull in all of the gpyi files which will be munged into the sdk. 145 # Pull in all of the gpyi files which will be munged into the sdk.
137 io_runtime_sources = \ 146 io_runtime_sources = \
138 (eval(open("runtime/bin/io_sources.gypi").read()))['sources'] 147 (eval(open("runtime/bin/io_sources.gypi").read()))['sources']
139 148
140 HOME = dirname(dirname(realpath(__file__))) 149 HOME = dirname(dirname(realpath(__file__)))
141 150
142 SDK_tmp = tempfile.mkdtemp() 151 SDK_tmp = tempfile.mkdtemp()
143 SDK = argv[1] 152 SDK = argv[1]
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: 339 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f:
331 f.write(revision + '\n') 340 f.write(revision + '\n')
332 f.close() 341 f.close()
333 342
334 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) 343 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README'))
335 344
336 move(SDK_tmp, SDK) 345 move(SDK_tmp, SDK)
337 346
338 if __name__ == '__main__': 347 if __name__ == '__main__':
339 sys.exit(Main(sys.argv)) 348 sys.exit(Main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | dart/utils/compiler/build_helper.dart » ('j') | dart/utils/compiler/build_helper.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698