Chromium Code Reviews| Index: sdk/lib/_internal/pub/lib/src/source/path.dart |
| diff --git a/sdk/lib/_internal/pub/lib/src/source/path.dart b/sdk/lib/_internal/pub/lib/src/source/path.dart |
| index 2f7ccc303f4ce36e3f714c476b4794630ca8baa9..c4c2680e38e80eef2347b02eea545e98bba4eb14 100644 |
| --- a/sdk/lib/_internal/pub/lib/src/source/path.dart |
| +++ b/sdk/lib/_internal/pub/lib/src/source/path.dart |
| @@ -94,7 +94,8 @@ class PathSource extends Source { |
| // local file system. |
| assert(containingPath != null); |
| - description = path.join(path.dirname(containingPath), description); |
| + description = path.normalize( |
| + path.join(path.dirname(containingPath), description)); |
| } |
| return { |
| @@ -103,6 +104,16 @@ class PathSource extends Source { |
| }; |
| } |
| + /// Serializes path dependency's [description]. For the descriptions where |
| + /// `relative` attribute is `true`, tries to make `path` relative to the |
| + /// specified [rootPath]. |
| + dynamic serializeDescription(String rootPath, description) { |
| + if (description['relative']) { |
| + description['path'] = path.relative(description['path'], from: rootPath); |
|
Bob Nystrom
2013/10/28 22:13:32
This modifies the map in place, which might cause
Anton Moiseev
2013/11/03 11:11:43
Good catch, thanks! Done.
|
| + } |
| + return description; |
| + } |
| + |
| /// Ensures that [description] is a valid path description. It must be a map, |
| /// with a "path" key containing a path that points to an existing directory. |
| /// Throws an [ApplicationException] if the path is invalid. |