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

Unified Diff: utils/pub/validator/compiled_dartdoc.dart

Issue 12079112: Make a bunch of stuff in pub synchronous. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix after merge. Created 7 years, 11 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 | « utils/pub/utils.dart ('k') | utils/pub/validator/dependency.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/validator/compiled_dartdoc.dart
diff --git a/utils/pub/validator/compiled_dartdoc.dart b/utils/pub/validator/compiled_dartdoc.dart
index c2c93f3a8708610624d1abdfce09a95813c4ce47..e5a7353d9927f2c20d1d1519ca6370bdf507ec73 100644
--- a/utils/pub/validator/compiled_dartdoc.dart
+++ b/utils/pub/validator/compiled_dartdoc.dart
@@ -21,27 +21,26 @@ class CompiledDartdocValidator extends Validator {
Future validate() {
return listDir(entrypoint.root.dir, recursive: true).then((entries) {
- return futureWhere(entries, (entry) {
+ for (var entry in entries) {
if (basename(entry) != "nav.json") return false;
var dir = dirname(entry);
// Look for tell-tale Dartdoc output files all in the same directory.
- return Future.wait([
- fileExists(entry),
- fileExists(join(dir, "index.html")),
- fileExists(join(dir, "styles.css")),
- fileExists(join(dir, "dart-logo-small.png")),
- fileExists(join(dir, "client-live-nav.js"))
- ]).then((results) => results.every((val) => val));
- }).then((files) {
- for (var dartdocDir in files.mappedBy(dirname)) {
- var relativePath = path.relative(dartdocDir);
+ var files = [
+ entry,
+ join(dir, "index.html"),
+ join(dir, "styles.css"),
+ join(dir, "dart-logo-small.png"),
+ join(dir, "client-live-nav.js")
+ ];
+
+ if (files.every((val) => fileExists(val))) {
warnings.add("Avoid putting generated documentation in "
- "$relativePath.\n"
+ "${path.relative(dir)}.\n"
"Generated documentation bloats the package with redundant "
"data.");
}
- });
+ }
});
}
}
« no previous file with comments | « utils/pub/utils.dart ('k') | utils/pub/validator/dependency.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698