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

Side by Side Diff: package_config/lib/packages.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « package_config/lib/discovery_analysis.dart ('k') | package_config/lib/packages_file.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library package_config.packages;
6
7 import "src/packages_impl.dart";
8
9 /// A package resolution strategy.
10 ///
11 /// Allows converting a `package:` URI to a different kind of URI.
12 ///
13 /// May also allow listing the available packages and converting
14 /// to a `Map<String, Uri>` that gives the base location of each available
15 /// package. In some cases there is no way to find the available packages,
16 /// in which case [packages] and [asMap] will throw if used.
17 /// One such case is if the packages are resolved relative to a
18 /// `packages/` directory available over HTTP.
19 abstract class Packages {
20
21 /// A [Packages] resolver containing no packages.
22 ///
23 /// This constant object is returned by [find] above if no
24 /// package resolution strategy is found.
25 static const Packages noPackages = const NoPackages();
26
27 /// Resolve a package URI into a non-package URI.
28 ///
29 /// Translates a `package:` URI, according to the package resolution
30 /// strategy, into a URI that can be loaded.
31 /// By default, only `file`, `http` and `https` URIs are returned.
32 /// Custom `Packages` objects may return other URIs.
33 ///
34 /// If resolution fails because a package with the requested package name
35 /// is not available, the [notFound] function is called.
36 /// If no `notFound` function is provided, it defaults to throwing an error.
37 ///
38 /// The [packageUri] must be a valid package URI.
39 Uri resolve(Uri packageUri, {Uri notFound(Uri packageUri)});
40
41 /// Return the names of the available packages.
42 ///
43 /// Returns an iterable that allows iterating the names of available packages.
44 ///
45 /// Some `Packages` objects are unable to find the package names,
46 /// and getting `packages` from such a `Packages` object will throw.
47 Iterable<String> get packages;
48
49 /// Return the names-to-base-URI mapping of the available packages.
50 ///
51 /// Returns a map from package name to a base URI.
52 /// The [resolve] method will resolve a package URI with a specific package
53 /// name to a path extending the base URI that this map gives for that
54 /// package name.
55 ///
56 /// Some `Packages` objects are unable to find the package names,
57 /// and calling `asMap` on such a `Packages` object will throw.
58 Map<String, Uri> asMap();
59 }
OLDNEW
« no previous file with comments | « package_config/lib/discovery_analysis.dart ('k') | package_config/lib/packages_file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698