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

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

Issue 15347004: Gracefully handle pubspecs with dependencies using unknown sources. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add tests for unknown sources in lockfiles. Created 7 years, 7 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: sdk/lib/_internal/pub/lib/src/validator/dependency.dart
diff --git a/sdk/lib/_internal/pub/lib/src/validator/dependency.dart b/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
index c147f7b2f7492e4d3e041ce68b7878b3cfa659e3..a1a8f992e4b7847d94c4921b09dd6edbed685a91 100644
--- a/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
+++ b/sdk/lib/_internal/pub/lib/src/validator/dependency.dart
@@ -22,7 +22,7 @@ class DependencyValidator extends Validator {
Future validate() {
return Future.forEach(entrypoint.root.pubspec.dependencies, (dependency) {
- if (dependency.source is! HostedSource) {
+ if (dependency.source != "hosted") {
return _warnAboutSource(dependency);
}
@@ -59,11 +59,11 @@ class DependencyValidator extends Validator {
// Path sources are errors. Other sources are just warnings.
var messages = warnings;
- if (dep.source is PathSource) {
+ if (dep.source == "path") {
messages = errors;
}
- messages.add('Don\'t depend on "${dep.name}" from the ${dep.source.name} '
+ messages.add('Don\'t depend on "${dep.name}" from the ${dep.source} '
'source. Use the hosted source instead. For example:\n'
'\n'
'dependencies:\n'
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/system_cache.dart ('k') | sdk/lib/_internal/pub/lib/src/validator/license.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698