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

Unified Diff: sdk/lib/_internal/pub/lib/src/pubspec.dart

Issue 29603004: Revise the barback transformer-finding logic slightly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/lib/src/pubspec.dart
diff --git a/sdk/lib/_internal/pub/lib/src/pubspec.dart b/sdk/lib/_internal/pub/lib/src/pubspec.dart
index a8d119577ff01f8bca41f8129c5e1112a2289d4b..ee9106735ddc3dd3dfa96bf63e2537d01922eeff 100644
--- a/sdk/lib/_internal/pub/lib/src/pubspec.dart
+++ b/sdk/lib/_internal/pub/lib/src/pubspec.dart
@@ -131,37 +131,38 @@ class Pubspec {
'"$transformer".');
}
- var id;
+ var library;
var configuration;
if (transformer is String) {
- id = _wrapFormatException('library identifier', field,
- () => libraryIdentifierToId(transformer));
+ library = transformer;
} else {
if (transformer.length != 1) {
- _error('"$field" must have a single key: the library identifier.');
+ _error('"$field" must have a single key: the transformer '
+ 'identifier.');
} else if (transformer.keys.single is! String) {
- _error('"$field" library identifier must be a string, but was '
- '"$id".');
+ _error('"$field" transformer identifier must be a string, but was '
+ '"$library".');
}
- id = _wrapFormatException('library identifier', field,
- () => libraryIdentifierToId(transformer.keys.single));
+ library = transformer.keys.single;
configuration = transformer.values.single;
if (configuration is! Map) {
- _error('"$field.${idToLibraryIdentifier(id)}" field must be a map, '
- 'but was "$configuration".');
+ _error('"$field.$library" field must be a map, but was '
+ '"$configuration".');
}
}
+ var id = _wrapFormatException("transformer identifier",
+ "$field.$library",
+ () => new TransformerId.parse(library, configuration));
+
if (id.package != name &&
!dependencies.any((ref) => ref.name == id.package)) {
- _error('"$field.${idToLibraryIdentifier(id)}" refers to a package '
- 'that\'s not listed in "dependencies".');
+ _error('"$field.$library" refers to a package that\'s not listed in '
+ '"dependencies".');
}
- return _wrapFormatException("transformer identifier",
- "$field.${idToLibraryIdentifier(id)}",
- () => new TransformerId(id, configuration));
+ return id;
}).toSet();
}).toList();
return _transformers;

Powered by Google App Engine
This is Rietveld 408576698