Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: pkg/barback/lib/src/declaring_transform.dart

Issue 149243009: Add support for lazy transformers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/barback/lib/src/base_transform.dart ('k') | pkg/barback/lib/src/declaring_transformer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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.declaring_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 [DeclaringTransform]ers that allows them to declare the ids
13 /// of the outputs they'll generate without generating the concrete bodies of
14 /// those outputs.
15 class DeclaringTransform extends BaseTransform {
16 final Set<AssetId> _outputIds;
17
18 DeclaringTransform(TransformNode node, this._outputIds,
19 LogFunction logFunction)
20 : super(node, logFunction);
21
22 /// Stores [id] as the id of an output that will be created by this
23 /// transformation when it's run.
24 ///
25 /// A transformation can declare as many assets as it wants. If
26 /// [DeclaringTransformer.declareOutputs] declareds a given asset id for a
27 /// given input, [Transformer.apply] should emit the corresponding asset as
28 /// well.
29 void declareOutput(AssetId id) {
30 // TODO(nweiz): This should immediately throw if an output with that ID
31 // has already been declared by this transformer.
32 _outputIds.add(id);
33 }
34 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/base_transform.dart ('k') | pkg/barback/lib/src/declaring_transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698