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

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

Issue 23469003: Add an AssetStream class to Barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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.package_graph; 5 library barback.package_graph;
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_id.dart'; 10 import 'asset_id.dart';
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Include all build errors for all cascades. If no cascades have 79 // Include all build errors for all cascades. If no cascades have
80 // errors, the result will automatically be considered a success. 80 // errors, the result will automatically be considered a success.
81 _resultsController.add(new BuildResult(unionAll( 81 _resultsController.add(new BuildResult(unionAll(
82 _cascadeResults.values.map((result) => result.errors)))); 82 _cascadeResults.values.map((result) => result.errors))));
83 }, onError: (error) { 83 }, onError: (error) {
84 _lastUnexpectedError = error; 84 _lastUnexpectedError = error;
85 _resultsController.addError(error); 85 _resultsController.addError(error);
86 }); 86 });
87 } 87 }
88 88
89 _errors = mergeStreams(_cascades.values.map((cascade) => cascade.errors)); 89 _errors = mergeStreams(_cascades.values.map((cascade) => cascade.errors),
90 broadcast: true);
90 } 91 }
91 92
92 /// Gets the asset node identified by [id]. 93 /// Gets the asset node identified by [id].
93 /// 94 ///
94 /// If [id] is for a generated or transformed asset, this will wait until it 95 /// If [id] is for a generated or transformed asset, this will wait until it
95 /// has been created and return it. This means that the returned asset will 96 /// has been created and return it. This means that the returned asset will
96 /// always be [AssetState.AVAILABLE]. 97 /// always be [AssetState.AVAILABLE].
97 /// 98 ///
98 /// If the asset cannot be found, returns null. 99 /// If the asset cannot be found, returns null.
99 Future<AssetNode> getAssetNode(AssetId id) { 100 Future<AssetNode> getAssetNode(AssetId id) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 cascade.removeSources(ids); 158 cascade.removeSources(ids);
158 }); 159 });
159 } 160 }
160 161
161 void updateTransformers(String package, 162 void updateTransformers(String package,
162 Iterable<Iterable<Transformer>> transformers) { 163 Iterable<Iterable<Transformer>> transformers) {
163 _cascadeResults[package] = null; 164 _cascadeResults[package] = null;
164 _cascades[package].updateTransformers(transformers); 165 _cascades[package].updateTransformers(transformers);
165 } 166 }
166 } 167 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698