| 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 /** | 5 /** |
| 6 * The "packages" directory for an application or library. | 6 * The "packages" directory for an application or library. |
| 7 * | 7 * |
| 8 * This directory contains symlinks to all packages used by an app. These links | 8 * This directory contains symlinks to all packages used by an app. These links |
| 9 * point either to the [SystemCache] or to some other location on the local | 9 * point either to the [SystemCache] or to some other location on the local |
| 10 * filesystem. | 10 * filesystem. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 return cache.install(id).chain( | 73 return cache.install(id).chain( |
| 74 (pkg) => createSymlink(pkg.dir, packageDir)); | 74 (pkg) => createSymlink(pkg.dir, packageDir)); |
| 75 } else { | 75 } else { |
| 76 return id.source.install(id, packageDir).transform((found) { | 76 return id.source.install(id, packageDir).transform((found) { |
| 77 if (found) return null; | 77 if (found) return null; |
| 78 // TODO(nweiz): More robust error-handling. | 78 // TODO(nweiz): More robust error-handling. |
| 79 throw 'Package ${id.fullName} not found in source ' | 79 throw 'Package ${id.fullName} not found in source ' |
| 80 '"${id.source.name}".'; | 80 '"${id.source.name}".'; |
| 81 }); | 81 }); |
| 82 } | 82 } |
| 83 }).chain((_) => Package.load(packageDir)); | 83 }).chain((_) => Package.load(packageDir, cache.sources)); |
| 84 | 84 |
| 85 future.then((pkg) => _loadedPackages[id] = pkg); | 85 future.then((pkg) => _loadedPackages[id] = pkg); |
| 86 always(future, () => _pendingInstalls.remove(id)); | 86 always(future, () => _pendingInstalls.remove(id)); |
| 87 _pendingInstalls[id] = future; | 87 _pendingInstalls[id] = future; |
| 88 | 88 |
| 89 return future; | 89 return future; |
| 90 } | 90 } |
| 91 | 91 |
| 92 /** | 92 /** |
| 93 * Installs the package identified by [id] and all its transitive | 93 * Installs the package identified by [id] and all its transitive |
| (...skipping 16 matching lines...) Expand all Loading... |
| 110 | 110 |
| 111 /** | 111 /** |
| 112 * Installs all dependencies of [owner] to the "packages" directory. Returns a | 112 * Installs all dependencies of [owner] to the "packages" directory. Returns a |
| 113 * [Future] that completes when all dependencies are installed. | 113 * [Future] that completes when all dependencies are installed. |
| 114 */ | 114 */ |
| 115 Future installDependencies() { | 115 Future installDependencies() { |
| 116 return Futures.wait(owner.dependencies.map(installTransitively)). | 116 return Futures.wait(owner.dependencies.map(installTransitively)). |
| 117 transform((_) => null); | 117 transform((_) => null); |
| 118 } | 118 } |
| 119 } | 119 } |
| OLD | NEW |