Chromium Code Reviews| Index: utils/pub/validator/dependency.dart |
| diff --git a/utils/pub/validator/dependency.dart b/utils/pub/validator/dependency.dart |
| index 18cff6624b013321e2dc78b7713349f05f89e5f1..3a21dc0957267de739adb9781b691c4e2145acfa 100644 |
| --- a/utils/pub/validator/dependency.dart |
| +++ b/utils/pub/validator/dependency.dart |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| @@ -8,6 +8,7 @@ import 'dart:async'; |
| import '../entrypoint.dart'; |
| import '../hosted_source.dart'; |
| +import '../path_source.dart'; |
| import '../http.dart'; |
| import '../package.dart'; |
| import '../utils.dart'; |
| @@ -20,7 +21,12 @@ class DependencyValidator extends Validator { |
| : super(entrypoint); |
| Future validate() { |
| - return Future.forEach(entrypoint.root.pubspec.dependencies, (dependency) { |
| + return Futures.forEach(entrypoint.root.pubspec.dependencies, (dependency) { |
| + if (dependency.source is PathSource){ |
| + errors.add('"${dependency.name}" dependancy package must be defined ' |
| + 'using "hosted" or "git" source.'); |
| + return new Future.immediate(null); |
| + } |
|
Bob Nystrom
2013/01/17 19:15:10
Let's reuse the _warnAboutSource method here since
Sam E
2013/01/20 04:16:57
I don't think this is going to work. The logic is
|
| if (dependency.source is! HostedSource) { |
| return _warnAboutSource(dependency); |
| } |