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

Unified Diff: sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart

Issue 74013007: Hook up dependency overrides to the rest of pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 1 month 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: sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
diff --git a/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart b/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
index 6a0a53974f117a2e61dd3e31100fc9a426cde6bb..43009095b41b46043eac4fc0149de5d19de2ad4f 100644
--- a/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
+++ b/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart
@@ -90,7 +90,7 @@ class BacktrackingSolver {
var _attemptedSolutions = 1;
BacktrackingSolver(SourceRegistry sources, this.root, this.lockFile,
- Iterable<PackageDep> overrides, List<String> useLatest)
+ List<String> useLatest)
: sources = sources,
cache = new PubspecCache(sources) {
for (var package in useLatest) {
@@ -98,7 +98,7 @@ class BacktrackingSolver {
lockFile.packages.remove(package);
}
- for (var override in overrides) {
+ for (var override in root.dependencyOverrides) {
_overrides[override.name] = override;
}
}
@@ -110,6 +110,10 @@ class BacktrackingSolver {
_logParameters();
+ // Sort the overrides by package name to make sure they're deterministic.
+ var overrides = _overrides.values.toList();
+ overrides.sort((a, b) => a.name.compareTo(b.name));
+
return newFuture(() {
stopwatch.start();
@@ -119,12 +123,12 @@ class BacktrackingSolver {
_validateSdkConstraint(root.pubspec);
return _traverseSolution();
}).then((packages) {
- return new SolveResult(packages, null, attemptedSolutions);
+ return new SolveResult(packages, overrides, null, attemptedSolutions);
}).catchError((error) {
if (error is! SolveFailure) throw error;
// Wrap a failure in a result so we can attach some other data.
- return new SolveResult(null, error, attemptedSolutions);
+ return new SolveResult(null, overrides, error, attemptedSolutions);
}).whenComplete(() {
// Gather some solving metrics.
var buffer = new StringBuffer();
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/pubspec.dart ('k') | sdk/lib/_internal/pub/lib/src/solver/version_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698