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('source'); | 5 #library('source'); |
6 | 6 |
7 #import('io.dart'); | 7 #import('io.dart'); |
8 #import('package.dart'); | 8 #import('package.dart'); |
9 #import('pubspec.dart'); | 9 #import('pubspec.dart'); |
10 #import('system_cache.dart'); | 10 #import('system_cache.dart'); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 * all other error conditions, it should complete with an exception. | 101 * all other error conditions, it should complete with an exception. |
102 * | 102 * |
103 * [path] is guaranteed not to exist, and its parent directory is guaranteed | 103 * [path] is guaranteed not to exist, and its parent directory is guaranteed |
104 * to exist. | 104 * to exist. |
105 * | 105 * |
106 * This doesn't need to be implemented if [installToSystemCache] is | 106 * This doesn't need to be implemented if [installToSystemCache] is |
107 * implemented. | 107 * implemented. |
108 */ | 108 */ |
109 Future<bool> install(PackageId id, String path) { | 109 Future<bool> install(PackageId id, String path) { |
110 throw "Either install or installToSystemCache must be implemented for " | 110 throw "Either install or installToSystemCache must be implemented for " |
111 "source $name." | 111 "source $name."; |
Bob Nystrom
2012/08/24 20:57:33
Indent +2.
nweiz
2012/08/24 21:01:42
Done.
| |
112 } | 112 } |
113 | 113 |
114 /** | 114 /** |
115 * Installs the package identified by [id] to the system cache. This is only | 115 * Installs the package identified by [id] to the system cache. This is only |
116 * called for sources with [shouldCache] set to true. | 116 * called for sources with [shouldCache] set to true. |
117 * | 117 * |
118 * By default, this uses [systemCacheDirectory] and [install]. | 118 * By default, this uses [systemCacheDirectory] and [install]. |
119 */ | 119 */ |
120 Future<Package> installToSystemCache(PackageId id) { | 120 Future<Package> installToSystemCache(PackageId id) { |
121 var path = systemCacheDirectory(id); | 121 var path = systemCacheDirectory(id); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 * | 189 * |
190 * The returned [PackageId] may have a description field that's invalid | 190 * The returned [PackageId] may have a description field that's invalid |
191 * according to [validateDescription], although it must still be serializable | 191 * according to [validateDescription], although it must still be serializable |
192 * to JSON and YAML. It must also be equal to [id] according to | 192 * to JSON and YAML. It must also be equal to [id] according to |
193 * [descriptionsEqual]. | 193 * [descriptionsEqual]. |
194 * | 194 * |
195 * By default, this just returns [id]. | 195 * By default, this just returns [id]. |
196 */ | 196 */ |
197 Future<PackageId> resolveId(PackageId id) => new Future.immediate(id); | 197 Future<PackageId> resolveId(PackageId id) => new Future.immediate(id); |
198 } | 198 } |
OLD | NEW |