| 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.phase_input; | 5 library barback.phase_input; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'asset.dart'; | 10 import 'asset.dart'; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 _onDirtyPool.close(); | 108 _onDirtyPool.close(); |
| 109 _onLogPool.close(); | 109 _onLogPool.close(); |
| 110 _inputForwarder.close(); | 110 _inputForwarder.close(); |
| 111 if (_passThroughController != null) { | 111 if (_passThroughController != null) { |
| 112 _passThroughController.setRemoved(); | 112 _passThroughController.setRemoved(); |
| 113 _passThroughController = null; | 113 _passThroughController = null; |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 /// Set this input's transformers to [transformers]. | 117 /// Set this input's transformers to [transformers]. |
| 118 void updateTransformers(Iterable<Transformer> newTransformers) { | 118 void updateTransformers(Iterable<Transformer> newTransformersIterable) { |
| 119 newTransformers = newTransformers.toSet(); | 119 var newTransformers = newTransformersIterable.toSet(); |
| 120 var oldTransformers = _transformers.toSet(); | 120 var oldTransformers = _transformers.toSet(); |
| 121 for (var removedTransformer in | 121 for (var removedTransformer in |
| 122 oldTransformers.difference(newTransformers)) { | 122 oldTransformers.difference(newTransformers)) { |
| 123 _transformers.remove(removedTransformer); | 123 _transformers.remove(removedTransformer); |
| 124 | 124 |
| 125 // If the transformers are being adjusted for [id], it will | 125 // If the transformers are being adjusted for [id], it will |
| 126 // automatically pick up on [removedTransformer] being gone. | 126 // automatically pick up on [removedTransformer] being gone. |
| 127 if (_adjustTransformersFuture != null) continue; | 127 if (_adjustTransformersFuture != null) continue; |
| 128 | 128 |
| 129 _transforms.removeWhere((transform) { | 129 _transforms.removeWhere((transform) { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 return new Future.value( | 306 return new Future.value( |
| 307 new Set<AssetNode>.from([_passThroughController.node])); | 307 new Set<AssetNode>.from([_passThroughController.node])); |
| 308 } | 308 } |
| 309 | 309 |
| 310 return Future.wait(_transforms.map((transform) { | 310 return Future.wait(_transforms.map((transform) { |
| 311 if (!transform.isDirty) return new Future.value(new Set()); | 311 if (!transform.isDirty) return new Future.value(new Set()); |
| 312 return transform.apply(); | 312 return transform.apply(); |
| 313 })).then((outputs) => unionAll(outputs)); | 313 })).then((outputs) => unionAll(outputs)); |
| 314 } | 314 } |
| 315 } | 315 } |
| OLD | NEW |