| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | |
| 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.md file. | |
| 4 | |
| 5 library fletchc.verbs.x_upgrade_verb; | |
| 6 | |
| 7 import 'infrastructure.dart'; | |
| 8 import '../worker/developer.dart' show upgradeAgent; | |
| 9 import 'documentation.dart' show upgradeDocumentation; | |
| 10 | |
| 11 const Action upgradeAction = const Action( | |
| 12 upgradeFunction, | |
| 13 upgradeDocumentation, | |
| 14 requiresSession: true, | |
| 15 supportsWithUri: true, | |
| 16 requiredTarget: TargetKind.AGENT); | |
| 17 | |
| 18 Future upgradeFunction(AnalyzedSentence sentence, VerbContext context) async { | |
| 19 return context.performTaskInWorker( | |
| 20 new UpgradeTask(sentence.base, sentence.withUri)); | |
| 21 } | |
| 22 | |
| 23 class UpgradeTask extends SharedTask { | |
| 24 final Uri base; | |
| 25 final Uri package; | |
| 26 | |
| 27 UpgradeTask(this.base, this.package); | |
| 28 | |
| 29 Future call( | |
| 30 CommandSender commandSender, | |
| 31 StreamIterator<ClientCommand> commandIterator) async { | |
| 32 return await upgradeAgent(commandSender, commandIterator, | |
| 33 SessionState.current, base, package); | |
| 34 } | |
| 35 } | |
| OLD | NEW |