OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 library barback.dry_run_transform; | |
6 | |
7 import 'asset_id.dart'; | |
8 import 'base_transform.dart'; | |
9 import 'transform_logger.dart'; | |
10 import 'transform_node.dart'; | |
11 | |
12 /// A transform for [DryRunTransform]ers that allows them to declare the ids of | |
13 /// the outputs they'll generate without generating the concrete bodies of those | |
14 /// outputs. | |
15 class DryRunTransform extends BaseTransform { | |
Bob Nystrom
2014/01/30 19:33:44
Do we want to allow dry run transformers to read c
nweiz
2014/01/31 03:43:27
I believe we do. We can optimize for the case wher
| |
16 final Set<AssetId> _outputIds; | |
17 | |
18 DryRunTransform(TransformNode node, this._outputIds, LogFunction logFunction) | |
19 : super(node, logFunction); | |
20 | |
21 /// Stores [id] as the id of an output created by this transformation. | |
22 /// | |
23 /// A transformation can output as many assets as it wants. If | |
24 /// [DryRunTransformer.dryRun] outputs a given asset id for a given input, | |
25 /// [Transformer.apply] should emit the corresponding asset as well. | |
Bob Nystrom
2014/01/30 19:33:44
"should" -> "must".
What happens if it emits an a
nweiz
2014/01/31 03:43:27
I don't think we should say "must", since we do ha
| |
26 void addOutputId(AssetId id) { | |
27 // TODO(nweiz): This should immediately throw if an output with that ID | |
28 // has already been created by this transformer. | |
29 _outputIds.add(id); | |
30 } | |
31 } | |
OLD | NEW |