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

Side by Side Diff: pkg/barback/lib/src/graph/static_asset_cascade.dart

Issue 597343002: Fix a bug in barback's static package handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « pkg/barback/CHANGELOG.md ('k') | pkg/barback/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.graph.static_asset_cascade; 5 library barback.graph.static_asset_cascade;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import '../asset/asset_id.dart'; 9 import '../asset/asset_id.dart';
10 import '../asset/asset_node.dart'; 10 import '../asset/asset_node.dart';
(...skipping 24 matching lines...) Expand all
35 final _errorsController = 35 final _errorsController =
36 new StreamController<BarbackException>.broadcast(sync: true); 36 new StreamController<BarbackException>.broadcast(sync: true);
37 37
38 final status = NodeStatus.IDLE; 38 final status = NodeStatus.IDLE;
39 39
40 final onLog = new StreamController<LogEntry>.broadcast().stream; 40 final onLog = new StreamController<LogEntry>.broadcast().stream;
41 final onStatusChange = new StreamController<LogEntry>.broadcast().stream; 41 final onStatusChange = new StreamController<LogEntry>.broadcast().stream;
42 42
43 Future<AssetSet> get availableOutputs { 43 Future<AssetSet> get availableOutputs {
44 var provider = graph.provider as StaticPackageProvider; 44 var provider = graph.provider as StaticPackageProvider;
45 return provider.getAllAssetIds(package).map(provider.getAsset).toList() 45 return provider.getAllAssetIds(package).asyncMap(provider.getAsset).toList()
46 .then((assets) => new AssetSet.from(assets)); 46 .then((assets) => new AssetSet.from(assets));
47 } 47 }
48 48
49 Future<AssetNode> getAssetNode(AssetId id) { 49 Future<AssetNode> getAssetNode(AssetId id) {
50 return _sources.putIfAbsent(id, () { 50 return _sources.putIfAbsent(id, () {
51 return graph.provider.getAsset(id).then((asset) { 51 return graph.provider.getAsset(id).then((asset) {
52 return new AssetNodeController.available(asset).node; 52 return new AssetNodeController.available(asset).node;
53 }).catchError((error, stackTrace) { 53 }).catchError((error, stackTrace) {
54 if (error is! AssetNotFoundException) { 54 if (error is! AssetNotFoundException) {
55 reportError(new AssetLoadException(id, error, stackTrace)); 55 reportError(new AssetLoadException(id, error, stackTrace));
(...skipping 16 matching lines...) Expand all
72 void updateTransformers(Iterable<Iterable> transformersIterable) => 72 void updateTransformers(Iterable<Iterable> transformersIterable) =>
73 throw new UnsupportedError("Static package $package can't have " 73 throw new UnsupportedError("Static package $package can't have "
74 "transformers."); 74 "transformers.");
75 75
76 void forceAllTransforms() {} 76 void forceAllTransforms() {}
77 77
78 void reportError(BarbackException error) => _errorsController.add(error); 78 void reportError(BarbackException error) => _errorsController.add(error);
79 79
80 String toString() => "static cascade for $package"; 80 String toString() => "static cascade for $package";
81 } 81 }
OLDNEW
« no previous file with comments | « pkg/barback/CHANGELOG.md ('k') | pkg/barback/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698