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 pub.pubspec; | 5 library pub.pubspec; |
6 | 6 |
7 import 'package:path/path.dart' as path; | 7 import 'package:path/path.dart' as path; |
| 8 import 'package:pub_semver/pub_semver.dart'; |
8 import 'package:source_span/source_span.dart'; | 9 import 'package:source_span/source_span.dart'; |
9 import 'package:yaml/yaml.dart'; | 10 import 'package:yaml/yaml.dart'; |
10 | 11 |
11 import 'barback/transformer_config.dart'; | 12 import 'barback/transformer_config.dart'; |
12 import 'exceptions.dart'; | 13 import 'exceptions.dart'; |
13 import 'io.dart'; | 14 import 'io.dart'; |
14 import 'package.dart'; | 15 import 'package.dart'; |
15 import 'source_registry.dart'; | 16 import 'source_registry.dart'; |
16 import 'utils.dart'; | 17 import 'utils.dart'; |
17 import 'version.dart'; | |
18 | 18 |
19 /// The parsed contents of a pubspec file. | 19 /// The parsed contents of a pubspec file. |
20 /// | 20 /// |
21 /// The fields of a pubspec are, for the most part, validated when they're first | 21 /// The fields of a pubspec are, for the most part, validated when they're first |
22 /// accessed. This allows a partially-invalid pubspec to be used if only the | 22 /// accessed. This allows a partially-invalid pubspec to be used if only the |
23 /// valid portions are relevant. To get a list of all errors in the pubspec, use | 23 /// valid portions are relevant. To get a list of all errors in the pubspec, use |
24 /// [allErrors]. | 24 /// [allErrors]. |
25 class Pubspec { | 25 class Pubspec { |
26 // If a new lazily-initialized field is added to this class and the | 26 // If a new lazily-initialized field is added to this class and the |
27 // initialization can throw a [PubspecException], that error should also be | 27 // initialization can throw a [PubspecException], that error should also be |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 implements ApplicationException { | 579 implements ApplicationException { |
580 PubspecException(String message, SourceSpan span) | 580 PubspecException(String message, SourceSpan span) |
581 : super(message, span); | 581 : super(message, span); |
582 } | 582 } |
583 | 583 |
584 /// Returns whether [uri] is a file URI. | 584 /// Returns whether [uri] is a file URI. |
585 /// | 585 /// |
586 /// This is slightly more complicated than just checking if the scheme is | 586 /// This is slightly more complicated than just checking if the scheme is |
587 /// 'file', since relative URIs also refer to the filesystem on the VM. | 587 /// 'file', since relative URIs also refer to the filesystem on the VM. |
588 bool _isFileUri(Uri uri) => uri.scheme == 'file' || uri.scheme == ''; | 588 bool _isFileUri(Uri uri) => uri.scheme == 'file' || uri.scheme == ''; |
OLD | NEW |