| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 137 # TODO(ahe): Remove option when |
| 138 # http://dartbug.com/5989 is fixed. |
| 139 '--optimization_counter_threshold=-1', |
| 140 |
| 141 '--script_snapshot=%s' % |
| 142 os.path.join(sdk_root, 'pkg', 'compiler', |
| 143 'implementation', 'dart2js.dart.snapshot'), |
| 144 os.path.join(sdk_root, 'pkg', 'compiler', |
| 145 'implementation', 'dart2js.dart')]) |
| 146 |
| 147 |
| 134 | 148 |
| 135 def Main(argv): | 149 def Main(argv): |
| 136 # 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. |
| 137 io_runtime_sources = \ | 151 io_runtime_sources = \ |
| 138 (eval(open("runtime/bin/io_sources.gypi").read()))['sources'] | 152 (eval(open("runtime/bin/io_sources.gypi").read()))['sources'] |
| 139 | 153 |
| 140 HOME = dirname(dirname(realpath(__file__))) | 154 HOME = dirname(dirname(realpath(__file__))) |
| 141 | 155 |
| 142 SDK_tmp = tempfile.mkdtemp() | 156 SDK_tmp = tempfile.mkdtemp() |
| 143 SDK = argv[1] | 157 SDK = argv[1] |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 344 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
| 331 f.write(revision + '\n') | 345 f.write(revision + '\n') |
| 332 f.close() | 346 f.close() |
| 333 | 347 |
| 334 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) | 348 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) |
| 335 | 349 |
| 336 move(SDK_tmp, SDK) | 350 move(SDK_tmp, SDK) |
| 337 | 351 |
| 338 if __name__ == '__main__': | 352 if __name__ == '__main__': |
| 339 sys.exit(Main(sys.argv)) | 353 sys.exit(Main(sys.argv)) |
| OLD | NEW |