Index: sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart b/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart |
index 13567edcdbb7160869936af5ed02b0104fff68fc..585dba2203ffab6681c725ce487624b6ca05d03b 100644 |
--- a/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart |
+++ b/sdk/lib/_internal/pub/lib/src/barback/load_transformers.dart |
@@ -19,6 +19,7 @@ import '../dart.dart' as dart; |
import '../log.dart' as log; |
import '../utils.dart'; |
import 'build_environment.dart'; |
+import 'excluding_transformer.dart'; |
/// A Dart script to run in an isolate. |
/// |
@@ -386,7 +387,9 @@ Future<Set> loadTransformers(BuildEnvironment environment, TransformerId id) { |
// TODO(nweiz): support non-JSON-encodable configuration maps. |
'configuration': JSON.encode(id.configuration) |
}).then((transformers) { |
- transformers = transformers.map(_deserializeTransformerOrGroup).toSet(); |
+ transformers = transformers.map( |
+ (transformer) => _deserializeTransformerOrGroup( |
+ transformer, id.includes, id.excludes)).toSet(); |
nweiz
2014/02/24 21:42:46
Rather than passing the includes and excludes arou
Bob Nystrom
2014/02/26 01:09:41
Done, except in ExcludingTransformer. It felt weir
|
log.fine("Transformers from $assetId: $transformers"); |
return transformers; |
}); |
@@ -447,9 +450,10 @@ class _ForeignGroup implements TransformerGroup { |
/// The result of calling [toString] on the transformer group in the isolate. |
final String _toString; |
- _ForeignGroup(Map map) |
+ _ForeignGroup(Set<String> includes, Set<String> excludes, Map map) |
: phases = map['phases'].map((phase) { |
- return phase.map(_deserializeTransformerOrGroup).toList(); |
+ return phase.map((transformer) => _deserializeTransformerOrGroup( |
+ transformer, includes, excludes)).toList(); |
}).toList(), |
_toString = map['toString']; |
@@ -457,10 +461,15 @@ class _ForeignGroup implements TransformerGroup { |
} |
/// Converts a serializable map into a [Transformer] or a [TransformerGroup]. |
-_deserializeTransformerOrGroup(Map map) { |
- if (map['type'] == 'Transformer') return new _ForeignTransformer(map); |
+_deserializeTransformerOrGroup(Map map, Set<String> includes, |
+ Set<String> excludes) { |
+ if (map['type'] == 'Transformer') { |
+ var transformer = new _ForeignTransformer(map); |
+ return ExcludingTransformer.wrap(transformer, includes, excludes); |
+ } |
+ |
assert(map['type'] == 'TransformerGroup'); |
- return new _ForeignGroup(map); |
+ return new _ForeignGroup(includes, excludes, map); |
} |
/// Converts [transform] into a serializable map. |