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

Unified Diff: sdk/lib/_internal/pub/lib/src/entrypoint.dart

Issue 84223002: Make the override warnings prettier. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 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 | « no previous file | sdk/lib/_internal/pub/lib/src/source.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/entrypoint.dart
diff --git a/sdk/lib/_internal/pub/lib/src/entrypoint.dart b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
index b4ef32b8fe15cec78ce0a290410b824c83bcf1f9..fcf4537a1ef4d6fd729eab3c2c2d85bc82746b1e 100644
--- a/sdk/lib/_internal/pub/lib/src/entrypoint.dart
+++ b/sdk/lib/_internal/pub/lib/src/entrypoint.dart
@@ -14,9 +14,10 @@ import 'lock_file.dart';
import 'log.dart' as log;
import 'package.dart';
import 'package_graph.dart';
+import 'solver/version_solver.dart';
import 'system_cache.dart';
import 'utils.dart';
-import 'solver/version_solver.dart';
+import 'version.dart';
/// Pub operates over a directed graph of dependencies that starts at a root
/// "entrypoint" package. This is typically the package where the current
@@ -146,9 +147,18 @@ class Entrypoint {
// Warn the user if any overrides were in effect.
if (result.overrides.isNotEmpty) {
var buffer = new StringBuffer();
- buffer.write("Warning: You are overriding these dependencies:");
+ buffer.write("Warning: You are using these overridden dependencies:");
for (var override in result.overrides) {
- buffer.write("\n- $override");
+ var source = cache.sources[override.source];
+ buffer.write("\n- ${override.name}");
+ if (override.constraint != VersionConstraint.any) {
+ buffer.write(" version ${override.constraint}");
+ }
+ if (source != cache.sources.defaultSource) {
+ var description = source.formatDescription(root.dir,
+ override.description);
+ buffer.write(" (from ${override.source} $description)");
+ }
}
log.warning(buffer);
}
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698