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

Unified Diff: pkg/barback/lib/src/package_graph.dart

Issue 26933003: Make pub build use barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reword doc comment. 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 side-by-side diff with in-line comments
Download patch
Index: pkg/barback/lib/src/package_graph.dart
diff --git a/pkg/barback/lib/src/package_graph.dart b/pkg/barback/lib/src/package_graph.dart
index ec358e64deb15d46c765ca633abf0b7b5c96c6db..137c16b405b7c0f5426627decb98cff4f635ad59 100644
--- a/pkg/barback/lib/src/package_graph.dart
+++ b/pkg/barback/lib/src/package_graph.dart
@@ -87,15 +87,10 @@ class PackageGraph {
// either.
if (_cascadeResults.values.any((result) => result == null)) return;
- var errors = unionAll(
- _cascadeResults.values.map((result) => result.errors));
-
- var numLogErrors = _cascadeResults.values.fold(0,
- (numErrors, result) => result.numErrors - result.errors.length);
-
// Include all build errors for all cascades. If no cascades have
// errors, the result will automatically be considered a success.
- _resultsController.add(new BuildResult(errors, numLogErrors));
+ _resultsController.add(
+ new BuildResult.aggregate(_cascadeResults.values));
}, onError: (error) {
_lastUnexpectedError = error;
_resultsController.addError(error);
@@ -138,10 +133,9 @@ class PackageGraph {
}
// If the build completed with an error, complete the future with it.
- var errors = unionAll(
- _cascadeResults.values.map((result) => result.errors));
- if (errors.isNotEmpty) {
- return new Future.error(BarbackException.aggregate(errors));
+ var result = new BuildResult.aggregate(_cascadeResults.values);
+ if (!result.succeeded) {
+ return new Future.error(BarbackException.aggregate(result.errors));
}
// Otherwise, return all of the final output assets.

Powered by Google App Engine
This is Rietveld 408576698