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

Unified Diff: pkg/barback/lib/src/phase.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/barback/lib/src/package_graph.dart ('k') | pkg/barback/lib/src/phase_input.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/phase.dart
diff --git a/pkg/barback/lib/src/phase.dart b/pkg/barback/lib/src/phase.dart
index aa570bfd53f690b8343de4e5506a315441a0d615..17d32d8e2c2fdc110572fb9deaa1226ea93b1d87 100644
--- a/pkg/barback/lib/src/phase.dart
+++ b/pkg/barback/lib/src/phase.dart
@@ -145,6 +145,8 @@ class Phase {
void addInput(AssetNode node) {
if (_inputs.containsKey(node.id)) _inputs[node.id].remove();
+ node.force();
+
// Each group is one channel along which an asset may be forwarded. Then
// there's one additional channel for the non-grouped transformers.
var forwarder = new PhaseForwarder(_groups.length + 1);
@@ -191,7 +193,9 @@ class Phase {
return newFuture(() {
if (id.package != cascade.package) return cascade.graph.getAssetNode(id);
if (!_outputs.containsKey(id)) return null;
- return _outputs[id].output;
+ var output = _outputs[id].output;
+ output.force();
+ return output;
});
}
@@ -228,6 +232,18 @@ class Phase {
}
}
+ /// Force all [LazyTransformer]s' transforms in this phase to begin producing
+ /// concrete assets.
+ void forceAllTransforms() {
+ for (var group in _groups.values) {
+ group.forceAllTransforms();
+ }
+
+ for (var input in _inputs.values) {
+ input.forceAllTransforms();
+ }
+ }
+
/// Add a new phase after this one with [transformers].
///
/// This may only be called on a phase with no phase following it.
« no previous file with comments | « pkg/barback/lib/src/package_graph.dart ('k') | pkg/barback/lib/src/phase_input.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698