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

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

Issue 52853004: Pass in "mode" to transformer plugins. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: "transformer" -> "configuration". Created 7 years, 1 month 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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.serve; 5 library pub.command.serve;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:barback/barback.dart';
10
9 import '../barback/dart_forwarding_transformer.dart'; 11 import '../barback/dart_forwarding_transformer.dart';
10 import '../barback/dart2js_transformer.dart'; 12 import '../barback/dart2js_transformer.dart';
11 import '../barback/pub_package_provider.dart'; 13 import '../barback/pub_package_provider.dart';
12 import '../barback.dart' as barback; 14 import '../barback.dart' as barback;
13 import '../command.dart'; 15 import '../command.dart';
14 import '../entrypoint.dart'; 16 import '../entrypoint.dart';
15 import '../exit_codes.dart' as exit_codes; 17 import '../exit_codes.dart' as exit_codes;
16 import '../io.dart'; 18 import '../io.dart';
17 import '../log.dart' as log; 19 import '../log.dart' as log;
18 import '../utils.dart'; 20 import '../utils.dart';
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 }).then((graph) { 70 }).then((graph) {
69 // TODO(rnystrom): Add support for dart2dart transformer here. 71 // TODO(rnystrom): Add support for dart2dart transformer here.
70 var builtInTransformers = null; 72 var builtInTransformers = null;
71 if (useDart2JS) { 73 if (useDart2JS) {
72 builtInTransformers = [ 74 builtInTransformers = [
73 new Dart2JSTransformer(graph, minify: minify), 75 new Dart2JSTransformer(graph, minify: minify),
74 new DartForwardingTransformer() 76 new DartForwardingTransformer()
75 ]; 77 ];
76 } 78 }
77 79
78 return barback.createServer(hostname, port, graph, 80 // TODO(rnystrom): Allow specifying other modes.
81 return barback.createServer(hostname, port, graph, BarbackMode.DEBUG,
79 builtInTransformers: builtInTransformers); 82 builtInTransformers: builtInTransformers);
80 }).then((server) { 83 }).then((server) {
81 /// This completer is used to keep pub running (by not completing) and 84 /// This completer is used to keep pub running (by not completing) and
82 /// to pipe fatal errors to pub's top-level error-handling machinery. 85 /// to pipe fatal errors to pub's top-level error-handling machinery.
83 var completer = new Completer(); 86 var completer = new Completer();
84 87
85 server.barback.errors.listen((error) { 88 server.barback.errors.listen((error) {
86 log.error(log.red("Build error:\n$error")); 89 log.error(log.red("Build error:\n$error"));
87 }); 90 });
88 91
(...skipping 27 matching lines...) Expand all
116 if (!completer.isCompleted) completer.completeError(error, stackTrace); 119 if (!completer.isCompleted) completer.completeError(error, stackTrace);
117 }); 120 });
118 121
119 log.message("Serving ${entrypoint.root.name} " 122 log.message("Serving ${entrypoint.root.name} "
120 "on http://$hostname:${server.port}"); 123 "on http://$hostname:${server.port}");
121 124
122 return completer.future; 125 return completer.future;
123 }); 126 });
124 } 127 }
125 } 128 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/build.dart ('k') | sdk/lib/_internal/pub/test/serve/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698