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

Unified Diff: utils/pub/entrypoint.dart

Issue 14232023: Switch to backtracking solver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months 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 | « utils/pub/command_update.dart ('k') | utils/pub/solver/backtracking_solver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/entrypoint.dart
diff --git a/utils/pub/entrypoint.dart b/utils/pub/entrypoint.dart
index b162859cf49385bab3f929c8ef30496491664a69..321ee59f8aa1f99146b02f3f07bf7dc41ab139a3 100644
--- a/utils/pub/entrypoint.dart
+++ b/utils/pub/entrypoint.dart
@@ -142,70 +142,6 @@ class Entrypoint {
});
}
- /// Traverses the root's package dependency graph and loads each of the
- /// reached packages. This should only be called after the lockfile has been
- /// successfully generated.
- Future<List<Pubspec>> walkDependencies() {
- return new Future.sync(() {
- var lockFile = loadLockFile();
- var group = new FutureGroup<Pubspec>();
- var visited = new Set<String>();
-
- // Include the root package in the results.
- group.add(new Future.value(root.pubspec));
-
- visitPackage(Pubspec pubspec) {
- for (var ref in pubspec.dependencies) {
- if (visited.contains(ref.name)) continue;
-
- // Look up the concrete version.
- var id = lockFile.packages[ref.name];
-
- visited.add(ref.name);
- var future;
- if (ref.name == root.name) {
- future = new Future<Pubspec>.value(root.pubspec);
- } else {
- future = cache.describe(id);
- }
- group.add(future.then(visitPackage));
- }
-
- return pubspec;
- }
-
- visited.add(root.name);
- visitPackage(root.pubspec);
- return group.future;
- });
- }
-
- /// Validates that the current Dart SDK version matches the SDK constraints
- /// of every package in the dependency graph. If a package's constraint does
- /// not match, prints an error.
- Future validateSdkConstraints() {
- return walkDependencies().then((pubspecs) {
- var errors = [];
-
- for (var pubspec in pubspecs) {
- var sdkConstraint = pubspec.environment.sdkVersion;
- if (!sdkConstraint.allows(sdk.version)) {
- errors.add("- '${pubspec.name}' requires ${sdkConstraint}");
- }
- }
-
- if (errors.length > 0) {
- log.error("Some packages that were installed are not compatible with "
- "your SDK version ${sdk.version} and may not work:\n"
- "${errors.join('\n')}\n\n"
- "You may be able to resolve this by upgrading to the latest Dart "
- "SDK\n"
- "or adding a version constraint to use an older version of a "
- "package.");
- }
- });
- }
-
/// Loads the list of concrete package versions from the `pubspec.lock`, if it
/// exists. If it doesn't, this completes to an empty [LockFile].
LockFile loadLockFile() {
« no previous file with comments | « utils/pub/command_update.dart ('k') | utils/pub/solver/backtracking_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698