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

Side by Side Diff: pkg/docgen/lib/docgen.dart

Issue 172743003: pkg/docgen: basic test of json output (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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 | pkg/docgen/pubspec.yaml » ('j') | pkg/docgen/test/generate_json_test.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// **docgen** is a tool for creating machine readable representations of Dart 5 /// **docgen** is a tool for creating machine readable representations of Dart
6 /// code metadata, including: classes, members, comments and annotations. 6 /// code metadata, including: classes, members, comments and annotations.
7 /// 7 ///
8 /// docgen is run on a `.dart` file or a directory containing `.dart` files. 8 /// docgen is run on a `.dart` file or a directory containing `.dart` files.
9 /// 9 ///
10 /// $ dart docgen.dart [OPTIONS] [FILE/DIR] 10 /// $ dart docgen.dart [OPTIONS] [FILE/DIR]
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 /// also be documented. 106 /// also be documented.
107 /// If [parseSdk] is `true`, then all Dart SDK libraries will be documented. 107 /// If [parseSdk] is `true`, then all Dart SDK libraries will be documented.
108 /// This option is useful when only the SDK libraries are needed. 108 /// This option is useful when only the SDK libraries are needed.
109 /// If [compile] is `true`, then after generating the documents, compile the 109 /// If [compile] is `true`, then after generating the documents, compile the
110 /// viewer with dart2js. 110 /// viewer with dart2js.
111 /// If [serve] is `true`, then after generating the documents we fire up a 111 /// If [serve] is `true`, then after generating the documents we fire up a
112 /// simple server to view the documentation. 112 /// simple server to view the documentation.
113 /// 113 ///
114 /// Returned Future completes with true if document generation is successful. 114 /// Returned Future completes with true if document generation is successful.
115 Future<bool> docgen(List<String> files, {String packageRoot, 115 Future<bool> docgen(List<String> files, {String packageRoot,
116 bool outputToYaml: true, bool includePrivate: false, bool includeSdk: false, 116 bool outputToYaml: false, bool includePrivate: false, bool includeSdk: false ,
117 bool parseSdk: false, bool append: false, String introFileName: '', 117 bool parseSdk: false, bool append: false, String introFileName: '',
118 out: _DEFAULT_OUTPUT_DIRECTORY, List<String> excludeLibraries : const [], 118 String out: _DEFAULT_OUTPUT_DIRECTORY,
119 List<String> excludeLibraries : const [],
119 bool includeDependentPackages: false, bool compile: false, 120 bool includeDependentPackages: false, bool compile: false,
120 bool serve: false, bool noDocs: false, String startPage, String pubScript, 121 bool serve: false, bool noDocs: false, String startPage, String pubScript,
121 String dartBinary}) { 122 String dartBinary}) {
122 var result; 123 var result;
123 if (!noDocs) { 124 if (!noDocs) {
124 _Viewer.ensureMovedViewerCode(); 125 _Viewer.ensureMovedViewerCode();
125 result = _Generator.generateDocumentation(files, packageRoot: packageRoot, 126 result = _Generator.generateDocumentation(files, packageRoot: packageRoot,
126 outputToYaml: outputToYaml, includePrivate: includePrivate, 127 outputToYaml: outputToYaml, includePrivate: includePrivate,
127 includeSdk: includeSdk, parseSdk: parseSdk, append: append, 128 includeSdk: includeSdk, parseSdk: parseSdk, append: append,
128 introFileName: introFileName, out: out, 129 introFileName: introFileName, out: out,
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after
2200 .map((e) => originalMirror.getField(e.simpleName).reflectee) 2201 .map((e) => originalMirror.getField(e.simpleName).reflectee)
2201 .where((e) => e != null) 2202 .where((e) => e != null)
2202 .toList(); 2203 .toList();
2203 } 2204 }
2204 2205
2205 Map toMap() => { 2206 Map toMap() => {
2206 'name': Indexable.getDocgenObject(mirror, owningLibrary).docName, 2207 'name': Indexable.getDocgenObject(mirror, owningLibrary).docName,
2207 'parameters': parameters 2208 'parameters': parameters
2208 }; 2209 };
2209 } 2210 }
OLDNEW
« no previous file with comments | « no previous file | pkg/docgen/pubspec.yaml » ('j') | pkg/docgen/test/generate_json_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698