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 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import '../command.dart'; | 7 import '../command.dart'; |
8 import '../log.dart' as log; | 8 import '../log.dart' as log; |
9 import '../solver/version_solver.dart'; | 9 import '../solver/version_solver.dart'; |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 argParser.addFlag('offline', | 23 argParser.addFlag('offline', |
24 help: 'Use cached packages instead of accessing the network.'); | 24 help: 'Use cached packages instead of accessing the network.'); |
25 | 25 |
26 argParser.addFlag('dry-run', abbr: 'n', negatable: false, | 26 argParser.addFlag('dry-run', abbr: 'n', negatable: false, |
27 help: "Report what dependencies would change but don't change any."); | 27 help: "Report what dependencies would change but don't change any."); |
28 | 28 |
29 argParser.addFlag('precompile', defaultsTo: true, | 29 argParser.addFlag('precompile', defaultsTo: true, |
30 help: "Precompile executables and transformed dependencies."); | 30 help: "Precompile executables and transformed dependencies."); |
31 | 31 |
32 argParser.addFlag('packages-dir', | 32 argParser.addFlag('packages-dir', |
33 negatable: true, defaultsTo: true, | 33 negatable: true, |
34 help: "Generate a packages/ directory when installing packages."); | 34 help: "Generate a packages/ directory when installing packages."); |
35 } | 35 } |
36 | 36 |
37 Future run() async { | 37 Future run() async { |
38 await entrypoint.acquireDependencies(SolveType.UPGRADE, | 38 await entrypoint.acquireDependencies(SolveType.UPGRADE, |
39 useLatest: argResults.rest, | 39 useLatest: argResults.rest, |
40 dryRun: argResults['dry-run'], | 40 dryRun: argResults['dry-run'], |
41 precompile: argResults['precompile'], | 41 precompile: argResults['precompile'], |
42 packagesDir: argResults['packages-dir']); | 42 packagesDir: argResults['packages-dir']); |
43 | 43 |
44 if (isOffline) { | 44 if (isOffline) { |
45 log.warning("Warning: Upgrading when offline may not update you to the " | 45 log.warning("Warning: Upgrading when offline may not update you to the " |
46 "latest versions of your dependencies."); | 46 "latest versions of your dependencies."); |
47 } | 47 } |
48 } | 48 } |
49 } | 49 } |
OLD | NEW |