OLD | NEW |
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 pub.asset.serialize.aggregate_transform; | 5 library pub.asset.serialize.aggregate_transform; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:isolate'; | 8 import 'dart:isolate'; |
9 | 9 |
10 import 'package:barback/barback.dart'; | 10 import 'package:barback/barback.dart'; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 void consumePrimary(AssetId id) { | 114 void consumePrimary(AssetId id) { |
115 call(_port, {'type': 'consumePrimary', 'assetId': serializeId(id)}); | 115 call(_port, {'type': 'consumePrimary', 'assetId': serializeId(id)}); |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 // We can get away with only removing the class declarations in incompatible | 119 // We can get away with only removing the class declarations in incompatible |
120 // barback versions because merely referencing undefined types in type | 120 // barback versions because merely referencing undefined types in type |
121 // annotations isn't a static error. Only implementing an undefined interface is | 121 // annotations isn't a static error. Only implementing an undefined interface is |
122 // a static error. | 122 // a static error. |
123 //# if barback >=0.14.1 | |
124 | 123 |
125 /// A wrapper for an [AggregateTransform] that's in the host isolate. | 124 /// A wrapper for an [AggregateTransform] that's in the host isolate. |
126 /// | 125 /// |
127 /// This retrieves inputs from and sends outputs and logs to the host isolate. | 126 /// This retrieves inputs from and sends outputs and logs to the host isolate. |
128 class ForeignAggregateTransform extends _ForeignBaseAggregateTransform | 127 class ForeignAggregateTransform extends _ForeignBaseAggregateTransform |
129 with GetInputTransform implements AggregateTransform { | 128 with GetInputTransform implements AggregateTransform { |
130 final Stream<Asset> primaryInputs; | 129 final Stream<Asset> primaryInputs; |
131 | 130 |
132 /// Creates a transform from a serialized map sent from the host isolate. | 131 /// Creates a transform from a serialized map sent from the host isolate. |
133 ForeignAggregateTransform(Map transform) | 132 ForeignAggregateTransform(Map transform) |
(...skipping 28 matching lines...) Expand all Loading... |
162 transform['primaryIds'], deserializeId), | 161 transform['primaryIds'], deserializeId), |
163 super(transform); | 162 super(transform); |
164 | 163 |
165 void declareOutput(AssetId id) { | 164 void declareOutput(AssetId id) { |
166 call(_port, { | 165 call(_port, { |
167 'type': 'declareOutput', | 166 'type': 'declareOutput', |
168 'output': serializeId(id) | 167 'output': serializeId(id) |
169 }); | 168 }); |
170 } | 169 } |
171 } | 170 } |
172 | |
173 //# end | |
OLD | NEW |