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

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

Issue 149243009: Add support for lazy transformers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
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.group_runner; 5 library barback.group_runner;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'asset_cascade.dart'; 9 import 'asset_cascade.dart';
10 import 'asset_node.dart'; 10 import 'asset_node.dart';
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 lastPhase = lastPhase.addPhase(phase); 53 lastPhase = lastPhase.addPhase(phase);
54 _phases.add(lastPhase); 54 _phases.add(lastPhase);
55 } 55 }
56 56
57 for (var phase in _phases) { 57 for (var phase in _phases) {
58 _onDirtyPool.add(phase.onDirty); 58 _onDirtyPool.add(phase.onDirty);
59 _onLogPool.add(phase.onLog); 59 _onLogPool.add(phase.onLog);
60 } 60 }
61 } 61 }
62 62
63 /// Materialize all [LazyTransformer]s' transforms in this group.
64 void materializeAllTransforms() {
65 for (var phase in _phases) {
66 phase.materializeAllTransforms();
67 }
68 }
69
63 /// Adds a new asset as an input for this group. 70 /// Adds a new asset as an input for this group.
64 void addInput(AssetNode node) { 71 void addInput(AssetNode node) {
65 _phases.first.addInput(node); 72 _phases.first.addInput(node);
66 } 73 }
67 74
68 /// Removes this group and all sub-phases within it. 75 /// Removes this group and all sub-phases within it.
69 void remove() { 76 void remove() {
70 _phases.first.remove(); 77 _phases.first.remove();
71 } 78 }
72 79
(...skipping 12 matching lines...) Expand all
85 var newOutputs = _phases.last.availableOutputs 92 var newOutputs = _phases.last.availableOutputs
86 .difference(_alreadyEmittedOutputs); 93 .difference(_alreadyEmittedOutputs);
87 for (var output in newOutputs) { 94 for (var output in newOutputs) {
88 output.whenRemoved(() => _alreadyEmittedOutputs.remove(output)); 95 output.whenRemoved(() => _alreadyEmittedOutputs.remove(output));
89 } 96 }
90 _alreadyEmittedOutputs.addAll(newOutputs); 97 _alreadyEmittedOutputs.addAll(newOutputs);
91 98
92 return new Future.value(newOutputs); 99 return new Future.value(newOutputs);
93 } 100 }
94 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698