Index: sdk/lib/_internal/pub_generated/lib/src/validator/compiled_dartdoc.dart |
diff --git a/sdk/lib/_internal/pub_generated/lib/src/validator/compiled_dartdoc.dart b/sdk/lib/_internal/pub_generated/lib/src/validator/compiled_dartdoc.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3dc88b4a0e3702c89c274a05b0704439601e878b |
--- /dev/null |
+++ b/sdk/lib/_internal/pub_generated/lib/src/validator/compiled_dartdoc.dart |
@@ -0,0 +1,29 @@ |
+library pub.validator.compiled_dartdoc; |
+import 'dart:async'; |
+import 'package:path/path.dart' as path; |
+import '../entrypoint.dart'; |
+import '../io.dart'; |
+import '../utils.dart'; |
+import '../validator.dart'; |
+class CompiledDartdocValidator extends Validator { |
+ CompiledDartdocValidator(Entrypoint entrypoint) : super(entrypoint); |
+ Future validate() { |
+ return syncFuture(() { |
+ for (var entry in entrypoint.root.listFiles()) { |
+ if (path.basename(entry) != "nav.json") continue; |
+ var dir = path.dirname(entry); |
+ var files = [ |
+ entry, |
+ path.join(dir, "index.html"), |
+ path.join(dir, "styles.css"), |
+ path.join(dir, "dart-logo-small.png"), |
+ path.join(dir, "client-live-nav.js")]; |
+ if (files.every((val) => fileExists(val))) { |
+ warnings.add( |
+ "Avoid putting generated documentation in " "${path.relative(dir)}.\n" |
+ "Generated documentation bloats the package with redundant " "data."); |
+ } |
+ } |
+ }); |
+ } |
+} |