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

Unified Diff: utils/apidoc/apidoc.dart

Issue 10824367: Add all api docs from pkg (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: removed todo as well Created 8 years, 4 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 | « no previous file | no next file » | 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 981980817901435207c9fc1927946e71de0eaaf3..e73daa9fcd98b390b0827e336b45be8e2942b573 100644
--- a/utils/apidoc/apidoc.dart
+++ b/utils/apidoc/apidoc.dart
@@ -109,21 +109,32 @@ void main() {
apidocLibraries.add(new Path('dart:$name'));
}
});
- apidocLibraries.add(doc.scriptDir.append('../../pkg/unittest/unittest.dart'));
- apidocLibraries.add(doc.scriptDir.append('../../pkg/intl/intl.dart'));
-
- print('Generating docs...');
- final apidoc = new Apidoc(mdn, htmldoc, outputDir, mode, generateAppCache);
- // Select the libraries to include in the produced documentation:
- apidoc.includeApi = true;
- apidoc.includedLibraries = <String>[
- 'unittest',
- 'intl',
- ];
-
- Futures.wait([compiled, copiedStatic, copiedApiDocStatic]).then((_) {
- apidoc.documentLibraries(apidocLibraries, doc.libPath);
- });
+
+ final includedLibraries = <String>[];
+ var lister = new Directory.fromPath(
+ doc.scriptDir.append('../../pkg/')).list();
+ lister.onDir = (dirPath) {
+ var path = new Path(dirPath);
+ var libname = path.filename;
+ path = path.append('${libname}.dart');
+ if (new File.fromPath(path).existsSync()) {
+ apidocLibraries.add(path);
+ includedLibraries.add(libname);
+ } else {
+ print('Warning: could not find package at $path');
+ }
+ };
+ lister.onDone = (success) {
+ print('Generating docs...');
+ final apidoc = new Apidoc(mdn, htmldoc, outputDir, mode, generateAppCache);
+ // Select the libraries to include in the produced documentation:
+ apidoc.includeApi = true;
+ apidoc.includedLibraries = includedLibraries;
+
+ Futures.wait([compiled, copiedStatic, copiedApiDocStatic]).then((_) {
+ apidoc.documentLibraries(apidocLibraries, doc.libPath);
+ });
+ };
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698