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

Side by Side Diff: lib/src/solver/version_solver.dart

Issue 1534093002: Improve the detection lockfile freshness. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
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 library pub.solver.version_solver; 5 library pub.solver.version_solver;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import "dart:convert"; 8 import "dart:convert";
9 9
10 import 'package:pub_semver/pub_semver.dart'; 10 import 'package:pub_semver/pub_semver.dart';
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 /// it was successful. 68 /// it was successful.
69 final SolveFailure error; 69 final SolveFailure error;
70 70
71 /// The number of solutions that were attempted before either finding a 71 /// The number of solutions that were attempted before either finding a
72 /// successful solution or exhausting all options. 72 /// successful solution or exhausting all options.
73 /// 73 ///
74 /// In other words, one more than the number of times it had to backtrack 74 /// In other words, one more than the number of times it had to backtrack
75 /// because it found an invalid solution. 75 /// because it found an invalid solution.
76 final int attemptedSolutions; 76 final int attemptedSolutions;
77 77
78 /// The [LockFile] representing the packages selected by this version
79 /// resolution.
80 LockFile get lockFile {
81 var sdkConstraint = new VersionConstraint.intersection(
82 pubspecs.values.map((pubspec) => pubspec.environment.sdkVersion));
83 return new LockFile(packages, _sources, sdkConstraint: sdkConstraint);
84 }
85
78 final SourceRegistry _sources; 86 final SourceRegistry _sources;
79 final Package _root; 87 final Package _root;
80 final LockFile _previousLockFile; 88 final LockFile _previousLockFile;
81 89
82 /// Returns the names of all packages that were changed. 90 /// Returns the names of all packages that were changed.
83 /// 91 ///
84 /// This includes packages that were added or removed. 92 /// This includes packages that were added or removed.
85 Set<String> get changedPackages { 93 Set<String> get changedPackages {
86 if (packages == null) return null; 94 if (packages == null) return null;
87 95
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 434
427 DependencyNotFoundException(String package, this._innerException, 435 DependencyNotFoundException(String package, this._innerException,
428 Iterable<Dependency> dependencies) 436 Iterable<Dependency> dependencies)
429 : super(package, dependencies); 437 : super(package, dependencies);
430 438
431 /// The failure isn't because of the version of description of the package, 439 /// The failure isn't because of the version of description of the package,
432 /// it's the package itself that can't be found, so just show the name and no 440 /// it's the package itself that can't be found, so just show the name and no
433 /// descriptive details. 441 /// descriptive details.
434 String _describeDependency(PackageDep dep) => ""; 442 String _describeDependency(PackageDep dep) => "";
435 } 443 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698