| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/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 """ This file will run docgen.dart on the SDK libraries, and upload them to | 7 """ This file will run docgen.dart on the SDK libraries, and upload them to |
| 8 Google Cloud Storage for the documentation viewer. | 8 Google Cloud Storage for the documentation viewer. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 | 63 |
| 64 def main(): | 64 def main(): |
| 65 GetOptions() | 65 GetOptions() |
| 66 | 66 |
| 67 SetGsutil() | 67 SetGsutil() |
| 68 | 68 |
| 69 # Execute Docgen.dart on the SDK. | 69 # Execute Docgen.dart on the SDK. |
| 70 ExecuteCommand([DART, '--checked', '--package-root=' + PACKAGE_ROOT, | 70 ExecuteCommand([DART, '--checked', '--package-root=' + PACKAGE_ROOT, |
| 71 abspath(join(dirname(__file__), 'docgen.dart')), | 71 abspath(join(dirname(__file__), 'docgen.dart')), |
| 72 '--parse-sdk']) | 72 '--parse-sdk', '--json']) |
| 73 | 73 |
| 74 # Use SVN Revision to get the revision number. | 74 # Use SVN Revision to get the revision number. |
| 75 revision = utils.GetSVNRevision() | 75 revision = utils.GetSVNRevision() |
| 76 if revision is None: | 76 if revision is None: |
| 77 # Try to find the version from the dart-sdk folder. | 77 # Try to find the version from the dart-sdk folder. |
| 78 revision_file_location = abspath(join(dirname(__file__), | 78 revision_file_location = abspath(join(dirname(__file__), |
| 79 '../../../%s/%s/dart-sdk/revision' % (utils.BUILD_ROOT[utils.GuessOS()], | 79 '../../../%s/%s/dart-sdk/revision' % (utils.BUILD_ROOT[utils.GuessOS()], |
| 80 utils.GetBuildConf('release', utils.GuessArchitecture())))) | 80 utils.GetBuildConf('release', utils.GuessArchitecture())))) |
| 81 with open(revision_file_location, 'r') as revision_file: | 81 with open(revision_file_location, 'r') as revision_file: |
| 82 revision = revision_file.readline(5) | 82 revision = revision_file.readline(5) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 95 version_file.close() | 95 version_file.close() |
| 96 Upload('./VERSION', GS_SITE + '/VERSION') | 96 Upload('./VERSION', GS_SITE + '/VERSION') |
| 97 | 97 |
| 98 # Clean up the files it creates. | 98 # Clean up the files it creates. |
| 99 ExecuteCommand(['rm', '-rf', './docs']) | 99 ExecuteCommand(['rm', '-rf', './docs']) |
| 100 ExecuteCommand(['rm', '-f', './VERSION']) | 100 ExecuteCommand(['rm', '-f', './VERSION']) |
| 101 | 101 |
| 102 | 102 |
| 103 if __name__ == '__main__': | 103 if __name__ == '__main__': |
| 104 main() | 104 main() |
| OLD | NEW |