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

Side by Side Diff: utils/pub/package.dart

Issue 10230016: Fix a couple of minor issues and try to resolve #2740. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | utils/tests/pub/pub.status » ('j') | utils/tests/pub/test_pub.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * A named, versioned, unit of code and resource reuse. 6 * A named, versioned, unit of code and resource reuse.
7 */ 7 */
8 class Package implements Hashable { 8 class Package implements Hashable {
9 /** 9 /**
10 * Loads the package whose root directory is [packageDir]. 10 * Loads the package whose root directory is [packageDir].
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 walkPackage(Package package) { 64 walkPackage(Package package) {
65 // Skip packages we've already traversed. 65 // Skip packages we've already traversed.
66 if (packages.contains(package)) return; 66 if (packages.contains(package)) return;
67 67
68 // Add the package. 68 // Add the package.
69 packages.add(package); 69 packages.add(package);
70 70
71 // Recurse into its dependencies. 71 // Recurse into its dependencies.
72 pendingAsyncCalls++; 72 pendingAsyncCalls++;
73 package.loadDependencies().then((dependencies) { 73 package.loadDependencies(cache).then((dependencies) {
74 dependencies.forEach(walkPackage); 74 dependencies.forEach(walkPackage);
75 pendingAsyncCalls--; 75 pendingAsyncCalls--;
76 if (pendingAsyncCalls == 0) completer.complete(packages); 76 if (pendingAsyncCalls == 0) completer.complete(packages);
77 }); 77 });
78 } 78 }
79 79
80 walkPackage(this); 80 walkPackage(this);
81 81
82 return completer.future; 82 return completer.future;
83 } 83 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 completer.completeException( 133 completer.completeException(
134 'The pubspec dependencies must be a list of package names.'); 134 'The pubspec dependencies must be a list of package names.');
135 } 135 }
136 136
137 completer.complete(dependencies); 137 completer.complete(dependencies);
138 }); 138 });
139 139
140 return completer.future; 140 return completer.future;
141 } 141 }
142 } 142 }
OLDNEW
« no previous file with comments | « no previous file | utils/tests/pub/pub.status » ('j') | utils/tests/pub/test_pub.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698