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

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

Issue 22265002: Support cross-package transforms in barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. Created 7 years, 4 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/phase.dart ('k') | pkg/barback/lib/src/transform_node.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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.transform; 5 library barback.transform;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'asset.dart'; 9 import 'asset.dart';
10 import 'asset_id.dart'; 10 import 'asset_id.dart';
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 /// For example, with a dart2js transform, the primary input would be the 43 /// For example, with a dart2js transform, the primary input would be the
44 /// entrypoint Dart file. All of the other Dart files that that imports 44 /// entrypoint Dart file. All of the other Dart files that that imports
45 /// would be secondary inputs. 45 /// would be secondary inputs.
46 AssetId get primaryId => _node.primary.id; 46 AssetId get primaryId => _node.primary.id;
47 47
48 /// Gets the asset for the primary input. 48 /// Gets the asset for the primary input.
49 Future<Asset> get primaryInput => getInput(primaryId); 49 Future<Asset> get primaryInput => getInput(primaryId);
50 50
51 Transform._(this._node, this._outputs); 51 Transform._(this._node, this._outputs);
52 52
53 /// Gets the asset for for an input [id]. 53 /// Gets the asset for an input [id].
54 /// 54 ///
55 /// If an input with that ID cannot be found, throws an 55 /// If an input with that ID cannot be found, throws an
56 /// [AssetNotFoundException]. 56 /// [AssetNotFoundException].
57 Future<Asset> getInput(AssetId id) => _node.getInput(id); 57 Future<Asset> getInput(AssetId id) => _node.getInput(id);
58 58
59 /// Stores [output] as the output created by this transformation. 59 /// Stores [output] as the output created by this transformation.
60 /// 60 ///
61 /// A transformation can output as many assets as it wants. 61 /// A transformation can output as many assets as it wants.
62 void addOutput(Asset output) { 62 void addOutput(Asset output) {
63 // TODO(rnystrom): This should immediately throw if an output with that ID 63 // TODO(rnystrom): This should immediately throw if an output with that ID
64 // has already been created by this transformer. 64 // has already been created by this transformer.
65 _outputs.add(output); 65 _outputs.add(output);
66 } 66 }
67 } 67 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/phase.dart ('k') | pkg/barback/lib/src/transform_node.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698