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 | 8 |
9 import 'package:pathos/path.dart' as path; | 9 import 'package:pathos/path.dart' as path; |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 var sourceComp = source.name.compareTo(other.source.name); | 139 var sourceComp = source.name.compareTo(other.source.name); |
140 if (sourceComp != 0) return sourceComp; | 140 if (sourceComp != 0) return sourceComp; |
141 | 141 |
142 var nameComp = name.compareTo(other.name); | 142 var nameComp = name.compareTo(other.name); |
143 if (nameComp != 0) return nameComp; | 143 if (nameComp != 0) return nameComp; |
144 | 144 |
145 return version.compareTo(other.version); | 145 return version.compareTo(other.version); |
146 } | 146 } |
147 | 147 |
148 /// Returns the pubspec for this package. | 148 /// Returns the pubspec for this package. |
149 Future<Pubspec> describe() => source.describe(this); | 149 Future<Pubspec> describe() => source.systemCache.describe(this); |
150 | 150 |
151 /// Returns a future that completes to the resovled [PackageId] for this id. | 151 /// Returns a future that completes to the resovled [PackageId] for this id. |
152 Future<PackageId> get resolved => source.resolveId(this); | 152 Future<PackageId> get resolved => source.resolveId(this); |
153 | 153 |
154 /// Returns a [PackageRef] that references this package and constrains its | 154 /// Returns a [PackageRef] that references this package and constrains its |
155 /// version to exactly match [version]. | 155 /// version to exactly match [version]. |
156 PackageRef toRef() { | 156 PackageRef toRef() { |
157 return new PackageRef(name, source, version, description); | 157 return new PackageRef(name, source, version, description); |
158 } | 158 } |
159 | 159 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 class PubspecNameMismatchException implements Exception { | 230 class PubspecNameMismatchException implements Exception { |
231 final String expectedName; | 231 final String expectedName; |
232 final String actualName; | 232 final String actualName; |
233 | 233 |
234 PubspecNameMismatchException(this.expectedName, this.actualName); | 234 PubspecNameMismatchException(this.expectedName, this.actualName); |
235 | 235 |
236 String toString() => 'The name you specified for your dependency, ' | 236 String toString() => 'The name you specified for your dependency, ' |
237 '"$expectedName", doesn\'t match the name "$actualName" in its pubspec.'; | 237 '"$expectedName", doesn\'t match the name "$actualName" in its pubspec.'; |
238 } | 238 } |
OLD | NEW |