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

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: name changes 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 /// Force all [LazyTransformer]s' transforms in this group to begin producing
64 /// concrete assets.
65 void forceAllTransforms() {
66 for (var phase in _phases) {
67 phase.forceAllTransforms();
68 }
69 }
70
63 /// Adds a new asset as an input for this group. 71 /// Adds a new asset as an input for this group.
64 void addInput(AssetNode node) { 72 void addInput(AssetNode node) {
65 _phases.first.addInput(node); 73 _phases.first.addInput(node);
66 } 74 }
67 75
68 /// Removes this group and all sub-phases within it. 76 /// Removes this group and all sub-phases within it.
69 void remove() { 77 void remove() {
70 _phases.first.remove(); 78 _phases.first.remove();
71 } 79 }
72 80
(...skipping 12 matching lines...) Expand all
85 var newOutputs = _phases.last.availableOutputs 93 var newOutputs = _phases.last.availableOutputs
86 .difference(_alreadyEmittedOutputs); 94 .difference(_alreadyEmittedOutputs);
87 for (var output in newOutputs) { 95 for (var output in newOutputs) {
88 output.whenRemoved(() => _alreadyEmittedOutputs.remove(output)); 96 output.whenRemoved(() => _alreadyEmittedOutputs.remove(output));
89 } 97 }
90 _alreadyEmittedOutputs.addAll(newOutputs); 98 _alreadyEmittedOutputs.addAll(newOutputs);
91 99
92 return new Future.value(newOutputs); 100 return new Future.value(newOutputs);
93 } 101 }
94 } 102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698