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

Side by Side Diff: utils/pub/validator/compiled_dartdoc.dart

Issue 14297021: Move pub into sdk/lib/_internal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Disallow package: imports of pub. Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/validator.dart ('k') | utils/pub/validator/dependency.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library compiled_dartdoc_validator;
6
7 import 'dart:async';
8
9 import 'package:pathos/path.dart' as path;
10
11 import '../entrypoint.dart';
12 import '../io.dart';
13 import '../utils.dart';
14 import '../validator.dart';
15
16 /// Validates that a package doesn't contain compiled Dartdoc
17 /// output.
18 class CompiledDartdocValidator extends Validator {
19 CompiledDartdocValidator(Entrypoint entrypoint)
20 : super(entrypoint);
21
22 Future validate() {
23 return new Future.sync(() {
24 for (var entry in listDir(entrypoint.root.dir, recursive: true)) {
25 if (path.basename(entry) != "nav.json") continue;
26 var dir = path.dirname(entry);
27
28 // Look for tell-tale Dartdoc output files all in the same directory.
29 var files = [
30 entry,
31 path.join(dir, "index.html"),
32 path.join(dir, "styles.css"),
33 path.join(dir, "dart-logo-small.png"),
34 path.join(dir, "client-live-nav.js")
35 ];
36
37 if (files.every((val) => fileExists(val))) {
38 warnings.add("Avoid putting generated documentation in "
39 "${path.relative(dir)}.\n"
40 "Generated documentation bloats the package with redundant "
41 "data.");
42 }
43 }
44 });
45 }
46 }
OLDNEW
« no previous file with comments | « utils/pub/validator.dart ('k') | utils/pub/validator/dependency.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698