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 # ......dart2js | 18 # ......dart2js |
19 # ......dart_analyzer | 19 # ......dart_analyzer |
20 # ......pub | 20 # ......pub |
21 # ....include/ | 21 # ....include/ |
22 # ......dart_api.h | 22 # ......dart_api.h |
23 # ......dart_debugger_api.h | 23 # ......dart_debugger_api.h |
24 # ....lib/ | 24 # ....lib/ |
25 # ......_internal/ | 25 # ......_internal/ |
26 # ......collection/ | 26 # ......collection/ |
27 # ......core/ | 27 # ......core/ |
28 # ......coreimpl/ | |
29 # ......crypto/ | 28 # ......crypto/ |
30 # ......html/ | 29 # ......html/ |
31 # ......io/ | 30 # ......io/ |
32 # ......isolate/ | 31 # ......isolate/ |
33 # ......json/ | 32 # ......json/ |
34 # ......math/ | 33 # ......math/ |
35 # ......mirrors/ | 34 # ......mirrors/ |
36 # ......uri/ | 35 # ......uri/ |
37 # ......utf/ | 36 # ......utf/ |
38 # ......scalarlist/ | 37 # ......scalarlist/ |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 # | 193 # |
195 | 194 |
196 LIB = join(SDK_tmp, 'lib') | 195 LIB = join(SDK_tmp, 'lib') |
197 os.makedirs(LIB) | 196 os.makedirs(LIB) |
198 | 197 |
199 # | 198 # |
200 # Create and populate lib/{core, crypto, isolate, json, uri, utf, ...}. | 199 # Create and populate lib/{core, crypto, isolate, json, uri, utf, ...}. |
201 # | 200 # |
202 | 201 |
203 os.makedirs(join(LIB, 'html')) | 202 os.makedirs(join(LIB, 'html')) |
204 for library in ['_internal', 'collection', 'core', 'coreimpl', 'crypto', 'io', | 203 for library in ['_internal', 'collection', 'core', 'crypto', 'io', 'isolate', |
205 'isolate', join('html', 'dart2js'), join('html', 'dartium'), | 204 join('html', 'dart2js'), join('html', 'dartium'), 'json', |
206 'json', 'math', 'mirrors', 'scalarlist', | 205 'math', 'mirrors', 'scalarlist', join('svg', 'dart2js'), |
207 join('svg', 'dart2js'), join('svg', 'dartium'), 'uri', 'utf']: | 206 join('svg', 'dartium'), 'uri', 'utf']: |
208 copytree(join(HOME, 'sdk', 'lib', library), join(LIB, library), | 207 copytree(join(HOME, 'sdk', 'lib', library), join(LIB, library), |
209 ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh')) | 208 ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh')) |
210 | 209 |
211 | 210 |
212 # Create and copy pkg. | 211 # Create and copy pkg. |
213 PKG = join(SDK_tmp, 'pkg') | 212 PKG = join(SDK_tmp, 'pkg') |
214 os.makedirs(PKG) | 213 os.makedirs(PKG) |
215 | 214 |
216 # | 215 # |
217 # Create and populate pkg/{args, intl, logging, meta, unittest} | 216 # Create and populate pkg/{args, intl, logging, meta, unittest} |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 287 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
289 f.write(revision + '\n') | 288 f.write(revision + '\n') |
290 f.close() | 289 f.close() |
291 | 290 |
292 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) | 291 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) |
293 | 292 |
294 move(SDK_tmp, SDK) | 293 move(SDK_tmp, SDK) |
295 | 294 |
296 if __name__ == '__main__': | 295 if __name__ == '__main__': |
297 sys.exit(Main(sys.argv)) | 296 sys.exit(Main(sys.argv)) |
OLD | NEW |