| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.transformer.aggregate_transform; | 5 library barback.transformer.aggregate_transform; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import '../asset/asset.dart'; | 10 import '../asset/asset.dart'; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 /// The set of outputs emitted by the transformer. | 23 /// The set of outputs emitted by the transformer. |
| 24 final _outputs = new AssetSet(); | 24 final _outputs = new AssetSet(); |
| 25 | 25 |
| 26 /// The transform key. | 26 /// The transform key. |
| 27 /// | 27 /// |
| 28 /// This is the key returned by [AggregateTransformer.classifyPrimary] for all | 28 /// This is the key returned by [AggregateTransformer.classifyPrimary] for all |
| 29 /// the assets in this transform. | 29 /// the assets in this transform. |
| 30 String get key => _node.key; | 30 String get key => _node.key; |
| 31 | 31 |
| 32 /// The package in which this transform is running. |
| 33 String get package => _node.phase.cascade.package; |
| 34 |
| 32 /// The stream of primary inputs that will be processed by this transform. | 35 /// The stream of primary inputs that will be processed by this transform. |
| 33 /// | 36 /// |
| 34 /// This is exposed as a stream so that the transformer can start working | 37 /// This is exposed as a stream so that the transformer can start working |
| 35 /// before all its inputs are available. The stream is closed not just when | 38 /// before all its inputs are available. The stream is closed not just when |
| 36 /// all inputs are provided, but when barback is confident no more inputs will | 39 /// all inputs are provided, but when barback is confident no more inputs will |
| 37 /// be forthcoming. | 40 /// be forthcoming. |
| 38 /// | 41 /// |
| 39 /// A transformer may complete its `apply` method before this stream is | 42 /// A transformer may complete its `apply` method before this stream is |
| 40 /// closed. For example, it may know that each key will only have two inputs | 43 /// closed. For example, it may know that each key will only have two inputs |
| 41 /// associated with it, and so use `transform.primaryInputs.take(2)` to access | 44 /// associated with it, and so use `transform.primaryInputs.take(2)` to access |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 146 |
| 144 /// Returns whether an input with the given [id] was added via [addInput]. | 147 /// Returns whether an input with the given [id] was added via [addInput]. |
| 145 bool addedId(AssetId id) { | 148 bool addedId(AssetId id) { |
| 146 return transform._emittedPrimaryInputs.ids.contains(id); | 149 return transform._emittedPrimaryInputs.ids.contains(id); |
| 147 } | 150 } |
| 148 | 151 |
| 149 void done() { | 152 void done() { |
| 150 transform._inputController.close(); | 153 transform._inputController.close(); |
| 151 } | 154 } |
| 152 } | 155 } |
| OLD | NEW |