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 package; | 5 library package; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'io.dart'; | 8 import 'io.dart'; |
9 import 'pubspec.dart'; | 9 import 'pubspec.dart'; |
10 import 'source.dart'; | 10 import 'source.dart'; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 | 50 |
51 /// The package's version. | 51 /// The package's version. |
52 Version get version => pubspec.version; | 52 Version get version => pubspec.version; |
53 | 53 |
54 /// The parsed pubspec associated with this package. | 54 /// The parsed pubspec associated with this package. |
55 final Pubspec pubspec; | 55 final Pubspec pubspec; |
56 | 56 |
57 /// The ids of the packages that this package depends on. This is what is | 57 /// The ids of the packages that this package depends on. This is what is |
58 /// specified in the pubspec when this package depends on another. | 58 /// specified in the pubspec when this package depends on another. |
59 Collection<PackageRef> get dependencies => pubspec.dependencies; | 59 List<PackageRef> get dependencies => pubspec.dependencies; |
60 | 60 |
61 /// Constructs a package with the given pubspec. The package will have no | 61 /// Constructs a package with the given pubspec. The package will have no |
62 /// directory associated with it. | 62 /// directory associated with it. |
63 Package.inMemory(this.pubspec) | 63 Package.inMemory(this.pubspec) |
64 : dir = null; | 64 : dir = null; |
65 | 65 |
66 /// Constructs a package. This should not be called directly. Instead, acquire | 66 /// Constructs a package. This should not be called directly. Instead, acquire |
67 /// packages from [load()]. | 67 /// packages from [load()]. |
68 Package._(this.dir, this.pubspec); | 68 Package._(this.dir, this.pubspec); |
69 | 69 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 class PubspecNameMismatchException implements Exception { | 198 class PubspecNameMismatchException implements Exception { |
199 final String expectedName; | 199 final String expectedName; |
200 final String actualName; | 200 final String actualName; |
201 | 201 |
202 PubspecNameMismatchException(this.expectedName, this.actualName); | 202 PubspecNameMismatchException(this.expectedName, this.actualName); |
203 | 203 |
204 String toString() => 'The name you specified for your dependency, ' | 204 String toString() => 'The name you specified for your dependency, ' |
205 '"$expectedName", doesn\'t match the name "$actualName" in its pubspec.'; | 205 '"$expectedName", doesn\'t match the name "$actualName" in its pubspec.'; |
206 } | 206 } |
OLD | NEW |