| tag | db6b90071b4663af61cbafc41ca7954bca3f4c4e | |
|---|---|---|
| tagger | Natalie Weizenbaum <nweiz@google.com> | Thu Jul 21 19:43:45 2016 |
| object | 0b63bf3d6c62adec83638565fcbc71ae7406c8d9 |
Initial implementation.
| commit | 0b63bf3d6c62adec83638565fcbc71ae7406c8d9 | [log] [tgz] |
|---|---|---|
| author | Natalie Weizenbaum <nweiz@google.com> | Thu Jul 21 19:42:56 2016 |
| committer | Natalie Weizenbaum <nweiz@google.com> | Thu Jul 21 19:42:56 2016 |
| tree | 3894c34960b255fd62e1e2edb7ce106082330de7 | |
| parent | 19d9393f6b94ed4628b8e387a882a062fc141210 [diff] |
Add package implementation. See dart-lang/test#327 R=rnystrom@google.com Review URL: https://codereview.chromium.org//2132443003 .
A package that defines a common class, PackageResolver, for defining how to resolve package: URIs. This class may be based on the current isolate's package resolution strategy, but it may also be explicitly defined by the user—for example, you could create a resolver that represents the strategy used to compile a .dart.js file.
The Dart VM provides two mutually exclusive means of resolving package: URIs: a package spec and a package root.
A package spec usually comes in the form of a .packages file on the filesystem. It defines an individual root URL for each package name, so that package:$name/$path resolves to $root/$path.
A package root is a single URL that acts as the base for all package: URIs, so that package:$name/$path resolves to $base/$name/$path.
This normalizes access to these resolution schemes, and makes it easy for code to resolve package URIs no matter where the resolution information comes from.