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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 apidoc.dartdocPath = | 173 apidoc.dartdocPath = |
174 scriptDir.append('../../sdk/lib/_internal/dartdoc/'); | 174 scriptDir.append('../../sdk/lib/_internal/dartdoc/'); |
175 // Select the libraries to include in the produced documentation: | 175 // Select the libraries to include in the produced documentation: |
176 apidoc.includeApi = true; | 176 apidoc.includeApi = true; |
177 apidoc.includedLibraries = includedLibraries; | 177 apidoc.includedLibraries = includedLibraries; |
178 | 178 |
179 // TODO(amouravski): make apidoc use roughly the same flow as bin/dartdoc. | 179 // TODO(amouravski): make apidoc use roughly the same flow as bin/dartdoc. |
180 Future.wait([copiedStatic, copiedApiDocStatic, htmlDiff]) | 180 Future.wait([copiedStatic, copiedApiDocStatic, htmlDiff]) |
181 .then((_) => apidoc.documentLibraries(apidocLibraries, libPath, | 181 .then((_) => apidoc.documentLibraries(apidocLibraries, libPath, |
182 packageRoot)) | 182 packageRoot)) |
183 .then((_) => compileScript(mode, outputDir, libPath)) | 183 .then((_) => compileScript(mode, outputDir, libPath, apidoc.tmpPath)) |
184 .then((_) => print(apidoc.status)) | 184 .then((_) => print(apidoc.status)) |
185 .catchError((e) { | 185 .catchError((e) { |
186 print('Error: generation failed: ${e}'); | 186 print('Error: generation failed: ${e}'); |
187 var trace = getAttachedStackTrace(e); | 187 var trace = getAttachedStackTrace(e); |
188 if (trace != null) print("StackTrace: $trace"); | 188 if (trace != null) print("StackTrace: $trace"); |
189 apidoc.cleanup(); | 189 apidoc.cleanup(); |
190 exit(1); | 190 exit(1); |
191 }) | 191 }) |
192 .whenComplete(() => apidoc.cleanup()); | 192 .whenComplete(() => apidoc.cleanup()); |
193 }); | 193 }); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 /** Converts a local path string to a `file:` [Uri]. */ | 484 /** Converts a local path string to a `file:` [Uri]. */ |
485 Uri _pathToFileUri(String path) { | 485 Uri _pathToFileUri(String path) { |
486 path = pathos.absolute(path); | 486 path = pathos.absolute(path); |
487 if (Platform.operatingSystem != 'windows') { | 487 if (Platform.operatingSystem != 'windows') { |
488 return Uri.parse('file://$path'); | 488 return Uri.parse('file://$path'); |
489 } else { | 489 } else { |
490 return Uri.parse('file:///${path.replaceAll("\\", "/")}'); | 490 return Uri.parse('file:///${path.replaceAll("\\", "/")}'); |
491 } | 491 } |
492 } | 492 } |
493 | 493 |
OLD | NEW |