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