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 #library('entrypoint'); | 5 #library('entrypoint'); |
6 | 6 |
7 #import('io.dart'); | 7 #import('io.dart'); |
8 #import('package.dart'); | 8 #import('package.dart'); |
9 #import('system_cache.dart'); | 9 #import('system_cache.dart'); |
10 #import('version.dart'); | 10 #import('version.dart'); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 /** | 133 /** |
134 * Given [ref], which ambiguously identifies a dependent package, selects an | 134 * Given [ref], which ambiguously identifies a dependent package, selects an |
135 * appropriate precise package to use when this is the entrypoint. In other | 135 * appropriate precise package to use when this is the entrypoint. In other |
136 * words, given a loose refence like "foo >= 2.0", figures out what concrete | 136 * words, given a loose refence like "foo >= 2.0", figures out what concrete |
137 * package we should use starting from this entrypoint. | 137 * package we should use starting from this entrypoint. |
138 */ | 138 */ |
139 Future<PackageId> resolve(PackageRef ref) { | 139 Future<PackageId> resolve(PackageRef ref) { |
140 // TODO(rnystrom): This should use the lockfile to select the right version | 140 // TODO(rnystrom): This should use the lockfile to select the right version |
141 // once that's implemented. If the lockfile doesn't exist, it should | 141 // once that's implemented. If the lockfile doesn't exist, it should |
142 // generate it. In the meantime, here's a dumb implementation: | 142 // generate it. In the meantime, here's a dumb implementation: |
143 return new Future.immediate( | 143 return new Future.immediate(ref.atVersion(ref.constraint)); |
144 new PackageId(ref.source, ref.constraint, ref.description)); | |
145 } | 144 } |
146 } | 145 } |
OLD | NEW |