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

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

Issue 808713003: Remove barback from the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
« no previous file with comments | « pkg/barback/lib/src/barback.dart ('k') | pkg/barback/lib/src/errors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/build_result.dart
diff --git a/pkg/barback/lib/src/build_result.dart b/pkg/barback/lib/src/build_result.dart
deleted file mode 100644
index faeb2566a5fd746e29bbf630ed03810a7f72cf5e..0000000000000000000000000000000000000000
--- a/pkg/barback/lib/src/build_result.dart
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library barback.build_result;
-
-import 'errors.dart';
-import 'utils.dart';
-
-/// An event indicating that the cascade has finished building all assets.
-///
-/// A build can end either in success or failure. If there were no errors during
-/// the build, it's considered to be a success; any errors render it a failure,
-/// although individual assets may still have built successfully.
-class BuildResult {
- // TODO(rnystrom): Revise how to track error results. Errors can come from
- // both logs and exceptions. Accumulating them is likely slow and a waste of
- // memory. If we do want to accumulate them, we should at least unify them
- // in a single collection (probably of log entries).
- /// All errors that were thrown during the build.
- final Set<BarbackException> errors;
-
- /// `true` if the build succeeded.
- bool get succeeded => errors.isEmpty;
-
- BuildResult(Iterable<BarbackException> errors)
- : errors = flattenAggregateExceptions(errors).toSet();
-
- /// Creates a build result indicating a successful build.
- ///
- /// This equivalent to a build result with no errors.
- BuildResult.success()
- : this([]);
-
- /// Creates a single [BuildResult] that contains all of the errors of
- /// [results].
- factory BuildResult.aggregate(Iterable<BuildResult> results) {
- var errors = unionAll(results.map((result) => result.errors));
- return new BuildResult(errors);
- }
-
- String toString() {
- if (succeeded) return "success";
-
- return "errors:\n" + errors.map((error) {
- var stackTrace = null;
- if (error is TransformerException || error is AssetLoadException) {
- stackTrace = error.stackTrace.terse;
- }
-
- var msg = new StringBuffer();
- msg.write(prefixLines(error.toString()));
- if (stackTrace != null) {
- msg.write("\n\n");
- msg.write("Stack chain:\n");
- msg.write(prefixLines(stackTrace.toString()));
- }
- return msg.toString();
- }).join("\n\n");
- }
-}
« no previous file with comments | « pkg/barback/lib/src/barback.dart ('k') | pkg/barback/lib/src/errors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698