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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/validator/dependency.dart

Issue 602253002: Use pub_semver package in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
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.validator.dependency; 5 library pub.validator.dependency;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:pub_semver/pub_semver.dart';
10
9 import '../entrypoint.dart'; 11 import '../entrypoint.dart';
10 import '../log.dart' as log; 12 import '../log.dart' as log;
11 import '../package.dart'; 13 import '../package.dart';
12 import '../validator.dart'; 14 import '../validator.dart';
13 import '../version.dart';
14 15
15 /// A validator that validates a package's dependencies. 16 /// A validator that validates a package's dependencies.
16 class DependencyValidator extends Validator { 17 class DependencyValidator extends Validator {
17 DependencyValidator(Entrypoint entrypoint) 18 DependencyValidator(Entrypoint entrypoint)
18 : super(entrypoint); 19 : super(entrypoint);
19 20
20 Future validate() { 21 Future validate() {
21 return Future.forEach(entrypoint.root.pubspec.dependencies, (dependency) { 22 return Future.forEach(entrypoint.root.pubspec.dependencies, (dependency) {
22 if (dependency.source != "hosted") { 23 if (dependency.source != "hosted") {
23 return _warnAboutSource(dependency); 24 return _warnAboutSource(dependency);
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 String _constraintForVersion(Version version) => 145 String _constraintForVersion(Version version) =>
145 '">=$version ${_upperBoundForVersion(version)}"'; 146 '">=$version ${_upperBoundForVersion(version)}"';
146 147
147 /// Returns the suggested upper bound for a dependency that was tested against 148 /// Returns the suggested upper bound for a dependency that was tested against
148 /// [version]. 149 /// [version].
149 String _upperBoundForVersion(Version version) { 150 String _upperBoundForVersion(Version version) {
150 if (version.major != 0) return '<${version.major + 1}.0.0'; 151 if (version.major != 0) return '<${version.major + 1}.0.0';
151 return '<${version.major}.${version.minor + 1}.0'; 152 return '<${version.major}.${version.minor + 1}.0';
152 } 153 }
153 } 154 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/source/hosted.dart ('k') | sdk/lib/_internal/pub/lib/src/version.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698