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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 'implementation', 'compiler.dart')], | 107 'implementation', 'compiler.dart')], |
108 [(r"BUILD_ID = 'build number could not be determined'", | 108 [(r"BUILD_ID = 'build number could not be determined'", |
109 r"BUILD_ID = '%s'" % revision)]) | 109 r"BUILD_ID = '%s'" % revision)]) |
110 if utils.GuessOS() == 'win32': | 110 if utils.GuessOS() == 'win32': |
111 dart2js = os.path.join(sdk_root, 'bin', 'dart2js.bat') | 111 dart2js = os.path.join(sdk_root, 'bin', 'dart2js.bat') |
112 Copy(os.path.join(build_dir, 'dart2js.bat'), dart2js) | 112 Copy(os.path.join(build_dir, 'dart2js.bat'), dart2js) |
113 dartdoc = os.path.join(sdk_root, 'bin', 'dartdoc.bat') | 113 dartdoc = os.path.join(sdk_root, 'bin', 'dartdoc.bat') |
114 Copy(os.path.join(build_dir, 'dartdoc.bat'), dartdoc) | 114 Copy(os.path.join(build_dir, 'dartdoc.bat'), dartdoc) |
115 # TODO(dgrove) - fix this once issue 4788 is addressed. | 115 # TODO(dgrove) - fix this once issue 4788 is addressed. |
116 ReplaceInFiles([dart2js], | 116 ReplaceInFiles([dart2js], |
117 [(r'%SCRIPTPATH%\.\.\\lib', r'%SCRIPTPATH%..\\pkg')]); | 117 [(r'%SCRIPTPATH%\.\.\\\.\.\\lib', r'%SCRIPTPATH%..\\pkg')]); |
| 118 ReplaceInFiles([dartdoc], |
| 119 [(r'%SCRIPTPATH%\.\.\\\.\.\\pkg', r'%SCRIPTPATH%..\\pkg')]); |
118 else: | 120 else: |
119 dart2js = os.path.join(sdk_root, 'bin', 'dart2js') | 121 dart2js = os.path.join(sdk_root, 'bin', 'dart2js') |
120 Copy(os.path.join(build_dir, 'dart2js'), dart2js) | 122 Copy(os.path.join(build_dir, 'dart2js'), dart2js) |
121 dartdoc = os.path.join(sdk_root, 'bin', 'dartdoc') | 123 dartdoc = os.path.join(sdk_root, 'bin', 'dartdoc') |
122 Copy(os.path.join(build_dir, 'dartdoc'), dartdoc) | 124 Copy(os.path.join(build_dir, 'dartdoc'), dartdoc) |
123 | 125 |
124 # TODO(dgrove) - fix this once issue 4788 is addressed. | 126 # TODO(dgrove) - fix this once issue 4788 is addressed. |
125 ReplaceInFiles([dart2js], | 127 ReplaceInFiles([dart2js], |
126 [(r'\$BIN_DIR/\.\./\.\./lib', r'$BIN_DIR/../pkg')]) | 128 [(r'\$BIN_DIR/\.\./\.\./lib', r'$BIN_DIR/../pkg')]) |
127 ReplaceInFiles([dartdoc], | 129 ReplaceInFiles([dartdoc], |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 if revision is not None: | 308 if revision is not None: |
307 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 309 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
308 f.write(revision + '\n') | 310 f.write(revision + '\n') |
309 f.close() | 311 f.close() |
310 | 312 |
311 move(SDK_tmp, SDK) | 313 move(SDK_tmp, SDK) |
312 utils.Touch(os.path.join(SDK, 'create.stamp')) | 314 utils.Touch(os.path.join(SDK, 'create.stamp')) |
313 | 315 |
314 if __name__ == '__main__': | 316 if __name__ == '__main__': |
315 sys.exit(Main(sys.argv)) | 317 sys.exit(Main(sys.argv)) |
OLD | NEW |