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

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

Issue 11557008: Make pub publish more user friendly: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge in path changes. Created 8 years 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/path.dart ('k') | utils/pub/validator/lib.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 validator; 5 library validator;
6 6
7 import 'entrypoint.dart'; 7 import 'entrypoint.dart';
8 import 'log.dart' as log; 8 import 'log.dart' as log;
9 import 'io.dart'; 9 import 'io.dart';
10 import 'system_cache.dart'; 10 import 'system_cache.dart';
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // TODO(nweiz): The sleep 0 here forces us to go async. This works around 50 // TODO(nweiz): The sleep 0 here forces us to go async. This works around
51 // 3356, which causes a bug if all validators are (synchronously) using 51 // 3356, which causes a bug if all validators are (synchronously) using
52 // Future.immediate and an error is thrown before a handler is set up. 52 // Future.immediate and an error is thrown before a handler is set up.
53 return sleep(0).chain((_) { 53 return sleep(0).chain((_) {
54 return Futures.wait(validators.map((validator) => validator.validate())); 54 return Futures.wait(validators.map((validator) => validator.validate()));
55 }).transform((_) { 55 }).transform((_) {
56 var errors = flatten(validators.map((validator) => validator.errors)); 56 var errors = flatten(validators.map((validator) => validator.errors));
57 var warnings = flatten(validators.map((validator) => validator.warnings)); 57 var warnings = flatten(validators.map((validator) => validator.warnings));
58 58
59 if (!errors.isEmpty) { 59 if (!errors.isEmpty) {
60 log.error("== Errors:"); 60 log.error("Missing requirements:");
61 for (var error in errors) { 61 for (var error in errors) {
62 log.error("* $error"); 62 log.error("* ${Strings.join(error.split('\n'), '\n ')}");
63 } 63 }
64 log.error(""); 64 log.error("");
65 } 65 }
66 66
67 if (!warnings.isEmpty) { 67 if (!warnings.isEmpty) {
68 log.warning("== Warnings:"); 68 log.warning("Suggestions:");
69 for (var warning in warnings) { 69 for (var warning in warnings) {
70 log.warning("* $warning"); 70 log.warning("* ${Strings.join(warning.split('\n'), '\n ')}");
71 } 71 }
72 log.warning(""); 72 log.warning("");
73 } 73 }
74 74
75 return new Pair<List<String>, List<String>>(errors, warnings); 75 return new Pair<List<String>, List<String>>(errors, warnings);
76 }); 76 });
77 } 77 }
78 } 78 }
OLDNEW
« no previous file with comments | « utils/pub/path.dart ('k') | utils/pub/validator/lib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698