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

Side by Side Diff: pkg/fletchc/lib/src/verbs/run_verb.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 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
« no previous file with comments | « pkg/fletchc/lib/src/verbs/quit_verb.dart ('k') | pkg/fletchc/lib/src/verbs/show_verb.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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.run_verb;
6
7 import 'infrastructure.dart';
8
9 import 'documentation.dart' show
10 runDocumentation;
11
12 import '../worker/developer.dart' show
13 compileAndAttachToVmThen;
14
15 import '../worker/developer.dart' as developer;
16
17 const Action runAction =
18 const Action(
19 run, runDocumentation, requiresSession: true,
20 supportedTargets: const <TargetKind>[TargetKind.FILE]);
21
22 Future<int> run(AnalyzedSentence sentence, VerbContext context) {
23 bool terminateDebugger = sentence.options.terminateDebugger;
24 List<String> testDebuggerCommands = sentence.options.testDebuggerCommands;
25 return context.performTaskInWorker(
26 new RunTask(
27 sentence.targetUri, sentence.base, terminateDebugger,
28 testDebuggerCommands));
29 }
30
31 class RunTask extends SharedTask {
32 // Keep this class simple, see note in superclass.
33
34 final Uri script;
35
36 final Uri base;
37
38 /// When true, terminate the debugger session before returning from
39 /// [runTask]. Otherwise, the debugger session will be available after
40 /// [runTask] completes.
41 final bool terminateDebugger;
42
43 final List<String> testDebuggerCommands;
44
45 const RunTask(
46 this.script,
47 this.base,
48 this.terminateDebugger,
49 this.testDebuggerCommands);
50
51 Future<int> call(
52 CommandSender commandSender,
53 StreamIterator<ClientCommand> commandIterator) {
54 return runTask(
55 commandSender, commandIterator, SessionState.current, script, base,
56 terminateDebugger, testDebuggerCommands);
57 }
58 }
59
60 Future<int> runTask(
61 CommandSender commandSender,
62 StreamIterator<ClientCommand> commandIterator,
63 SessionState state,
64 Uri script,
65 Uri base,
66 bool terminateDebugger,
67 List<String> testDebuggerCommands) {
68 return compileAndAttachToVmThen(
69 commandSender,
70 commandIterator,
71 state,
72 script,
73 base,
74 terminateDebugger,
75 () => developer.run(
76 state, testDebuggerCommands: testDebuggerCommands,
77 terminateDebugger: terminateDebugger));
78 }
OLDNEW
« no previous file with comments | « pkg/fletchc/lib/src/verbs/quit_verb.dart ('k') | pkg/fletchc/lib/src/verbs/show_verb.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698