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

Side by Side Diff: lib/src/validator/sdk_constraint.dart

Issue 1585513002: Get rid of all the library tags. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 years, 11 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/validator/pubspec_field.dart ('k') | lib/src/validator/size.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 library pub.validator.sdk_constraint;
6
7 import 'dart:async'; 5 import 'dart:async';
8 6
9 import '../entrypoint.dart'; 7 import '../entrypoint.dart';
10 import '../validator.dart'; 8 import '../validator.dart';
11 9
12 /// A validator that validates that a package's SDK constraint doesn't use the 10 /// A validator that validates that a package's SDK constraint doesn't use the
13 /// "^" syntax. 11 /// "^" syntax.
14 class SdkConstraintValidator extends Validator { 12 class SdkConstraintValidator extends Validator {
15 SdkConstraintValidator(Entrypoint entrypoint) 13 SdkConstraintValidator(Entrypoint entrypoint)
16 : super(entrypoint); 14 : super(entrypoint);
17 15
18 Future validate() async { 16 Future validate() async {
19 var constraint = entrypoint.root.pubspec.environment.sdkVersion; 17 var constraint = entrypoint.root.pubspec.environment.sdkVersion;
20 if (!constraint.toString().startsWith("^")) return; 18 if (!constraint.toString().startsWith("^")) return;
21 19
22 errors.add( 20 errors.add(
23 "^ version constraints aren't allowed for SDK constraints since " 21 "^ version constraints aren't allowed for SDK constraints since "
24 "older versions of pub don't support them.\n" 22 "older versions of pub don't support them.\n"
25 "Expand it manually instead:\n" 23 "Expand it manually instead:\n"
26 "\n" 24 "\n"
27 "environment:\n" 25 "environment:\n"
28 " sdk: \">=${constraint.min} <${constraint.max}\""); 26 " sdk: \">=${constraint.min} <${constraint.max}\"");
29 } 27 }
30 } 28 }
OLDNEW
« no previous file with comments | « lib/src/validator/pubspec_field.dart ('k') | lib/src/validator/size.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698