| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 if revision: | 104 if revision: |
| 105 ReplaceInFiles([os.path.join(sdk_root, 'pkg', 'compiler', | 105 ReplaceInFiles([os.path.join(sdk_root, 'pkg', 'compiler', |
| 106 'implementation', 'compiler.dart')], | 106 'implementation', 'compiler.dart')], |
| 107 [(r"BUILD_ID = 'build number could not be determined'", | 107 [(r"BUILD_ID = 'build number could not be determined'", |
| 108 r"BUILD_ID = '%s'" % revision)]) | 108 r"BUILD_ID = '%s'" % revision)]) |
| 109 if utils.GuessOS() == 'win32': | 109 if utils.GuessOS() == 'win32': |
| 110 dart2js = os.path.join(sdk_root, 'bin', 'dart2js.bat') | 110 dart2js = os.path.join(sdk_root, 'bin', 'dart2js.bat') |
| 111 Copy(os.path.join(build_dir, 'dart2js.bat'), dart2js) | 111 Copy(os.path.join(build_dir, 'dart2js.bat'), dart2js) |
| 112 dartdoc = os.path.join(sdk_root, 'bin', 'dartdoc.bat') | 112 dartdoc = os.path.join(sdk_root, 'bin', 'dartdoc.bat') |
| 113 Copy(os.path.join(build_dir, 'dartdoc.bat'), dartdoc) | 113 Copy(os.path.join(build_dir, 'dartdoc.bat'), dartdoc) |
| 114 # TODO(dgrove) - fix this once issue 4788 is addressed. |
| 115 ReplaceInFiles([dart2js], |
| 116 [(r'%SCRIPTPATH%..\\lib', r'%SCRIPTPATH%..\\pkg')]); |
| 114 else: | 117 else: |
| 115 dart2js = os.path.join(sdk_root, 'bin', 'dart2js') | 118 dart2js = os.path.join(sdk_root, 'bin', 'dart2js') |
| 116 Copy(os.path.join(build_dir, 'dart2js'), dart2js) | 119 Copy(os.path.join(build_dir, 'dart2js'), dart2js) |
| 117 dartdoc = os.path.join(sdk_root, 'bin', 'dartdoc') | 120 dartdoc = os.path.join(sdk_root, 'bin', 'dartdoc') |
| 118 Copy(os.path.join(build_dir, 'dartdoc'), dartdoc) | 121 Copy(os.path.join(build_dir, 'dartdoc'), dartdoc) |
| 119 | 122 |
| 120 # TODO(dgrove) - fix this once issue 4788 is addressed. | 123 # TODO(dgrove) - fix this once issue 4788 is addressed. |
| 121 ReplaceInFiles([dart2js], | 124 ReplaceInFiles([dart2js], |
| 122 [(r'\$BIN_DIR/../../lib', r'$BIN_DIR/../pkg')]) | 125 [(r'$BIN_DIR/../../lib', r'$BIN_DIR/../pkg')]) |
| 123 ReplaceInFiles([dartdoc], | 126 ReplaceInFiles([dartdoc], |
| 124 [(r'\$BIN_DIR/../..', r'$BIN_DIR/..')]) | 127 [(r'$BIN_DIR/../..', r'$BIN_DIR/..')]) |
| 125 | 128 |
| 126 | 129 |
| 127 def Main(argv): | 130 def Main(argv): |
| 128 # Pull in all of the gpyi files which will be munged into the sdk. | 131 # Pull in all of the gpyi files which will be munged into the sdk. |
| 129 io_runtime_sources = \ | 132 io_runtime_sources = \ |
| 130 (eval(open("runtime/bin/io_sources.gypi").read()))['sources'] | 133 (eval(open("runtime/bin/io_sources.gypi").read()))['sources'] |
| 131 | 134 |
| 132 HOME = dirname(dirname(realpath(__file__))) | 135 HOME = dirname(dirname(realpath(__file__))) |
| 133 | 136 |
| 134 SDK_tmp = tempfile.mkdtemp() | 137 SDK_tmp = tempfile.mkdtemp() |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 if revision is not None: | 312 if revision is not None: |
| 310 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 313 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
| 311 f.write(revision + '\n') | 314 f.write(revision + '\n') |
| 312 f.close() | 315 f.close() |
| 313 | 316 |
| 314 move(SDK_tmp, SDK) | 317 move(SDK_tmp, SDK) |
| 315 utils.Touch(os.path.join(SDK, 'create.stamp')) | 318 utils.Touch(os.path.join(SDK, 'create.stamp')) |
| 316 | 319 |
| 317 if __name__ == '__main__': | 320 if __name__ == '__main__': |
| 318 sys.exit(Main(sys.argv)) | 321 sys.exit(Main(sys.argv)) |
| OLD | NEW |