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 pubspec_field_validator; | 5 library pubspec_field_validator; |
6 | 6 |
| 7 import 'dart:async'; |
| 8 |
7 import '../entrypoint.dart'; | 9 import '../entrypoint.dart'; |
8 import '../system_cache.dart'; | 10 import '../system_cache.dart'; |
9 import '../validator.dart'; | 11 import '../validator.dart'; |
10 import '../version.dart'; | 12 import '../version.dart'; |
11 | 13 |
12 /// A validator that checks that the pubspec has valid "author" and "homepage" | 14 /// A validator that checks that the pubspec has valid "author" and "homepage" |
13 /// fields. | 15 /// fields. |
14 class PubspecFieldValidator extends Validator { | 16 class PubspecFieldValidator extends Validator { |
15 PubspecFieldValidator(Entrypoint entrypoint) | 17 PubspecFieldValidator(Entrypoint entrypoint) |
16 : super(entrypoint); | 18 : super(entrypoint); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 52 } |
51 | 53 |
52 var version = pubspec.fields['version']; | 54 var version = pubspec.fields['version']; |
53 if (version == null) { | 55 if (version == null) { |
54 errors.add('Your pubspec.yaml is missing a "version" field.'); | 56 errors.add('Your pubspec.yaml is missing a "version" field.'); |
55 } | 57 } |
56 | 58 |
57 return new Future.immediate(null); | 59 return new Future.immediate(null); |
58 } | 60 } |
59 } | 61 } |
OLD | NEW |