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

Unified Diff: utils/apidoc/apidoc.dart

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/line_doc_comments.dart ('k') | utils/pub/http.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/apidoc/apidoc.dart
diff --git a/utils/apidoc/apidoc.dart b/utils/apidoc/apidoc.dart
index 4caf0d508cf2e6c05b99bdc8c5492b0a91f317f7..fcaf1064b72517bbc069b5b16db0f268be788409 100644
--- a/utils/apidoc/apidoc.dart
+++ b/utils/apidoc/apidoc.dart
@@ -110,46 +110,48 @@ void main() {
});
var lister = new Directory.fromPath(doc.scriptDir.append('../../pkg')).list();
- lister.onDir = (dirPath) {
- var path = new Path(dirPath);
- var libName = path.filename;
-
- // TODO(rnystrom): Get rid of oldStylePath support when all packages are
- // using new layout. See #5106.
- var oldStylePath = path.append('${libName}.dart');
- var newStylePath = path.append('lib/${libName}.dart');
-
- if (new File.fromPath(oldStylePath).existsSync()) {
- apidocLibraries.add(oldStylePath);
- includedLibraries.add(libName);
- } else if (new File.fromPath(newStylePath).existsSync()) {
- apidocLibraries.add(newStylePath);
- includedLibraries.add(libName);
- } else {
- print('Warning: could not find package at $path');
- }
- };
-
- lister.onDone = (success) {
- print('Generating docs...');
- final apidoc = new Apidoc(mdn, outputDir, mode, generateAppCache,
- excludedLibraries, version);
- apidoc.dartdocPath =
- doc.scriptDir.append('../../sdk/lib/_internal/dartdoc/');
- // Select the libraries to include in the produced documentation:
- apidoc.includeApi = true;
- apidoc.includedLibraries = includedLibraries;
-
- Future.wait([copiedStatic, copiedApiDocStatic]).then((_) {
- apidoc.documentLibraries(apidocLibraries, libPath, pkgPath);
-
- final compiled = doc.compileScript(mode, outputDir, libPath);
-
- Future.wait([compiled, copiedStatic, copiedApiDocStatic]).then((_) {
- apidoc.cleanup();
+ lister.listen(
+ (entity) {
+ if (entity is Directory) {
+ var path = new Path(entity.path);
+ var libName = path.filename;
+
+ // TODO(rnystrom): Get rid of oldStylePath support when all
+ // packages are using new layout. See #5106.
+ var oldStylePath = path.append('${libName}.dart');
+ var newStylePath = path.append('lib/${libName}.dart');
+
+ if (new File.fromPath(oldStylePath).existsSync()) {
+ apidocLibraries.add(oldStylePath);
+ includedLibraries.add(libName);
+ } else if (new File.fromPath(newStylePath).existsSync()) {
+ apidocLibraries.add(newStylePath);
+ includedLibraries.add(libName);
+ } else {
+ print('Warning: could not find package at $path');
+ }
+ }
+ },
+ onDone: () {
+ print('Generating docs...');
+ final apidoc = new Apidoc(mdn, outputDir, mode, generateAppCache,
+ excludedLibraries, version);
+ apidoc.dartdocPath =
+ doc.scriptDir.append('../../sdk/lib/_internal/dartdoc/');
+ // Select the libraries to include in the produced documentation:
+ apidoc.includeApi = true;
+ apidoc.includedLibraries = includedLibraries;
+
+ Future.wait([copiedStatic, copiedApiDocStatic]).then((_) {
+ apidoc.documentLibraries(apidocLibraries, libPath, pkgPath);
+
+ final compiled = doc.compileScript(mode, outputDir, libPath);
+
+ Future.wait([compiled, copiedStatic, copiedApiDocStatic]).then((_) {
+ apidoc.cleanup();
+ });
+ });
});
- });
- };
}
class Apidoc extends doc.Dartdoc {
« no previous file with comments | « tools/line_doc_comments.dart ('k') | utils/pub/http.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698