| Index: packages/barback/lib/src/graph/phase.dart
|
| diff --git a/packages/barback/lib/src/graph/phase.dart b/packages/barback/lib/src/graph/phase.dart
|
| index 629291a11d00c4754ca8da08030f9b9e027d548c..fd5ad614a3ec28194a2dc39aaf0872d986623ba0 100644
|
| --- a/packages/barback/lib/src/graph/phase.dart
|
| +++ b/packages/barback/lib/src/graph/phase.dart
|
| @@ -92,14 +92,15 @@ class Phase {
|
| // Before any transformers are added, the phase should be dirty if and only
|
| // if any input is dirty.
|
| if (_classifiers.isEmpty && _groups.isEmpty && previous == null) {
|
| - return _inputs.any((input) => input.state.isDirty) ?
|
| - NodeStatus.RUNNING : NodeStatus.IDLE;
|
| + return _inputs.any((input) => input.state.isDirty)
|
| + ? NodeStatus.RUNNING
|
| + : NodeStatus.IDLE;
|
| }
|
|
|
| - var classifierStatus = NodeStatus.dirtiest(
|
| - _classifiers.values.map((classifier) => classifier.status));
|
| - var groupStatus = NodeStatus.dirtiest(
|
| - _groups.values.map((group) => group.status));
|
| + var classifierStatus = NodeStatus
|
| + .dirtiest(_classifiers.values.map((classifier) => classifier.status));
|
| + var groupStatus =
|
| + NodeStatus.dirtiest(_groups.values.map((group) => group.status));
|
| return (previous == null ? NodeStatus.IDLE : previous.status)
|
| .dirtier(classifierStatus)
|
| .dirtier(groupStatus);
|
| @@ -134,14 +135,13 @@ class Phase {
|
| // TODO(nweiz): Rather than passing the cascade and the phase everywhere,
|
| // create an interface that just exposes [getInput]. Emit errors via
|
| // [AssetNode]s.
|
| - Phase(AssetCascade cascade, String location)
|
| - : this._(cascade, location, 0);
|
| + Phase(AssetCascade cascade, String location) : this._(cascade, location, 0);
|
|
|
| Phase._(this.cascade, this._location, this._index, [this.previous]) {
|
| if (previous != null) {
|
| _previousOnAssetSubscription = previous.onAsset.listen(addInput);
|
| - _previousStatusSubscription = previous.onStatusChange
|
| - .listen((_) => _streams.changeStatus(status));
|
| + _previousStatusSubscription =
|
| + previous.onStatusChange.listen((_) => _streams.changeStatus(status));
|
| }
|
|
|
| onStatusChange.listen((status) {
|
| @@ -170,8 +170,8 @@ class Phase {
|
| void addInput(AssetNode node) {
|
| // Each group is one channel along which an asset may be forwarded, as is
|
| // each transformer.
|
| - var forwarder = new PhaseForwarder(
|
| - node, _classifiers.length, _groups.length);
|
| + var forwarder =
|
| + new PhaseForwarder(node, _classifiers.length, _groups.length);
|
| _forwarders[node.id] = forwarder;
|
| forwarder.onAsset.listen(_handleOutputWithoutForwarder);
|
| if (forwarder.output != null) {
|
| @@ -203,7 +203,7 @@ class Phase {
|
| /// If [id] is for a generated or transformed asset, this will wait until it
|
| /// has been created and return it. This means that the returned asset will
|
| /// always be [AssetState.AVAILABLE].
|
| - ///
|
| + ///
|
| /// If the output cannot be found, returns null.
|
| Future<AssetNode> getOutput(AssetId id) {
|
| return new Future.sync(() {
|
| @@ -231,8 +231,8 @@ class Phase {
|
|
|
| // Otherwise, store a completer for the asset node. If it's generated in
|
| // the future, we'll complete this completer.
|
| - var completer = _pendingOutputRequests.putIfAbsent(id,
|
| - () => new Completer.sync());
|
| + var completer =
|
| + _pendingOutputRequests.putIfAbsent(id, () => new Completer.sync());
|
| return completer.future;
|
| });
|
| }
|
| @@ -248,8 +248,8 @@ class Phase {
|
| }
|
|
|
| for (var transformer in newTransformers.difference(oldTransformers)) {
|
| - var classifier = new TransformerClassifier(
|
| - this, transformer, "$_location.$_index");
|
| + var classifier =
|
| + new TransformerClassifier(this, transformer, "$_location.$_index");
|
| _classifiers[transformer] = classifier;
|
| classifier.onAsset.listen(_handleOutput);
|
| _streams.onLogPool.add(classifier.onLog);
|
| @@ -259,7 +259,7 @@ class Phase {
|
| }
|
| }
|
|
|
| - var newGroups = DelegatingSet.typed/*<TransformerGroup>*/(
|
| + var newGroups = DelegatingSet.typed<TransformerGroup>(
|
| transformers.where((op) => op is TransformerGroup).toSet());
|
| var oldGroups = _groups.keys.toSet();
|
| for (var removed in oldGroups.difference(newGroups)) {
|
| @@ -354,8 +354,9 @@ class Phase {
|
| _outputs[asset.id].add(asset);
|
| } else {
|
| _outputs[asset.id] = new PhaseOutput(this, asset, "$_location.$_index");
|
| - _outputs[asset.id].onAsset.listen(_emit,
|
| - onDone: () => _outputs.remove(asset.id));
|
| + _outputs[asset.id]
|
| + .onAsset
|
| + .listen(_emit, onDone: () => _outputs.remove(asset.id));
|
| _emit(_outputs[asset.id].output);
|
| }
|
|
|
| @@ -387,12 +388,14 @@ class Phase {
|
| // either available or removed before trying again to access it.
|
| assert(asset.state.isDirty);
|
| asset.force();
|
| - asset.whenStateChanges().then((state) {
|
| - if (state.isRemoved) return getOutput(asset.id);
|
| - return asset;
|
| - })
|
| - .then((asset) => request.complete(asset))
|
| - .catchError(request.completeError);
|
| + asset
|
| + .whenStateChanges()
|
| + .then((state) {
|
| + if (state.isRemoved) return getOutput(asset.id);
|
| + return asset;
|
| + })
|
| + .then((asset) => request.complete(asset))
|
| + .catchError(request.completeError);
|
| }
|
|
|
| String toString() => "phase $_location.$_index";
|
|
|