Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: utils/pub/package.dart

Issue 14241005: Use the cached pubspec if possible for describing hosted packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Redo after realizing SystemCache already has this logic. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/hosted_source.dart ('k') | utils/pub/system_cache.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « utils/pub/hosted_source.dart ('k') | utils/pub/system_cache.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698