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

Unified Diff: utils/pub/source.dart

Issue 12285010: Support relative paths in path dependencies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak some comments. Created 7 years, 10 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
« no previous file with comments | « utils/pub/sdk_source.dart ('k') | utils/tests/pub/install/path/absolute_symlink_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/source.dart
diff --git a/utils/pub/source.dart b/utils/pub/source.dart
index 1fd93271282a4f9412aead2e1b28675386aa4d0d..0568d95740cb1e2fd3ce687cf05b40191a9f276f 100644
--- a/utils/pub/source.dart
+++ b/utils/pub/source.dart
@@ -169,13 +169,23 @@ abstract class Source {
/// When a [Pubspec] or [LockFile] is parsed, it reads in the description for
/// each dependency. It is up to the dependency's [Source] to determine how
/// that should be interpreted. This will be called during parsing to validate
- /// that the given [description] is well-formed according to this source. It
- /// should return if the description is valid, or throw a [FormatException] if
- /// not.
+ /// that the given [description] is well-formed according to this source, and
+ /// to give the source a chance to canonicalize the description.
+ ///
+ /// [containingPath] is the path to the local file (pubspec or lockfile)
+ /// where this description appears. It may be `null` if the description is
+ /// coming from some in-memory source (such as pulling down a pubspec from
+ /// pub.dartlang.org).
+ ///
+ /// It should return if a (possibly modified) valid description, or throw a
+ /// [FormatException] if not valid.
///
/// [fromLockFile] is true when the description comes from a [LockFile], to
/// allow the source to use lockfile-specific descriptions via [resolveId].
- void validateDescription(description, {bool fromLockFile: false}) {}
+ dynamic parseDescription(String containingPath, description,
+ {bool fromLockFile: false}) {
+ return description;
+ }
/// Returns whether or not [description1] describes the same package as
/// [description2] for this source. This method should be light-weight. It
@@ -199,7 +209,7 @@ abstract class Source {
/// the resolved id.
///
/// The returned [PackageId] may have a description field that's invalid
- /// according to [validateDescription], although it must still be serializable
+ /// according to [parseDescription], although it must still be serializable
/// to JSON and YAML. It must also be equal to [id] according to
/// [descriptionsEqual].
///
« no previous file with comments | « utils/pub/sdk_source.dart ('k') | utils/tests/pub/install/path/absolute_symlink_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698