| 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 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import '../../pkg/pathos/lib/path.dart' as path; | 9 import '../../pkg/pathos/lib/path.dart' as path; |
| 10 | 10 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 var errors = []; | 186 var errors = []; |
| 187 | 187 |
| 188 for (var pubspec in pubspecs) { | 188 for (var pubspec in pubspecs) { |
| 189 var sdkConstraint = pubspec.environment.sdkVersion; | 189 var sdkConstraint = pubspec.environment.sdkVersion; |
| 190 if (!sdkConstraint.allows(sdk.version)) { | 190 if (!sdkConstraint.allows(sdk.version)) { |
| 191 errors.add("- '${pubspec.name}' requires ${sdkConstraint}"); | 191 errors.add("- '${pubspec.name}' requires ${sdkConstraint}"); |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 | 194 |
| 195 if (errors.length > 0) { | 195 if (errors.length > 0) { |
| 196 log.error("Some packages are not compatible with your SDK version " | 196 log.error("Some packages that were installed are not compatible with " |
| 197 "${sdk.version}:\n" | 197 "your SDK version ${sdk.version} and may not work:\n" |
| 198 "${errors.join('\n')}\n\n" | 198 "${errors.join('\n')}\n\n" |
| 199 "You may be able to resolve this by upgrading to the latest Dart " | 199 "You may be able to resolve this by upgrading to the latest Dart " |
| 200 "SDK\n" | 200 "SDK\n" |
| 201 "or adding a version constraint to use an older version of a " | 201 "or adding a version constraint to use an older version of a " |
| 202 "package."); | 202 "package."); |
| 203 } | 203 } |
| 204 }); | 204 }); |
| 205 } | 205 } |
| 206 | 206 |
| 207 /// Loads the list of concrete package versions from the `pubspec.lock`, if it | 207 /// Loads the list of concrete package versions from the `pubspec.lock`, if it |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 /// Creates a symlink to the `packages` directory in [dir] if none exists. | 294 /// Creates a symlink to the `packages` directory in [dir] if none exists. |
| 295 Future _linkSecondaryPackageDir(String dir) { | 295 Future _linkSecondaryPackageDir(String dir) { |
| 296 return defer(() { | 296 return defer(() { |
| 297 var symlink = path.join(dir, 'packages'); | 297 var symlink = path.join(dir, 'packages'); |
| 298 if (entryExists(symlink)) return; | 298 if (entryExists(symlink)) return; |
| 299 return createSymlink(packagesDir, symlink, relative: true); | 299 return createSymlink(packagesDir, symlink, relative: true); |
| 300 }); | 300 }); |
| 301 } | 301 } |
| 302 } | 302 } |
| OLD | NEW |