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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/validator/compiled_dartdoc.dart

Issue 599303002: Don't use .gitignore when determining what to build/serve/run. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use .gitignore in dartdoc validator. Created 6 years, 2 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub.validator.compiled_dartdoc; 5 library pub.validator.compiled_dartdoc;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:path/path.dart' as path; 9 import 'package:path/path.dart' as path;
10 10
11 import '../entrypoint.dart'; 11 import '../entrypoint.dart';
12 import '../io.dart'; 12 import '../io.dart';
13 import '../validator.dart'; 13 import '../validator.dart';
14 14
15 /// Validates that a package doesn't contain compiled Dartdoc 15 /// Validates that a package doesn't contain compiled Dartdoc
16 /// output. 16 /// output.
17 class CompiledDartdocValidator extends Validator { 17 class CompiledDartdocValidator extends Validator {
18 CompiledDartdocValidator(Entrypoint entrypoint) 18 CompiledDartdocValidator(Entrypoint entrypoint)
19 : super(entrypoint); 19 : super(entrypoint);
20 20
21 Future validate() { 21 Future validate() {
22 return new Future.sync(() { 22 return new Future.sync(() {
23 for (var entry in entrypoint.root.listFiles()) { 23 for (var entry in entrypoint.root.listFiles(useGitIgnore: true)) {
24 if (path.basename(entry) != "nav.json") continue; 24 if (path.basename(entry) != "nav.json") continue;
25 var dir = path.dirname(entry); 25 var dir = path.dirname(entry);
26 26
27 // Look for tell-tale Dartdoc output files all in the same directory. 27 // Look for tell-tale Dartdoc output files all in the same directory.
28 var files = [ 28 var files = [
29 entry, 29 entry,
30 path.join(dir, "index.html"), 30 path.join(dir, "index.html"),
31 path.join(dir, "styles.css"), 31 path.join(dir, "styles.css"),
32 path.join(dir, "dart-logo-small.png"), 32 path.join(dir, "dart-logo-small.png"),
33 path.join(dir, "client-live-nav.js") 33 path.join(dir, "client-live-nav.js")
34 ]; 34 ];
35 35
36 if (files.every((val) => fileExists(val))) { 36 if (files.every((val) => fileExists(val))) {
37 warnings.add("Avoid putting generated documentation in " 37 warnings.add("Avoid putting generated documentation in "
38 "${path.relative(dir)}.\n" 38 "${path.relative(dir)}.\n"
39 "Generated documentation bloats the package with redundant " 39 "Generated documentation bloats the package with redundant "
40 "data."); 40 "data.");
41 } 41 }
42 } 42 }
43 }); 43 });
44 } 44 }
45 } 45 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/package.dart ('k') | sdk/lib/_internal/pub/test/package_list_files_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698