| OLD | NEW |
| 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 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'entrypoint.dart'; | 9 import 'entrypoint.dart'; |
| 10 import 'log.dart' as log; | 10 import 'log.dart' as log; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 return Future.wait(validators.map((validator) => validator.validate())) | 68 return Future.wait(validators.map((validator) => validator.validate())) |
| 69 .then((_) { | 69 .then((_) { |
| 70 var errors = | 70 var errors = |
| 71 flatten(validators.map((validator) => validator.errors)); | 71 flatten(validators.map((validator) => validator.errors)); |
| 72 var warnings = | 72 var warnings = |
| 73 flatten(validators.map((validator) => validator.warnings)); | 73 flatten(validators.map((validator) => validator.warnings)); |
| 74 | 74 |
| 75 if (!errors.isEmpty) { | 75 if (!errors.isEmpty) { |
| 76 log.error("Missing requirements:"); | 76 log.error("Missing requirements:"); |
| 77 for (var error in errors) { | 77 for (var error in errors) { |
| 78 log.error("* ${Strings.join(error.split('\n'), '\n ')}"); | 78 log.error("* ${error.split('\n').join('\n ')}"); |
| 79 } | 79 } |
| 80 log.error(""); | 80 log.error(""); |
| 81 } | 81 } |
| 82 | 82 |
| 83 if (!warnings.isEmpty) { | 83 if (!warnings.isEmpty) { |
| 84 log.warning("Suggestions:"); | 84 log.warning("Suggestions:"); |
| 85 for (var warning in warnings) { | 85 for (var warning in warnings) { |
| 86 log.warning("* ${Strings.join(warning.split('\n'), '\n ')}"); | 86 log.warning("* ${warning.split('\n').join('\n ')}"); |
| 87 } | 87 } |
| 88 log.warning(""); | 88 log.warning(""); |
| 89 } | 89 } |
| 90 | 90 |
| 91 return new Pair<List<String>, List<String>>(errors, warnings); | 91 return new Pair<List<String>, List<String>>(errors, warnings); |
| 92 }); | 92 }); |
| 93 } | 93 } |
| 94 } | 94 } |
| OLD | NEW |