Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side 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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/flutter.dart ('k') | lib/src/lock_file.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'package:path/path.dart' as p; 8 import 'package:path/path.dart' as p;
9 import 'package:barback/barback.dart'; 9 import 'package:barback/barback.dart';
10 import 'package:pub_semver/pub_semver.dart'; 10 import 'package:pub_semver/pub_semver.dart';
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 entrypoint = new Entrypoint.inMemory( 314 entrypoint = new Entrypoint.inMemory(
315 cache.load(id), lockFile, cache, isGlobal: true); 315 cache.load(id), lockFile, cache, isGlobal: true);
316 } else { 316 } else {
317 // For uncached sources (i.e. path), the ID just points to the real 317 // For uncached sources (i.e. path), the ID just points to the real
318 // directory for the package. 318 // directory for the package.
319 entrypoint = new Entrypoint( 319 entrypoint = new Entrypoint(
320 (id.source as PathSource).pathFromDescription(id.description), cache, 320 (id.source as PathSource).pathFromDescription(id.description), cache,
321 isGlobal: true); 321 isGlobal: true);
322 } 322 }
323 323
324 if (entrypoint.root.pubspec.environment.sdkVersion.allows(sdk.version)) { 324 if (entrypoint.root.pubspec.flutterSdkConstraint != null) {
325 return entrypoint; 325 dataError("${log.bold(name)} ${entrypoint.root.version} requires the "
326 "Flutter SDK, which is unsupported for global executables.");
326 } 327 }
327 328
328 dataError("${log.bold(name)} ${entrypoint.root.version} doesn't support " 329 if (!entrypoint.root.pubspec.dartSdkConstraint.allows(sdk.version)) {
329 "Dart ${sdk.version}."); 330 dataError("${log.bold(name)} ${entrypoint.root.version} doesn't support "
331 "Dart ${sdk.version}.");
332 }
333
334 return entrypoint;
330 } 335 }
331 336
332 /// Runs [package]'s [executable] with [args]. 337 /// Runs [package]'s [executable] with [args].
333 /// 338 ///
334 /// If [executable] is available in its precompiled form, that will be 339 /// If [executable] is available in its precompiled form, that will be
335 /// recompiled if the SDK has been upgraded since it was first compiled and 340 /// recompiled if the SDK has been upgraded since it was first compiled and
336 /// then run. Otherwise, it will be run from source. 341 /// then run. Otherwise, it will be run from source.
337 /// 342 ///
338 /// If [checked] is true, the program is run in checked mode. If [mode] is 343 /// If [checked] is true, the program is run in checked mode. If [mode] is
339 /// passed, it's used as the barback mode; it defaults to 344 /// passed, it's used as the barback mode; it defaults to
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 } 796 }
792 797
793 /// Returns the value of the property named [name] in the bin stub script 798 /// Returns the value of the property named [name] in the bin stub script
794 /// [source]. 799 /// [source].
795 String _binStubProperty(String source, String name) { 800 String _binStubProperty(String source, String name) {
796 var pattern = new RegExp(quoteRegExp(name) + r": ([a-zA-Z0-9_-]+)"); 801 var pattern = new RegExp(quoteRegExp(name) + r": ([a-zA-Z0-9_-]+)");
797 var match = pattern.firstMatch(source); 802 var match = pattern.firstMatch(source);
798 return match == null ? null : match[1]; 803 return match == null ? null : match[1];
799 } 804 }
800 } 805 }
OLDNEW
« 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
This is Rietveld 408576698