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 pub.entrypoint; | 5 library pub.entrypoint; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:path/path.dart' as path; | 9 import 'package:path/path.dart' as path; |
10 import 'package:barback/barback.dart'; | 10 import 'package:barback/barback.dart'; |
11 | 11 |
12 import 'barback/asset_environment.dart'; | 12 import 'barback/asset_environment.dart'; |
13 import 'io.dart'; | 13 import 'io.dart'; |
14 import 'lock_file.dart'; | 14 import 'lock_file.dart'; |
15 import 'log.dart' as log; | 15 import 'log.dart' as log; |
16 import 'package.dart'; | 16 import 'package.dart'; |
17 import 'package_graph.dart'; | 17 import 'package_graph.dart'; |
18 import 'package_locations.dart'; | |
18 import 'sdk.dart' as sdk; | 19 import 'sdk.dart' as sdk; |
19 import 'solver/version_solver.dart'; | 20 import 'solver/version_solver.dart'; |
20 import 'source/cached.dart'; | 21 import 'source/cached.dart'; |
21 import 'system_cache.dart'; | 22 import 'system_cache.dart'; |
22 import 'utils.dart'; | 23 import 'utils.dart'; |
23 | 24 |
24 /// The context surrounding the root package pub is operating on. | 25 /// The context surrounding the root package pub is operating on. |
25 /// | 26 /// |
26 /// Pub operates over a directed graph of dependencies that starts at a root | 27 /// Pub operates over a directed graph of dependencies that starts at a root |
27 /// "entrypoint" package. This is typically the package where the current | 28 /// "entrypoint" package. This is typically the package where the current |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 packageGraph.loadTransformerCache().clearIfOutdated(result.changedPackages); | 145 packageGraph.loadTransformerCache().clearIfOutdated(result.changedPackages); |
145 | 146 |
146 try { | 147 try { |
147 await precompileDependencies(changed: result.changedPackages); | 148 await precompileDependencies(changed: result.changedPackages); |
148 await precompileExecutables(changed: result.changedPackages); | 149 await precompileExecutables(changed: result.changedPackages); |
149 } catch (error, stackTrace) { | 150 } catch (error, stackTrace) { |
150 // Just log exceptions here. Since the method is just about acquiring | 151 // Just log exceptions here. Since the method is just about acquiring |
151 // dependencies, it shouldn't fail unless that fails. | 152 // dependencies, it shouldn't fail unless that fails. |
152 log.exception(error, stackTrace); | 153 log.exception(error, stackTrace); |
153 } | 154 } |
155 | |
156 print("WRITE?"); | |
nweiz
2015/06/10 22:33:58
Remove this.
| |
157 if (_packageSymlinks) writePackagesMap(_packageGraph); | |
nweiz
2015/06/10 22:33:58
Don't make this conditional on [_packageSymlinks].
Lasse Reichstein Nielsen
2015/06/11 11:21:01
ACK. Made uncondiational.
| |
154 } | 158 } |
155 | 159 |
156 /// Precompile any transformed dependencies of the entrypoint. | 160 /// Precompile any transformed dependencies of the entrypoint. |
157 /// | 161 /// |
158 /// If [changed] is passed, only dependencies whose contents might be changed | 162 /// If [changed] is passed, only dependencies whose contents might be changed |
159 /// if one of the given packages changes will be recompiled. | 163 /// if one of the given packages changes will be recompiled. |
160 Future precompileDependencies({Iterable<String> changed}) async { | 164 Future precompileDependencies({Iterable<String> changed}) async { |
161 if (changed != null) changed = changed.toSet(); | 165 if (changed != null) changed = changed.toSet(); |
162 | 166 |
163 var graph = await loadPackageGraph(); | 167 var graph = await loadPackageGraph(); |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
555 /// If [packageSymlinks] is true, creates a symlink to the "packages" | 559 /// If [packageSymlinks] is true, creates a symlink to the "packages" |
556 /// directory in [dir]. | 560 /// directory in [dir]. |
557 /// | 561 /// |
558 /// Otherwise, deletes a "packages" directories in [dir] if one exists. | 562 /// Otherwise, deletes a "packages" directories in [dir] if one exists. |
559 void _linkOrDeleteSecondaryPackageDir(String dir) { | 563 void _linkOrDeleteSecondaryPackageDir(String dir) { |
560 var symlink = path.join(dir, 'packages'); | 564 var symlink = path.join(dir, 'packages'); |
561 if (entryExists(symlink)) deleteEntry(symlink); | 565 if (entryExists(symlink)) deleteEntry(symlink); |
562 if (_packageSymlinks) createSymlink(packagesDir, symlink, relative: true); | 566 if (_packageSymlinks) createSymlink(packagesDir, symlink, relative: true); |
563 } | 567 } |
564 } | 568 } |
OLD | NEW |