OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * This generates the reference documentation for the core libraries that come | 6 * This generates the reference documentation for the core libraries that come |
7 * with dart. It is built on top of dartdoc, which is a general-purpose library | 7 * with dart. It is built on top of dartdoc, which is a general-purpose library |
8 * for generating docs from any Dart code. This library extends that to include | 8 * for generating docs from any Dart code. This library extends that to include |
9 * additional information and styling specific to our standard library. | 9 * additional information and styling specific to our standard library. |
10 * | 10 * |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 scriptDir.append('../../sdk/lib/_internal/dartdoc/'); | 143 scriptDir.append('../../sdk/lib/_internal/dartdoc/'); |
144 // Select the libraries to include in the produced documentation: | 144 // Select the libraries to include in the produced documentation: |
145 apidoc.includeApi = true; | 145 apidoc.includeApi = true; |
146 apidoc.includedLibraries = includedLibraries; | 146 apidoc.includedLibraries = includedLibraries; |
147 | 147 |
148 // TODO(amouravski): make apidoc use roughly the same flow as bin/dartdoc. | 148 // TODO(amouravski): make apidoc use roughly the same flow as bin/dartdoc. |
149 Future.wait([copiedStatic, copiedApiDocStatic, htmlDiff]) | 149 Future.wait([copiedStatic, copiedApiDocStatic, htmlDiff]) |
150 .then((_) => apidoc.documentLibraries(apidocLibraries, libPath, pkgPath)) | 150 .then((_) => apidoc.documentLibraries(apidocLibraries, libPath, pkgPath)) |
151 .then((_) => compileScript(mode, outputDir, libPath)) | 151 .then((_) => compileScript(mode, outputDir, libPath)) |
152 .then((_) => print(apidoc.status)) | 152 .then((_) => print(apidoc.status)) |
153 .catchError((e) => print('Error: generation failed: ${e.error}')) | 153 .catchError((e) { |
154 print('Error: generation failed: ${e}'); | |
kevmoo-old
2013/04/03 02:08:49
Does apidoc.cleanup() get called in the error case
ahe
2013/04/04 10:26:01
Good point, thank you!
Done.
| |
155 exit(1); | |
156 }) | |
154 .whenComplete(() => apidoc.cleanup()); | 157 .whenComplete(() => apidoc.cleanup()); |
155 }); | 158 }); |
156 } | 159 } |
157 | 160 |
158 class Apidoc extends Dartdoc { | 161 class Apidoc extends Dartdoc { |
159 /** Big ball of JSON containing the scraped MDN documentation. */ | 162 /** Big ball of JSON containing the scraped MDN documentation. */ |
160 final Map mdn; | 163 final Map mdn; |
161 | 164 |
162 | 165 |
163 // A set of type names (TypeMirror.simpleName values) to ignore while | 166 // A set of type names (TypeMirror.simpleName values) to ignore while |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
435 final typeName = member.owner.simpleName; | 438 final typeName = member.owner.simpleName; |
436 var memberName = '$typeName.${member.simpleName}'; | 439 var memberName = '$typeName.${member.simpleName}'; |
437 if (member is MethodMirror && (member.isConstructor || member.isFactory)) { | 440 if (member is MethodMirror && (member.isConstructor || member.isFactory)) { |
438 final separator = member.constructorName == '' ? '' : '.'; | 441 final separator = member.constructorName == '' ? '' : '.'; |
439 memberName = 'new $typeName$separator${member.constructorName}'; | 442 memberName = 'new $typeName$separator${member.constructorName}'; |
440 } | 443 } |
441 | 444 |
442 return a(memberUrl(member), memberName); | 445 return a(memberUrl(member), memberName); |
443 } | 446 } |
444 } | 447 } |
OLD | NEW |