| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |