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

Unified Diff: utils/pub/validator/dependency.dart

Issue 11931040: adds file path source to pub (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698