OLD | NEW |
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 barback.package_graph; | 5 library barback.package_graph; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'asset_cascade.dart'; | 9 import 'asset_cascade.dart'; |
10 import 'asset_id.dart'; | 10 import 'asset_id.dart'; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // doesn't start building until some source in that graph is updated. | 77 // doesn't start building until some source in that graph is updated. |
78 _cascadeResults[package] = new BuildResult.success(); | 78 _cascadeResults[package] = new BuildResult.success(); |
79 _cascades[package] = cascade; | 79 _cascades[package] = cascade; |
80 cascade.onDirty.listen((_) { | 80 cascade.onDirty.listen((_) { |
81 _cascadeResults[package] = null; | 81 _cascadeResults[package] = null; |
82 }); | 82 }); |
83 | 83 |
84 cascade.onLog.listen((entry) { | 84 cascade.onLog.listen((entry) { |
85 if (_logController.hasListener) { | 85 if (_logController.hasListener) { |
86 _logController.add(entry); | 86 _logController.add(entry); |
87 } else { | 87 } else if (entry.level != LogLevel.FINE) { |
88 // No listeners, so just print entry. | 88 // No listeners, so just print entry. |
89 var buffer = new StringBuffer(); | 89 var buffer = new StringBuffer(); |
90 buffer.write("[${entry.level} ${entry.transform}] "); | 90 buffer.write("[${entry.level} ${entry.transform}] "); |
91 | 91 |
92 if (entry.span != null) { | 92 if (entry.span != null) { |
93 buffer.write(entry.span.getLocationMessage(entry.message)); | 93 buffer.write(entry.span.getLocationMessage(entry.message)); |
94 } else { | 94 } else { |
95 buffer.write(entry.message); | 95 buffer.write(entry.message); |
96 } | 96 } |
97 | 97 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 if (cascade == null) throw new ArgumentError("Unknown package $package."); | 191 if (cascade == null) throw new ArgumentError("Unknown package $package."); |
192 cascade.removeSources(ids); | 192 cascade.removeSources(ids); |
193 }); | 193 }); |
194 } | 194 } |
195 | 195 |
196 void updateTransformers(String package, | 196 void updateTransformers(String package, |
197 Iterable<Iterable<Transformer>> transformers) { | 197 Iterable<Iterable<Transformer>> transformers) { |
198 _cascades[package].updateTransformers(transformers); | 198 _cascades[package].updateTransformers(transformers); |
199 } | 199 } |
200 } | 200 } |
OLD | NEW |