Chromium Code Reviews

Unified Diff: lib/src/global_packages.dart

Issue 2165423002: Add support for Flutter SDK constraints. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « lib/src/flutter.dart ('k') | lib/src/lock_file.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/global_packages.dart
diff --git a/lib/src/global_packages.dart b/lib/src/global_packages.dart
index 86ed14792d81b209ea5a77845a7f51b119ca6eda..bb2b588458dee35c3459d60f783e3a4cf00da766 100644
--- a/lib/src/global_packages.dart
+++ b/lib/src/global_packages.dart
@@ -321,12 +321,17 @@ class GlobalPackages {
isGlobal: true);
}
- if (entrypoint.root.pubspec.environment.sdkVersion.allows(sdk.version)) {
- return entrypoint;
+ if (entrypoint.root.pubspec.flutterSdkConstraint != null) {
+ dataError("${log.bold(name)} ${entrypoint.root.version} requires the "
+ "Flutter SDK, which is unsupported for global executables.");
}
- dataError("${log.bold(name)} ${entrypoint.root.version} doesn't support "
- "Dart ${sdk.version}.");
+ if (!entrypoint.root.pubspec.dartSdkConstraint.allows(sdk.version)) {
+ dataError("${log.bold(name)} ${entrypoint.root.version} doesn't support "
+ "Dart ${sdk.version}.");
+ }
+
+ return entrypoint;
}
/// Runs [package]'s [executable] with [args].
« no previous file with comments | « lib/src/flutter.dart ('k') | lib/src/lock_file.dart » ('j') | no next file with comments »

Powered by Google App Engine