OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import "dart:convert"; | 6 import "dart:convert"; |
7 | 7 |
8 import 'package:pub_semver/pub_semver.dart'; | 8 import 'package:pub_semver/pub_semver.dart'; |
9 import 'package:stack_trace/stack_trace.dart'; | 9 import 'package:stack_trace/stack_trace.dart'; |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 /// The number of solutions that were attempted before either finding a | 69 /// The number of solutions that were attempted before either finding a |
70 /// successful solution or exhausting all options. | 70 /// successful solution or exhausting all options. |
71 /// | 71 /// |
72 /// In other words, one more than the number of times it had to backtrack | 72 /// In other words, one more than the number of times it had to backtrack |
73 /// because it found an invalid solution. | 73 /// because it found an invalid solution. |
74 final int attemptedSolutions; | 74 final int attemptedSolutions; |
75 | 75 |
76 /// The [LockFile] representing the packages selected by this version | 76 /// The [LockFile] representing the packages selected by this version |
77 /// resolution. | 77 /// resolution. |
78 LockFile get lockFile { | 78 LockFile get lockFile { |
79 var sdkConstraint = new VersionConstraint.intersection( | 79 // Don't factor in overridden dependencies' SDK constraints, because we'll |
80 pubspecs.values.map((pubspec) => pubspec.environment.sdkVersion)); | 80 // accept those packages even if their constraints don't match. |
| 81 var sdkConstraint = new VersionConstraint.intersection(pubspecs.values |
| 82 .where((pubspec) => |
| 83 !_root.dependencyOverrides.any((dep) => dep.name == pubspec.name)) |
| 84 .map((pubspec) => pubspec.environment.sdkVersion)); |
81 return new LockFile(packages, _sources, sdkConstraint: sdkConstraint); | 85 return new LockFile(packages, _sources, sdkConstraint: sdkConstraint); |
82 } | 86 } |
83 | 87 |
84 final SourceRegistry _sources; | 88 final SourceRegistry _sources; |
85 final Package _root; | 89 final Package _root; |
86 final LockFile _previousLockFile; | 90 final LockFile _previousLockFile; |
87 | 91 |
88 /// Returns the names of all packages that were changed. | 92 /// Returns the names of all packages that were changed. |
89 /// | 93 /// |
90 /// This includes packages that were added or removed. | 94 /// This includes packages that were added or removed. |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 436 |
433 DependencyNotFoundException(String package, this._innerException, | 437 DependencyNotFoundException(String package, this._innerException, |
434 Iterable<Dependency> dependencies) | 438 Iterable<Dependency> dependencies) |
435 : super(package, dependencies); | 439 : super(package, dependencies); |
436 | 440 |
437 /// The failure isn't because of the version of description of the package, | 441 /// The failure isn't because of the version of description of the package, |
438 /// it's the package itself that can't be found, so just show the name and no | 442 /// it's the package itself that can't be found, so just show the name and no |
439 /// descriptive details. | 443 /// descriptive details. |
440 String _describeDependency(PackageDep dep) => ""; | 444 String _describeDependency(PackageDep dep) => ""; |
441 } | 445 } |
OLD | NEW |