| Index: packages/barback/lib/src/graph/transform_node.dart
|
| diff --git a/packages/barback/lib/src/graph/transform_node.dart b/packages/barback/lib/src/graph/transform_node.dart
|
| index 39f5c52884b7a8e633ae411980affb666a481bb4..d2755ca9e8a163939f60684dd5cab05fce0b8720 100644
|
| --- a/packages/barback/lib/src/graph/transform_node.dart
|
| +++ b/packages/barback/lib/src/graph/transform_node.dart
|
| @@ -68,7 +68,8 @@ class TransformNode {
|
| return NodeStatus.IDLE;
|
| }
|
|
|
| - if (_declaring && _state != _State.DECLARING &&
|
| + if (_declaring &&
|
| + _state != _State.DECLARING &&
|
| _state != _State.NEEDS_DECLARE) {
|
| return NodeStatus.MATERIALIZING;
|
| } else {
|
| @@ -80,8 +81,8 @@ class TransformNode {
|
| ///
|
| /// [TransformInfo] is the publicly-visible representation of a transform
|
| /// node.
|
| - TransformInfo get info => new TransformInfo(transformer,
|
| - new AssetId(phase.cascade.package, key));
|
| + TransformInfo get info =>
|
| + new TransformInfo(transformer, new AssetId(phase.cascade.package, key));
|
|
|
| /// Whether this is a declaring transform.
|
| ///
|
| @@ -89,7 +90,8 @@ class TransformNode {
|
| /// DeclaringAggregateTransformer`, but if a declaring and non-lazy
|
| /// transformer emits an error during `declareOutputs` it's treated as though
|
| /// it wasn't declaring.
|
| - bool get _declaring => transformer is DeclaringAggregateTransformer &&
|
| + bool get _declaring =>
|
| + transformer is DeclaringAggregateTransformer &&
|
| (_state == _State.DECLARING || _declaredOutputs != null);
|
|
|
| /// Whether this transform has been forced since it last finished applying.
|
| @@ -140,7 +142,8 @@ class TransformNode {
|
| // can run [apply] even if [force] hasn't been called, since [transformer]
|
| // should run eagerly if possible.
|
| bool get _canRunDeclaringEagerly =>
|
| - _declaring && transformer is! LazyAggregateTransformer &&
|
| + _declaring &&
|
| + transformer is! LazyAggregateTransformer &&
|
| _primaries.every((input) => input.state.isAvailable);
|
|
|
| /// Which primary inputs the most recent run of this transform has declared
|
| @@ -220,8 +223,8 @@ class TransformNode {
|
| _primaries.add(input);
|
| if (_forced) input.force();
|
|
|
| - _primarySubscriptions[input.id] = input.onStateChange
|
| - .listen((_) => _onPrimaryStateChange(input));
|
| + _primarySubscriptions[input.id] =
|
| + input.onStateChange.listen((_) => _onPrimaryStateChange(input));
|
|
|
| if (_state == _State.DECLARING && !_declareController.isDone) {
|
| // If we're running `declareOutputs` and its id stream isn't closed yet,
|
| @@ -292,7 +295,8 @@ class TransformNode {
|
| /// being added or removed are handled by [addInput] and
|
| /// [_onPrimaryStateChange].
|
| void _dirty() {
|
| - if (_state == _State.DECLARING || _state == _State.NEEDS_DECLARE ||
|
| + if (_state == _State.DECLARING ||
|
| + _state == _State.NEEDS_DECLARE ||
|
| _state == _State.NEEDS_APPLY) {
|
| // If we already know that [_apply] needs to be run, there's nothing to do
|
| // here.
|
| @@ -377,7 +381,8 @@ class TransformNode {
|
| var controller = _passThroughControllers[input.id];
|
| if (controller != null) controller.setDirty();
|
|
|
| - if (_state == _State.APPLYING && !_applyController.addedId(input.id) &&
|
| + if (_state == _State.APPLYING &&
|
| + !_applyController.addedId(input.id) &&
|
| (_forced || !input.isLazy)) {
|
| // If the input hasn't yet been added to the transform's input stream,
|
| // there's no need to consider the transformation dirty. However, if the
|
| @@ -472,7 +477,8 @@ class TransformNode {
|
| _consumedPrimaries = controller.consumedPrimaries;
|
| _declaredOutputs = controller.outputIds;
|
| var invalidIds = _declaredOutputs
|
| - .where((id) => id.package != phase.cascade.package).toSet();
|
| + .where((id) => id.package != phase.cascade.package)
|
| + .toSet();
|
| for (var id in invalidIds) {
|
| _declaredOutputs.remove(id);
|
| // TODO(nweiz): report this as a warning rather than a failing error.
|
| @@ -663,11 +669,7 @@ class TransformNode {
|
| "${_pendingSecondaryInputs.keys.join(", ")}");
|
| }
|
| _streams.onLogController.add(new LogEntry(
|
| - info,
|
| - info.primaryId,
|
| - LogLevel.FINE,
|
| - message.toString(),
|
| - null));
|
| + info, info.primaryId, LogLevel.FINE, message.toString(), null));
|
| });
|
|
|
| return transformer.apply(controller.transform);
|
| @@ -702,17 +704,19 @@ class TransformNode {
|
| var ranLong = _timeInTransformer.elapsed > new Duration(seconds: 1);
|
| var ranLongLocally =
|
| _timeInTransformer.elapsed - _timeAwaitingInputs.elapsed >
|
| - new Duration(milliseconds: 200);
|
| + new Duration(milliseconds: 200);
|
|
|
| // Report the transformer's timing information if it spent more than 0.2s
|
| // doing things other than waiting for its secondary inputs or if it spent
|
| // more than 1s in total.
|
| if (ranLongLocally || ranLong) {
|
| _streams.onLogController.add(new LogEntry(
|
| - info, info.primaryId, LogLevel.FINE,
|
| + info,
|
| + info.primaryId,
|
| + LogLevel.FINE,
|
| "Took ${niceDuration(_timeInTransformer.elapsed)} "
|
| - "(${niceDuration(_timeAwaitingInputs.elapsed)} awaiting "
|
| - "secondary inputs).",
|
| + "(${niceDuration(_timeAwaitingInputs.elapsed)} awaiting "
|
| + "secondary inputs).",
|
| null));
|
| }
|
|
|
|
|