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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 if dest_file.endswith('_sdk'): | 106 if dest_file.endswith('_sdk'): |
107 dest_file = dest_file.replace('_sdk', '') | 107 dest_file = dest_file.replace('_sdk', '') |
108 | 108 |
109 src = src_file + file_extension | 109 src = src_file + file_extension |
110 dest = join(dest_dir, dest_file + file_extension) | 110 dest = join(dest_dir, dest_file + file_extension) |
111 Copy(src, dest) | 111 Copy(src, dest) |
112 | 112 |
113 | 113 |
114 def CopyDartScripts(home, sdk_root): | 114 def CopyDartScripts(home, sdk_root): |
115 for executable in ['dart2js_sdk', 'dartanalyzer_sdk', 'dartfmt', 'docgen', | 115 for executable in ['dart2js_sdk', 'dartanalyzer_sdk', 'dartfmt', 'docgen', |
116 'dartdocgen', 'pub_sdk']: | 116 'pub_sdk']: |
117 CopyShellScript(os.path.join(home, 'sdk', 'bin', executable), | 117 CopyShellScript(os.path.join(home, 'sdk', 'bin', executable), |
118 os.path.join(sdk_root, 'bin')) | 118 os.path.join(sdk_root, 'bin')) |
119 | 119 |
120 | 120 |
121 def CopySnapshots(snapshots, sdk_root): | 121 def CopySnapshots(snapshots, sdk_root): |
122 for snapshot in ['analysis_server', 'dart2js', 'dartanalyzer', 'dartfmt', | 122 for snapshot in ['analysis_server', 'dart2js', 'dartanalyzer', 'dartfmt', |
123 'utils_wrapper', 'pub']: | 123 'utils_wrapper', 'pub']: |
124 snapshot += '.dart.snapshot' | 124 snapshot += '.dart.snapshot' |
125 copyfile(join(snapshots, snapshot), | 125 copyfile(join(snapshots, snapshot), |
126 join(sdk_root, 'bin', 'snapshots', snapshot)) | 126 join(sdk_root, 'bin', 'snapshots', snapshot)) |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 258 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
259 f.write(revision + '\n') | 259 f.write(revision + '\n') |
260 f.close() | 260 f.close() |
261 | 261 |
262 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) | 262 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) |
263 | 263 |
264 move(SDK_tmp, SDK) | 264 move(SDK_tmp, SDK) |
265 | 265 |
266 if __name__ == '__main__': | 266 if __name__ == '__main__': |
267 sys.exit(Main()) | 267 sys.exit(Main()) |
OLD | NEW |