| OLD | NEW |
| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 cascade.results.listen((result) { | 76 cascade.results.listen((result) { |
| 77 _cascadeResults[cascade.package] = result; | 77 _cascadeResults[cascade.package] = result; |
| 78 // If any cascade hasn't yet finished, the overall build isn't finished | 78 // If any cascade hasn't yet finished, the overall build isn't finished |
| 79 // either. | 79 // either. |
| 80 if (_cascadeResults.values.any((result) => result == null)) return; | 80 if (_cascadeResults.values.any((result) => result == null)) return; |
| 81 | 81 |
| 82 // Include all build errors for all cascades. If no cascades have | 82 // Include all build errors for all cascades. If no cascades have |
| 83 // errors, the result will automatically be considered a success. | 83 // errors, the result will automatically be considered a success. |
| 84 _resultsController.add(new BuildResult(unionAll( | 84 _resultsController.add(new BuildResult(unionAll( |
| 85 _cascadeResults.values.map((result) => result.errors)))); | 85 _cascadeResults.values.map((result) => result.errors)))); |
| 86 }, onError: (error) { | 86 }, onError: (error, [StackTrace stackTrace]) { |
| 87 _lastUnexpectedError = error; | 87 _lastUnexpectedError = error; |
| 88 _resultsController.addError(error); | 88 _resultsController.addError(error, stackTrace); |
| 89 }); | 89 }); |
| 90 } | 90 } |
| 91 | 91 |
| 92 _errors = mergeStreams(_cascades.values.map((cascade) => cascade.errors), | 92 _errors = mergeStreams(_cascades.values.map((cascade) => cascade.errors), |
| 93 broadcast: true); | 93 broadcast: true); |
| 94 } | 94 } |
| 95 | 95 |
| 96 /// Gets the asset node identified by [id]. | 96 /// Gets the asset node identified by [id]. |
| 97 /// | 97 /// |
| 98 /// If [id] is for a generated or transformed asset, this will wait until it | 98 /// If [id] is for a generated or transformed asset, this will wait until it |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 if (cascade == null) throw new ArgumentError("Unknown package $package."); | 158 if (cascade == null) throw new ArgumentError("Unknown package $package."); |
| 159 cascade.removeSources(ids); | 159 cascade.removeSources(ids); |
| 160 }); | 160 }); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void updateTransformers(String package, | 163 void updateTransformers(String package, |
| 164 Iterable<Iterable<Transformer>> transformers) { | 164 Iterable<Iterable<Transformer>> transformers) { |
| 165 _cascades[package].updateTransformers(transformers); | 165 _cascades[package].updateTransformers(transformers); |
| 166 } | 166 } |
| 167 } | 167 } |
| OLD | NEW |