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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/command/cache_add.dart

Issue 602253002: Use pub_semver package in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.command.cache_add; 5 library pub.command.cache_add;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:pub_semver/pub_semver.dart';
10
9 import '../command.dart'; 11 import '../command.dart';
10 import '../log.dart' as log; 12 import '../log.dart' as log;
11 import '../package.dart'; 13 import '../package.dart';
12 import '../utils.dart'; 14 import '../utils.dart';
13 import '../version.dart';
14 15
15 /// Handles the `cache add` pub command. 16 /// Handles the `cache add` pub command.
16 class CacheAddCommand extends PubCommand { 17 class CacheAddCommand extends PubCommand {
17 String get description => "Install a package."; 18 String get description => "Install a package.";
18 String get usage => 19 String get usage =>
19 "pub cache add <package> [--version <constraint>] [--all]"; 20 "pub cache add <package> [--version <constraint>] [--all]";
20 String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-cache.html"; 21 String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-cache.html";
21 bool get takesArguments => true; 22 bool get takesArguments => true;
22 23
23 CacheAddCommand() { 24 CacheAddCommand() {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 versions.sort(); 87 versions.sort();
87 return Future.forEach(versions, downloadVersion); 88 return Future.forEach(versions, downloadVersion);
88 } else { 89 } else {
89 // Pick the best matching version. 90 // Pick the best matching version.
90 versions.sort(Version.prioritize); 91 versions.sort(Version.prioritize);
91 return downloadVersion(versions.last); 92 return downloadVersion(versions.last);
92 } 93 }
93 }); 94 });
94 } 95 }
95 } 96 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/cached_package.dart ('k') | sdk/lib/_internal/pub/lib/src/command/global_activate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698