Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: pkg/docgen/bin/dartdoc.py

Issue 116043013: Add a snapshot for docgen and use it in the build (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Everything except the strictly snapshot-related pulled out to a different CL Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/bin/dartdoc.bat » ('j') | tools/create_sdk.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2013, 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 # Run this script to generate documentation for a directory and serve 7 # Run this script to generate documentation for a directory and serve
8 # the results to localhost for viewing in the browser. 8 # the results to localhost for viewing in the browser.
9 9
10 import optparse 10 import optparse
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 def GenerateAllDocs(docgen_options): 81 def GenerateAllDocs(docgen_options):
82 '''Generate all documentation for the SDK and all packages in the repository. 82 '''Generate all documentation for the SDK and all packages in the repository.
83 We first attempt to run the quickest path to generate all docs, but if that 83 We first attempt to run the quickest path to generate all docs, but if that
84 fails, we fall back on a slower option.''' 84 fails, we fall back on a slower option.'''
85 # TODO(alanknight): The --append option doesn't work properly. It overwrites 85 # TODO(alanknight): The --append option doesn't work properly. It overwrites
86 # existing files with new information. Known symptom is that it loses subclasses 86 # existing files with new information. Known symptom is that it loses subclasses
87 # from the SDK and includes only the ones from pkg. So right now our only option 87 # from the SDK and includes only the ones from pkg. So right now our only option
88 # is to do everything in one pass. 88 # is to do everything in one pass.
89 doc_dir = join(DART_DIR, 'pkg') 89 doc_dir = join(DART_DIR, 'pkg')
90 cmd_lst = [DART_EXECUTABLE, '--old_gen_heap_size=1024', 90 cmd_lst = [DART_EXECUTABLE,
91 '--package-root=%s' % PACKAGE_ROOT, 'docgen.dart', '--include-sdk' ] 91 '--package-root=%s' % PACKAGE_ROOT, 'docgen.dart', '--include-sdk' ]
92 cmd_str = ' '.join(AddUserDocgenOptions(cmd_lst, docgen_options, True)) 92 cmd_str = ' '.join(AddUserDocgenOptions(cmd_lst, docgen_options, True))
93 # Try to run all pkg docs together at once as it's fastest. 93 # Try to run all pkg docs together at once as it's fastest.
94 (return_code, _) = ExecuteCommandString('%s %s' % (cmd_str, doc_dir)) 94 (return_code, _) = ExecuteCommandString('%s %s' % (cmd_str, doc_dir))
95 if return_code != 0: 95 if return_code != 0:
96 # We failed to run all the pkg docs, so try to generate docs for each pkg 96 # We failed to run all the pkg docs, so try to generate docs for each pkg
97 # individually. 97 # individually.
98 failed_pkgs = [] 98 failed_pkgs = []
99 for directory in os.listdir(join(DART_DIR, 'pkg')): 99 for directory in os.listdir(join(DART_DIR, 'pkg')):
100 doc_dir = join(DART_DIR, 'pkg', directory) 100 doc_dir = join(DART_DIR, 'pkg', directory)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 print ( 156 print (
157 "\nPoint your browser to the address of the 'default' server below.") 157 "\nPoint your browser to the address of the 'default' server below.")
158 raw_input("Press <RETURN> to terminate the server.\n\n") 158 raw_input("Press <RETURN> to terminate the server.\n\n")
159 server.terminate() 159 server.terminate()
160 finally: 160 finally:
161 os.chdir(cwd) 161 os.chdir(cwd)
162 subprocess.call(['rm', '-rf', 'dartdoc-viewer']) 162 subprocess.call(['rm', '-rf', 'dartdoc-viewer'])
163 163
164 if __name__ == '__main__': 164 if __name__ == '__main__':
165 main() 165 main()
OLDNEW
« no previous file with comments | « no previous file | sdk/bin/dartdoc.bat » ('j') | tools/create_sdk.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698