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 # |
11 # The SDK will be used either from the command-line or from the editor. | 11 # The SDK will be used either from the command-line or from the editor. |
12 # Top structure is | 12 # Top structure is |
13 # | 13 # |
14 # ..dart-sdk/ | 14 # ..dart-sdk/ |
15 # ....bin/ | 15 # ....bin/ |
16 # ......dart or dart.exe (executable) | 16 # ......dart or dart.exe (executable) |
17 # ......dart.lib (import library for VM native extensions on Windows) | 17 # ......dart.lib (import library for VM native extensions on Windows) |
18 # ......dartdoc | 18 # ......dartdoc |
19 # ......dartfmt | 19 # ......dartfmt |
20 # ......dart2js | 20 # ......dart2js |
21 # ......dartanalyzer | 21 # ......dartanalyzer |
| 22 # ......dartdevc |
22 # ......pub | 23 # ......pub |
23 # ......snapshots/ | 24 # ......snapshots/ |
24 # ........analysis_server.dart.snapshot | 25 # ........analysis_server.dart.snapshot |
25 # ........dart2js.dart.snapshot | 26 # ........dart2js.dart.snapshot |
26 # ........dartanalyzer.dart.snapshot | 27 # ........dartanalyzer.dart.snapshot |
27 # ........dartdoc.dart.snapshot | 28 # ........dartdoc.dart.snapshot |
28 # ........dartfmt.dart.snapshot | 29 # ........dartfmt.dart.snapshot |
| 30 # ........dartdevc.dart.snapshot |
29 # ........pub.dart.snapshot | 31 # ........pub.dart.snapshot |
30 # ........utils_wrapper.dart.snapshot | 32 # ........utils_wrapper.dart.snapshot |
31 #.........resources/ | 33 #.........resources/ |
32 #...........dartdoc/ | 34 #...........dartdoc/ |
33 #..............packages | 35 #..............packages |
34 #.............resources/ | 36 #.............resources/ |
35 #.............templates/ | 37 #.............templates/ |
36 # ....include/ | 38 # ....include/ |
37 # ......dart_api.h | 39 # ......dart_api.h |
38 # ......dart_mirrors_api.h | 40 # ......dart_mirrors_api.h |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 if dest_file.endswith('_sdk'): | 124 if dest_file.endswith('_sdk'): |
123 dest_file = dest_file.replace('_sdk', '') | 125 dest_file = dest_file.replace('_sdk', '') |
124 | 126 |
125 src = src_file + file_extension | 127 src = src_file + file_extension |
126 dest = join(dest_dir, dest_file + file_extension) | 128 dest = join(dest_dir, dest_file + file_extension) |
127 Copy(src, dest) | 129 Copy(src, dest) |
128 | 130 |
129 | 131 |
130 def CopyDartScripts(home, sdk_root): | 132 def CopyDartScripts(home, sdk_root): |
131 for executable in ['dart2js_sdk', 'dartanalyzer_sdk', 'dartfmt_sdk', | 133 for executable in ['dart2js_sdk', 'dartanalyzer_sdk', 'dartfmt_sdk', |
132 'pub_sdk', 'dartdoc']: | 134 'pub_sdk', 'dartdoc', 'dartdevc_sdk']: |
133 CopyShellScript(os.path.join(home, 'sdk', 'bin', executable), | 135 CopyShellScript(os.path.join(home, 'sdk', 'bin', executable), |
134 os.path.join(sdk_root, 'bin')) | 136 os.path.join(sdk_root, 'bin')) |
135 | 137 |
136 | 138 |
137 def CopySnapshots(snapshots, sdk_root): | 139 def CopySnapshots(snapshots, sdk_root): |
138 for snapshot in ['analysis_server', 'dart2js', 'dartanalyzer', 'dartfmt', | 140 for snapshot in ['analysis_server', 'dart2js', 'dartanalyzer', 'dartfmt', |
139 'utils_wrapper', 'pub', 'dartdoc']: | 141 'utils_wrapper', 'pub', 'dartdoc', 'dartdevc']: |
140 snapshot += '.dart.snapshot' | 142 snapshot += '.dart.snapshot' |
141 copyfile(join(snapshots, snapshot), | 143 copyfile(join(snapshots, snapshot), |
142 join(sdk_root, 'bin', 'snapshots', snapshot)) | 144 join(sdk_root, 'bin', 'snapshots', snapshot)) |
143 | 145 |
144 def CopyAnalyzerSources(home, lib_dir): | 146 def CopyAnalyzerSources(home, lib_dir): |
145 for library in ['analyzer', 'analysis_server']: | 147 for library in ['analyzer', 'analysis_server']: |
146 copytree(join(home, 'pkg', library), join(lib_dir, library), | 148 copytree(join(home, 'pkg', library), join(lib_dir, library), |
147 ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh', | 149 ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh', |
148 '.gitignore', 'packages')) | 150 '.gitignore', 'packages')) |
149 | 151 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 f.close() | 321 f.close() |
320 | 322 |
321 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) | 323 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) |
322 Copy(join(HOME, 'LICENSE'), join(SDK_tmp, 'LICENSE')) | 324 Copy(join(HOME, 'LICENSE'), join(SDK_tmp, 'LICENSE')) |
323 Copy(join(HOME, 'sdk', 'api_readme.md'), join(SDK_tmp, 'lib', 'api_readme.md')
) | 325 Copy(join(HOME, 'sdk', 'api_readme.md'), join(SDK_tmp, 'lib', 'api_readme.md')
) |
324 | 326 |
325 move(SDK_tmp, SDK) | 327 move(SDK_tmp, SDK) |
326 | 328 |
327 if __name__ == '__main__': | 329 if __name__ == '__main__': |
328 sys.exit(Main()) | 330 sys.exit(Main()) |
OLD | NEW |