| 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.group_runner; | 5 library barback.group_runner; |
| 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_node.dart'; | 10 import 'asset_node.dart'; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 /// propagated as soon as they occur. | 46 /// propagated as soon as they occur. |
| 47 Stream<AssetNode> get onAsset => _onAsset; | 47 Stream<AssetNode> get onAsset => _onAsset; |
| 48 Stream<AssetNode> _onAsset; | 48 Stream<AssetNode> _onAsset; |
| 49 | 49 |
| 50 /// A stream that emits an event whenever any transforms in this group logs | 50 /// A stream that emits an event whenever any transforms in this group logs |
| 51 /// an entry. | 51 /// an entry. |
| 52 Stream<LogEntry> get onLog => _onLogPool.stream; | 52 Stream<LogEntry> get onLog => _onLogPool.stream; |
| 53 final _onLogPool = new StreamPool<LogEntry>.broadcast(); | 53 final _onLogPool = new StreamPool<LogEntry>.broadcast(); |
| 54 | 54 |
| 55 GroupRunner(AssetCascade cascade, this._group, this._location) { | 55 GroupRunner(AssetCascade cascade, this._group, this._location) { |
| 56 _addPhase(new Phase(cascade, _location), _group.phases.first); | 56 _addPhase(new Phase(cascade, _location), []); |
| 57 for (var phase in _group.phases.skip(1)) { | 57 for (var phase in _group.phases) { |
| 58 _addPhase(_phases.last.addPhase(), phase); | 58 _addPhase(_phases.last.addPhase(), phase); |
| 59 } | 59 } |
| 60 | 60 |
| 61 _onAsset = _phases.last.onAsset; | 61 _onAsset = _phases.last.onAsset; |
| 62 _onDone = _phases.last.onDone; | 62 _onDone = _phases.last.onDone; |
| 63 } | 63 } |
| 64 | 64 |
| 65 /// Add a phase with [contents] to [this]'s list of phases. | 65 /// Add a phase with [contents] to [this]'s list of phases. |
| 66 /// | 66 /// |
| 67 /// [contents] should be an inner [Iterable] from a [TransformGroup.phases] | 67 /// [contents] should be an inner [Iterable] from a [TransformGroup.phases] |
| (...skipping 19 matching lines...) Expand all Loading... |
| 87 | 87 |
| 88 /// Removes this group and all sub-phases within it. | 88 /// Removes this group and all sub-phases within it. |
| 89 void remove() { | 89 void remove() { |
| 90 for (var phase in _phases) { | 90 for (var phase in _phases) { |
| 91 phase.remove(); | 91 phase.remove(); |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 | 94 |
| 95 String toString() => "group in phase $_location for $_group"; | 95 String toString() => "group in phase $_location for $_group"; |
| 96 } | 96 } |
| OLD | NEW |