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

Unified Diff: utils/apidoc/apidoc.dart

Issue 12614006: Revert "Remove pkg from apidoc." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart ('k') | utils/apidoc/apidoc.gyp » ('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 4bac5eb1001dcd4df85026cf0ef452d3b7ac4d19..88244e63becff3cd70210b55f7240b65b91609ae 100644
--- a/utils/apidoc/apidoc.dart
+++ b/utils/apidoc/apidoc.dart
@@ -108,30 +108,60 @@ void main() {
}
});
- 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, htmlDiff]).then((_) {
- Future<bool> documented =
- apidoc.documentLibraries(apidocLibraries, libPath, pkgPath);
-
- documented.then((_) {
- final compiled = doc.compileScript(mode, outputDir, libPath);
-
- Future.wait([compiled]).then((_) {
- apidoc.cleanup();
+ var lister = new Directory.fromPath(doc.scriptDir.append('../../pkg')).list();
+ lister.listen(
+ (entity) {
+ if (entity is Directory) {
+ var path = new Path(entity.path);
+ var libName = path.filename;
+
+ // Ignore hidden directories (like .svn) as well as pkg.xcodeproj.
+ if (libName.startsWith('.') || libName.endsWith('.xcodeproj')) {
+ return;
+ }
+
+ // 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, htmlDiff]).then((_) {
+ Future<bool> documented =
+ apidoc.documentLibraries(apidocLibraries, libPath, pkgPath);
+
+ documented.then((_) {
+ final compiled = doc.compileScript(mode, outputDir, libPath);
+
+ Future.wait([compiled]).then((_) {
+ apidoc.cleanup();
+ });
+ }, onError: (AsyncError asyncError) {
+ print('Generation failed: ${asyncError.error}');
+ apidoc.cleanup();
+ });
+ });
});
- }, onError: (AsyncError asyncError) {
- print('Generation failed: ${asyncError.error}');
- apidoc.cleanup();
- });
- });
}
class Apidoc extends doc.Dartdoc {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart ('k') | utils/apidoc/apidoc.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698