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

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

Issue 63303002: Stopgap generating docgen all at once until --append mode can be fixed (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | pkg/docgen/bin/docgen.dart » ('j') | pkg/docgen/lib/docgen.dart » ('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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if not specified_pkg: 75 if not specified_pkg:
76 sdk_cmd.extend(['--package-root=%s' % PACKAGE_ROOT]) 76 sdk_cmd.extend(['--package-root=%s' % PACKAGE_ROOT])
77 sdk_cmd.extend(docgen_options) 77 sdk_cmd.extend(docgen_options)
78 return sdk_cmd 78 return sdk_cmd
79 79
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 sdk_cmd = [DART_EXECUTABLE, 'docgen.dart', '--parse-sdk'] 85 # TODO(alanknight): The --append option doesn't work properly. It overwrites
86 ExecuteCommand(AddUserDocgenOptions(sdk_cmd, docgen_options)) 86 # existing files with new information. Known symptom is that it loses subclasses
87 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 doc_dir = join(DART_DIR, 'pkg') 89 doc_dir = join(DART_DIR, 'pkg')
89 cmd_lst = [DART_EXECUTABLE, '--old_gen_heap_size=1024', 90 cmd_lst = [DART_EXECUTABLE, '--old_gen_heap_size=1024',
90 '--package-root=%s' % PACKAGE_ROOT, 'docgen.dart', '--append'] 91 '--package-root=%s' % PACKAGE_ROOT, 'docgen.dart', '--include-sdk' ]
91 cmd_str = ' '.join(AddUserDocgenOptions(cmd_lst, docgen_options, True)) 92 cmd_str = ' '.join(AddUserDocgenOptions(cmd_lst, docgen_options, True))
92 # 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.
93 (return_code, _) = ExecuteCommandString('%s %s' % (cmd_str, doc_dir)) 94 (return_code, _) = ExecuteCommandString('%s %s' % (cmd_str, doc_dir))
94 if return_code != 0: 95 if return_code != 0:
95 # 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
96 # individually. 97 # individually.
97 failed_pkgs = [] 98 failed_pkgs = []
98 for directory in os.listdir(join(DART_DIR, 'pkg')): 99 for directory in os.listdir(join(DART_DIR, 'pkg')):
99 doc_dir = join(DART_DIR, 'pkg', directory) 100 doc_dir = join(DART_DIR, 'pkg', directory)
100 if (directory not in EXCLUDED_PACKAGES and 101 if (directory not in EXCLUDED_PACKAGES and
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 print ( 151 print (
151 "\nPoint your browser to the address of the 'default' server below.") 152 "\nPoint your browser to the address of the 'default' server below.")
152 raw_input("Press <RETURN> to terminate the server.\n\n") 153 raw_input("Press <RETURN> to terminate the server.\n\n")
153 server.terminate() 154 server.terminate()
154 finally: 155 finally:
155 os.chdir(cwd) 156 os.chdir(cwd)
156 subprocess.call(['rm', '-rf', 'dartdoc-viewer']) 157 subprocess.call(['rm', '-rf', 'dartdoc-viewer'])
157 158
158 if __name__ == '__main__': 159 if __name__ == '__main__':
159 main() 160 main()
OLDNEW
« no previous file with comments | « no previous file | pkg/docgen/bin/docgen.dart » ('j') | pkg/docgen/lib/docgen.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698