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

Side by Side Diff: pkg/barback/test/utils.dart

Issue 25376003: Add support for transformer clusters to barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 years, 2 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.test.utils; 5 library barback.test.utils;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:convert' show Encoding; 9 import 'dart:convert' show Encoding;
10 10
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 /// Removes [assets] from the current [PackageProvider]. 126 /// Removes [assets] from the current [PackageProvider].
127 /// 127 ///
128 /// Each item in the list may either be an [AssetId] or a string that can be 128 /// Each item in the list may either be an [AssetId] or a string that can be
129 /// parsed as one. Unlike [removeSources], this is not automatically scheduled 129 /// parsed as one. Unlike [removeSources], this is not automatically scheduled
130 /// and will be run synchronously when called. 130 /// and will be run synchronously when called.
131 void removeSourcesSync(Iterable assets) => 131 void removeSourcesSync(Iterable assets) =>
132 _barback.removeSources(_parseAssets(assets)); 132 _barback.removeSources(_parseAssets(assets));
133 133
134 /// Sets the transformers for [package] to [transformers]. 134 /// Sets the transformers for [package] to [transformers].
135 void updateTransformers(String package, 135 void updateTransformers(String package, Iterable<Iterable> transformers) {
136 Iterable<Iterable<Transformer>> transformers) {
137 schedule(() => _barback.updateTransformers(package, transformers), 136 schedule(() => _barback.updateTransformers(package, transformers),
138 "updating transformers for $package"); 137 "updating transformers for $package");
139 } 138 }
140 139
141 /// Parse a list of strings or [AssetId]s into a list of [AssetId]s. 140 /// Parse a list of strings or [AssetId]s into a list of [AssetId]s.
142 List<AssetId> _parseAssets(Iterable assets) { 141 List<AssetId> _parseAssets(Iterable assets) {
143 return assets.map((asset) { 142 return assets.map((asset) {
144 if (asset is String) return new AssetId.parse(asset); 143 if (asset is String) return new AssetId.parse(asset);
145 return asset; 144 return asset;
146 }).toList(); 145 }).toList();
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 518
520 _MockAsset(this.id, this.contents); 519 _MockAsset(this.id, this.contents);
521 520
522 Future<String> readAsString({Encoding encoding}) => 521 Future<String> readAsString({Encoding encoding}) =>
523 new Future.value(contents); 522 new Future.value(contents);
524 523
525 Stream<List<int>> read() => throw new UnimplementedError(); 524 Stream<List<int>> read() => throw new UnimplementedError();
526 525
527 String toString() => "MockAsset $id $contents"; 526 String toString() => "MockAsset $id $contents";
528 } 527 }
OLDNEW
« pkg/barback/lib/src/phase_forwarder.dart ('K') | « pkg/barback/test/package_graph/group_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698