Chromium Code Reviews| Index: sdk/lib/_internal/pub/lib/src/barback.dart |
| diff --git a/sdk/lib/_internal/pub/lib/src/barback.dart b/sdk/lib/_internal/pub/lib/src/barback.dart |
| index 7e317f63ecccb05af3aa98d1b09df49c5744a79e..b543876c3d5486e848eab887a10cbefddc3f0793 100644 |
| --- a/sdk/lib/_internal/pub/lib/src/barback.dart |
| +++ b/sdk/lib/_internal/pub/lib/src/barback.dart |
| @@ -17,6 +17,8 @@ import 'log.dart' as log; |
| import 'package_graph.dart'; |
| import 'utils.dart'; |
| +export 'barback/sources.dart' show WatcherType; |
| + |
| /// An identifier for a transformer and the configuration that will be passed to |
| /// it. |
| /// |
| @@ -108,7 +110,7 @@ class TransformerId { |
| /// the app when the server is started will be maintained. |
| Future<BarbackServer> createServer(String host, int port, PackageGraph graph, |
| BarbackMode mode, {Iterable<Transformer> builtInTransformers, |
| - bool watchForUpdates: true}) { |
| + WatcherType watcher: WatcherType.AUTO}) { |
| var provider = new PubPackageProvider(graph); |
| var barback = new Barback(provider); |
| @@ -117,8 +119,15 @@ Future<BarbackServer> createServer(String host, int port, PackageGraph graph, |
| return BarbackServer.bind(host, port, barback, graph.entrypoint.root.name) |
| .then((server) { |
| return new Future.sync(() { |
| - if (watchForUpdates) return watchSources(graph, barback); |
| - loadSources(graph, barback); |
| + if (watcher == WatcherType.NONE) { |
| + loadSources(graph, barback); |
| + return; |
| + } |
| + |
| + return watchSources(graph, barback, (directory) { |
| + if (watcher == WatcherType.AUTO) return new DirectoryWatcher(directory); |
| + return new PollingDirectoryWatcher(directory); |
|
Bob Nystrom
2013/11/08 19:29:08
Did you miss uploading a change here? This should
nweiz
2013/11/08 19:32:10
Yeah, I just forgot to upload the change that got
|
| + }); |
| }).then((_) { |
| var completer = new Completer(); |