| 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 26 matching lines...) Expand all Loading... |
| 37 # ......dart_api.h | 37 # ......dart_api.h |
| 38 # ......dart_mirrors_api.h | 38 # ......dart_mirrors_api.h |
| 39 # ......dart_native_api.h | 39 # ......dart_native_api.h |
| 40 # ......dart_tools_api.h | 40 # ......dart_tools_api.h |
| 41 # ....lib/ | 41 # ....lib/ |
| 42 # ......dart_client.platform | 42 # ......dart_client.platform |
| 43 # ......dart_server.platform | 43 # ......dart_server.platform |
| 44 # ......dart_shared.platform | 44 # ......dart_shared.platform |
| 45 # ......dart2dart.platform | 45 # ......dart2dart.platform |
| 46 # ......_internal/ | 46 # ......_internal/ |
| 47 #.........spec.sum |
| 48 #.........strong.sum |
| 47 # ......analysis_server/ | 49 # ......analysis_server/ |
| 48 # ......analyzer/ | 50 # ......analyzer/ |
| 49 # ......async/ | 51 # ......async/ |
| 50 # ......collection/ | 52 # ......collection/ |
| 51 # ......convert/ | 53 # ......convert/ |
| 52 # ......core/ | 54 # ......core/ |
| 53 # ......html/ | 55 # ......html/ |
| 54 # ......internal/ | 56 # ......internal/ |
| 55 # ......io/ | 57 # ......io/ |
| 56 # ......isolate/ | 58 # ......isolate/ |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 DARTDOC = join(RESOURCE_DIR, 'dartdoc') | 152 DARTDOC = join(RESOURCE_DIR, 'dartdoc') |
| 151 | 153 |
| 152 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'templates'), | 154 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'templates'), |
| 153 join(DARTDOC, 'templates')) | 155 join(DARTDOC, 'templates')) |
| 154 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'resources'), | 156 copytree(join(home, 'third_party', 'pkg', 'dartdoc', 'lib', 'resources'), |
| 155 join(DARTDOC, 'resources')) | 157 join(DARTDOC, 'resources')) |
| 156 # write the .packages file | 158 # write the .packages file |
| 157 PACKAGES_FILE = join(DARTDOC, '.packages') | 159 PACKAGES_FILE = join(DARTDOC, '.packages') |
| 158 packages_file = open(PACKAGES_FILE, 'w') | 160 packages_file = open(PACKAGES_FILE, 'w') |
| 159 packages_file.write('dartdoc:.') | 161 packages_file.write('dartdoc:.') |
| 160 packages_file.close() | 162 packages_file.close() |
| 163 |
| 164 def CopyAnalysisSummaries(snapshots, lib): |
| 165 copyfile(join(snapshots, 'spec.sum'), |
| 166 join(lib, '_internal', 'spec.sum')) |
| 167 copyfile(join(snapshots, 'strong.sum'), |
| 168 join(lib, '_internal', 'strong.sum')) |
| 161 | 169 |
| 162 | 170 |
| 163 def Main(): | 171 def Main(): |
| 164 # Pull in all of the gypi files which will be munged into the sdk. | 172 # Pull in all of the gypi files which will be munged into the sdk. |
| 165 HOME = dirname(dirname(realpath(__file__))) | 173 HOME = dirname(dirname(realpath(__file__))) |
| 166 | 174 |
| 167 (options, args) = GetOptions() | 175 (options, args) = GetOptions() |
| 168 | 176 |
| 169 SDK = options.sdk_output_dir | 177 SDK = options.sdk_output_dir |
| 170 SDK_tmp = '%s.tmp' % SDK | 178 SDK_tmp = '%s.tmp' % SDK |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 ignore=ignore_patterns('.svn')) | 291 ignore=ignore_patterns('.svn')) |
| 284 | 292 |
| 285 # Copy in 7zip for Windows. | 293 # Copy in 7zip for Windows. |
| 286 if HOST_OS == 'win32': | 294 if HOST_OS == 'win32': |
| 287 copytree(join(HOME, 'third_party', '7zip'), | 295 copytree(join(HOME, 'third_party', '7zip'), |
| 288 join(RESOURCE, '7zip'), | 296 join(RESOURCE, '7zip'), |
| 289 ignore=ignore_patterns('.svn')) | 297 ignore=ignore_patterns('.svn')) |
| 290 | 298 |
| 291 # Copy dart2js/pub. | 299 # Copy dart2js/pub. |
| 292 CopyDartScripts(HOME, SDK_tmp) | 300 CopyDartScripts(HOME, SDK_tmp) |
| 293 | 301 |
| 294 CopySnapshots(SNAPSHOT, SDK_tmp) | 302 CopySnapshots(SNAPSHOT, SDK_tmp) |
| 295 CopyDartdocResources(HOME, SDK_tmp) | 303 CopyDartdocResources(HOME, SDK_tmp) |
| 296 CopyAnalyzerSources(HOME, LIB) | 304 CopyAnalyzerSources(HOME, LIB) |
| 305 CopyAnalysisSummaries(SNAPSHOT, LIB) |
| 297 | 306 |
| 298 # Write the 'version' file | 307 # Write the 'version' file |
| 299 version = utils.GetVersion() | 308 version = utils.GetVersion() |
| 300 versionFile = open(os.path.join(SDK_tmp, 'version'), 'w') | 309 versionFile = open(os.path.join(SDK_tmp, 'version'), 'w') |
| 301 versionFile.write(version + '\n') | 310 versionFile.write(version + '\n') |
| 302 versionFile.close() | 311 versionFile.close() |
| 303 | 312 |
| 304 # Write the 'revision' file | 313 # Write the 'revision' file |
| 305 revision = utils.GetGitRevision() | 314 revision = utils.GetGitRevision() |
| 306 | 315 |
| 307 if revision is not None: | 316 if revision is not None: |
| 308 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: | 317 with open(os.path.join(SDK_tmp, 'revision'), 'w') as f: |
| 309 f.write('%s\n' % revision) | 318 f.write('%s\n' % revision) |
| 310 f.close() | 319 f.close() |
| 311 | 320 |
| 312 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) | 321 Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README')) |
| 313 Copy(join(HOME, 'LICENSE'), join(SDK_tmp, 'LICENSE')) | 322 Copy(join(HOME, 'LICENSE'), join(SDK_tmp, 'LICENSE')) |
| 314 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')
) |
| 315 | 324 |
| 316 move(SDK_tmp, SDK) | 325 move(SDK_tmp, SDK) |
| 317 | 326 |
| 318 if __name__ == '__main__': | 327 if __name__ == '__main__': |
| 319 sys.exit(Main()) | 328 sys.exit(Main()) |
| OLD | NEW |