| 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.graph.phase; | 5 library barback.graph.phase; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:collection/collection.dart'; | 9 import 'package:collection/collection.dart'; |
| 10 | 10 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 new TransformerClassifier(this, transformer, "$_location.$_index"); | 252 new TransformerClassifier(this, transformer, "$_location.$_index"); |
| 253 _classifiers[transformer] = classifier; | 253 _classifiers[transformer] = classifier; |
| 254 classifier.onAsset.listen(_handleOutput); | 254 classifier.onAsset.listen(_handleOutput); |
| 255 _streams.onLogPool.add(classifier.onLog); | 255 _streams.onLogPool.add(classifier.onLog); |
| 256 classifier.onStatusChange.listen((_) => _streams.changeStatus(status)); | 256 classifier.onStatusChange.listen((_) => _streams.changeStatus(status)); |
| 257 for (var input in _inputs) { | 257 for (var input in _inputs) { |
| 258 classifier.addInput(input); | 258 classifier.addInput(input); |
| 259 } | 259 } |
| 260 } | 260 } |
| 261 | 261 |
| 262 var newGroups = DelegatingSet.typed/*<TransformerGroup>*/( | 262 var newGroups = DelegatingSet.typed<TransformerGroup>( |
| 263 transformers.where((op) => op is TransformerGroup).toSet()); | 263 transformers.where((op) => op is TransformerGroup).toSet()); |
| 264 var oldGroups = _groups.keys.toSet(); | 264 var oldGroups = _groups.keys.toSet(); |
| 265 for (var removed in oldGroups.difference(newGroups)) { | 265 for (var removed in oldGroups.difference(newGroups)) { |
| 266 _groups.remove(removed).remove(); | 266 _groups.remove(removed).remove(); |
| 267 } | 267 } |
| 268 | 268 |
| 269 for (var added in newGroups.difference(oldGroups)) { | 269 for (var added in newGroups.difference(oldGroups)) { |
| 270 var runner = new GroupRunner(previous, added, "$_location.$_index"); | 270 var runner = new GroupRunner(previous, added, "$_location.$_index"); |
| 271 _groups[added] = runner; | 271 _groups[added] = runner; |
| 272 runner.onAsset.listen(_handleOutput); | 272 runner.onAsset.listen(_handleOutput); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 .then((state) { | 393 .then((state) { |
| 394 if (state.isRemoved) return getOutput(asset.id); | 394 if (state.isRemoved) return getOutput(asset.id); |
| 395 return asset; | 395 return asset; |
| 396 }) | 396 }) |
| 397 .then((asset) => request.complete(asset)) | 397 .then((asset) => request.complete(asset)) |
| 398 .catchError(request.completeError); | 398 .catchError(request.completeError); |
| 399 } | 399 } |
| 400 | 400 |
| 401 String toString() => "phase $_location.$_index"; | 401 String toString() => "phase $_location.$_index"; |
| 402 } | 402 } |
| OLD | NEW |