| 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 # ......compiler/ | 26 # ......compiler/ |
| 27 # ......config/ | |
| 28 # ......core/ | 27 # ......core/ |
| 29 # ......coreimpl/ | 28 # ......coreimpl/ |
| 30 # ......crypto/ | 29 # ......crypto/ |
| 31 # ......html/ | 30 # ......html/ |
| 32 # ......io/ | 31 # ......io/ |
| 33 # ......isolate/ | 32 # ......isolate/ |
| 34 # ......json/ | 33 # ......json/ |
| 35 # ......math/ | 34 # ......math/ |
| 36 # ......mirrors/ | 35 # ......mirrors/ |
| 37 # ......uri/ | 36 # ......uri/ |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 assert filename.endswith('.dart') | 212 assert filename.endswith('.dart') |
| 214 if filename == 'io.dart': | 213 if filename == 'io.dart': |
| 215 continue | 214 continue |
| 216 dest_file.write('#source("runtime/' + filename + '");\n') | 215 dest_file.write('#source("runtime/' + filename + '");\n') |
| 217 dest_file.close() | 216 dest_file.close() |
| 218 | 217 |
| 219 # | 218 # |
| 220 # Create and populate lib/{core, crypto, isolate, json, uri, utf, ...}. | 219 # Create and populate lib/{core, crypto, isolate, json, uri, utf, ...}. |
| 221 # | 220 # |
| 222 | 221 |
| 223 for library in ['_internal', 'compiler', 'config', 'html', 'core', 'coreimpl', | 222 for library in ['_internal', 'compiler', html', 'core', 'coreimpl', |
| 224 'crypto', 'isolate', 'json', 'math', 'mirrors', 'uri', 'utf', | 223 'crypto', 'isolate', 'json', 'math', 'mirrors', 'uri', 'utf', |
| 225 'web']: | 224 'web']: |
| 226 copytree(join(HOME, 'lib', library), join(LIB, library), | 225 copytree(join(HOME, 'lib', library), join(LIB, library), |
| 227 ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh')) | 226 ignore=ignore_patterns('*.svn', 'doc', '*.py', '*.gypi', '*.sh')) |
| 228 | 227 |
| 229 # TODO(dgrove): fix this really ugly hack | 228 # TODO(dgrove): fix this really ugly hack |
| 230 ReplaceInFiles( | 229 ReplaceInFiles( |
| 231 [join(LIB, 'compiler', 'implementation', 'lib', 'io.dart')], | 230 [join(LIB, 'compiler', 'implementation', 'lib', 'io.dart')], |
| 232 [('../../runtime/bin', '../io/runtime')]) | 231 [('../../runtime/bin', '../io/runtime')]) |
| 233 | 232 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 if revision is not None: | 289 if revision is not None: |
| 291 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 290 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
| 292 f.write(revision + '\n') | 291 f.write(revision + '\n') |
| 293 f.close() | 292 f.close() |
| 294 | 293 |
| 295 move(SDK_tmp, SDK) | 294 move(SDK_tmp, SDK) |
| 296 utils.Touch(os.path.join(SDK, 'create.stamp')) | 295 utils.Touch(os.path.join(SDK, 'create.stamp')) |
| 297 | 296 |
| 298 if __name__ == '__main__': | 297 if __name__ == '__main__': |
| 299 sys.exit(Main(sys.argv)) | 298 sys.exit(Main(sys.argv)) |
| OLD | NEW |