| 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 29 matching lines...) Expand all Loading... |
| 40 # ......dart_mirrors_api.h | 40 # ......dart_mirrors_api.h |
| 41 # ......dart_native_api.h | 41 # ......dart_native_api.h |
| 42 # ......dart_tools_api.h | 42 # ......dart_tools_api.h |
| 43 # ....lib/ | 43 # ....lib/ |
| 44 # ......dart_client.platform | 44 # ......dart_client.platform |
| 45 # ......dart_server.platform | 45 # ......dart_server.platform |
| 46 # ......dart_shared.platform | 46 # ......dart_shared.platform |
| 47 # ......_internal/ | 47 # ......_internal/ |
| 48 #.........spec.sum | 48 #.........spec.sum |
| 49 #.........strong.sum | 49 #.........strong.sum |
| 50 #.........dev_compiler/ |
| 50 # ......analysis_server/ | 51 # ......analysis_server/ |
| 51 # ......analyzer/ | 52 # ......analyzer/ |
| 52 # ......async/ | 53 # ......async/ |
| 53 # ......collection/ | 54 # ......collection/ |
| 54 # ......convert/ | 55 # ......convert/ |
| 55 # ......core/ | 56 # ......core/ |
| 56 # ......html/ | 57 # ......html/ |
| 57 # ......internal/ | 58 # ......internal/ |
| 58 # ......io/ | 59 # ......io/ |
| 59 # ......isolate/ | 60 # ......isolate/ |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 packages_file = open(PACKAGES_FILE, 'w') | 163 packages_file = open(PACKAGES_FILE, 'w') |
| 163 packages_file.write('dartdoc:.') | 164 packages_file.write('dartdoc:.') |
| 164 packages_file.close() | 165 packages_file.close() |
| 165 | 166 |
| 166 def CopyAnalysisSummaries(snapshots, lib): | 167 def CopyAnalysisSummaries(snapshots, lib): |
| 167 copyfile(join(snapshots, 'spec.sum'), | 168 copyfile(join(snapshots, 'spec.sum'), |
| 168 join(lib, '_internal', 'spec.sum')) | 169 join(lib, '_internal', 'spec.sum')) |
| 169 copyfile(join(snapshots, 'strong.sum'), | 170 copyfile(join(snapshots, 'strong.sum'), |
| 170 join(lib, '_internal', 'strong.sum')) | 171 join(lib, '_internal', 'strong.sum')) |
| 171 | 172 |
| 173 def CopyDevCompilerSdk(home, lib): |
| 174 copytree(join(home, 'pkg', 'dev_compiler', 'lib', 'js'), |
| 175 join(lib, '_internal', 'dev_compiler')) |
| 172 | 176 |
| 173 def Main(): | 177 def Main(): |
| 174 # Pull in all of the gypi files which will be munged into the sdk. | 178 # Pull in all of the gypi files which will be munged into the sdk. |
| 175 HOME = dirname(dirname(realpath(__file__))) | 179 HOME = dirname(dirname(realpath(__file__))) |
| 176 | 180 |
| 177 (options, args) = GetOptions() | 181 (options, args) = GetOptions() |
| 178 | 182 |
| 179 SDK = options.sdk_output_dir | 183 SDK = options.sdk_output_dir |
| 180 SDK_tmp = '%s.tmp' % SDK | 184 SDK_tmp = '%s.tmp' % SDK |
| 181 | 185 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 join(RESOURCE, '7zip'), | 301 join(RESOURCE, '7zip'), |
| 298 ignore=ignore_patterns('.svn')) | 302 ignore=ignore_patterns('.svn')) |
| 299 | 303 |
| 300 # Copy dart2js/pub. | 304 # Copy dart2js/pub. |
| 301 CopyDartScripts(HOME, SDK_tmp) | 305 CopyDartScripts(HOME, SDK_tmp) |
| 302 | 306 |
| 303 CopySnapshots(SNAPSHOT, SDK_tmp) | 307 CopySnapshots(SNAPSHOT, SDK_tmp) |
| 304 CopyDartdocResources(HOME, SDK_tmp) | 308 CopyDartdocResources(HOME, SDK_tmp) |
| 305 CopyAnalyzerSources(HOME, LIB) | 309 CopyAnalyzerSources(HOME, LIB) |
| 306 CopyAnalysisSummaries(SNAPSHOT, LIB) | 310 CopyAnalysisSummaries(SNAPSHOT, LIB) |
| 311 CopyDevCompilerSdk(HOME, LIB) |
| 307 | 312 |
| 308 # Write the 'version' file | 313 # Write the 'version' file |
| 309 version = utils.GetVersion() | 314 version = utils.GetVersion() |
| 310 versionFile = open(os.path.join(SDK_tmp, 'version'), 'w') | 315 versionFile = open(os.path.join(SDK_tmp, 'version'), 'w') |
| 311 versionFile.write(version + '\n') | 316 versionFile.write(version + '\n') |
| 312 versionFile.close() | 317 versionFile.close() |
| 313 | 318 |
| 314 # Write the 'revision' file | 319 # Write the 'revision' file |
| 315 revision = utils.GetGitRevision() | 320 revision = utils.GetGitRevision() |
| 316 | 321 |
| 317 if revision is not None: | 322 if revision is not None: |
| 318 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 323 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
| 319 f.write('%s\n' % revision) | 324 f.write('%s\n' % revision) |
| 320 f.close() | 325 f.close() |
| 321 | 326 |
| 322 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) | 327 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) |
| 323 Copy(join(HOME, 'LICENSE'), join(SDK_tmp, 'LICENSE')) | 328 Copy(join(HOME, 'LICENSE'), join(SDK_tmp, 'LICENSE')) |
| 324 Copy(join(HOME, 'sdk', 'api_readme.md'), join(SDK_tmp, 'lib', 'api_readme.md')
) | 329 Copy(join(HOME, 'sdk', 'api_readme.md'), join(SDK_tmp, 'lib', 'api_readme.md')
) |
| 325 | 330 |
| 326 move(SDK_tmp, SDK) | 331 move(SDK_tmp, SDK) |
| 327 | 332 |
| 328 if __name__ == '__main__': | 333 if __name__ == '__main__': |
| 329 sys.exit(Main()) | 334 sys.exit(Main()) |
| OLD | NEW |