| Index: pkg/front_end/lib/compiler_options.dart
|
| diff --git a/pkg/front_end/lib/compiler_options.dart b/pkg/front_end/lib/compiler_options.dart
|
| index 5230f4e47fb31f7025e7d65351f99091280f44a6..731344c03dcddfc9e64a45088f062813dbcf9b95 100644
|
| --- a/pkg/front_end/lib/compiler_options.dart
|
| +++ b/pkg/front_end/lib/compiler_options.dart
|
| @@ -18,13 +18,13 @@ typedef void ErrorHandler(CompilationError error);
|
| ///
|
| /// Not intended to be implemented or extended by clients.
|
| class CompilerOptions {
|
| - /// The path to the Dart SDK.
|
| + /// The URI of the root of the Dart SDK (typically a "file:" URI).
|
| ///
|
| /// If `null`, the SDK will be searched for using
|
| /// [Platform.resolvedExecutable] as a starting point.
|
| ///
|
| /// This option is mutually exclusive with [sdkSummary].
|
| - String sdkPath;
|
| + Uri sdkRoot;
|
|
|
| /// Callback to which compilation errors should be delivered.
|
| ///
|
| @@ -32,56 +32,58 @@ class CompilerOptions {
|
| /// type [CompilationError].
|
| ErrorHandler onError = defaultErrorHandler;
|
|
|
| - /// Path to the ".packages" file.
|
| + /// URI of the ".packages" file (typically a "file:" URI).
|
| ///
|
| /// If `null`, the ".packages" file will be found via the standard
|
| /// package_config search algorithm.
|
| ///
|
| - /// If the empty string, no packages file will be used.
|
| - String packagesFilePath;
|
| + /// If the URI's path component is empty (e.g. `new Uri()`), no packages file
|
| + /// will be used.
|
| + Uri packagesFileUri;
|
|
|
| - /// Paths to the input summary files (excluding the SDK summary). These files
|
| - /// should all be linked summaries. They should also be closed, in the sense
|
| - /// that any libraries they reference should also appear in [inputSummaries]
|
| - /// or [sdkSummary].
|
| - List<String> inputSummaries = [];
|
| + /// URIs of input summary files (excluding the SDK summary; typically these
|
| + /// will be "file:" URIs). These files should all be linked summaries. They
|
| + /// should also be closed, in the sense that any libraries they reference
|
| + /// should also appear in [inputSummaries] or [sdkSummary].
|
| + List<Uri> inputSummaries = [];
|
|
|
| - /// Path to the SDK summary file.
|
| + /// URI of the SDK summary file (typically a "file:" URI).
|
| ///
|
| /// This should be a linked summary. If `null`, the SDK summary will be
|
| - /// searched for at a default location within [sdkPath].
|
| + /// searched for at a default location within [sdkRoot].
|
| ///
|
| - /// This option is mutually exclusive with [sdkPath]. TODO(paulberry): if the
|
| + /// This option is mutually exclusive with [sdkRoot]. TODO(paulberry): if the
|
| /// VM does not contain a pickled copy of the SDK, we might need to change
|
| /// this.
|
| - String sdkSummary;
|
| + Uri sdkSummary;
|
|
|
| /// URI override map.
|
| ///
|
| - /// This is a map from Uri to file path. Any URI override listed in this map
|
| - /// takes precedence over the URI resolution that would be implied by the
|
| - /// packages file (see [packagesFilePath]) and/or [bazelRoots].
|
| + /// This is a map from URIs that might appear in import/export/part statements
|
| + /// to URIs that should be used to locate the corresponding files in the
|
| + /// [fileSystem]. Any URI override listed in this map takes precedence over
|
| + /// the URI resolution that would be implied by the packages file (see
|
| + /// [packagesFileUri]) and/or [multiRoots].
|
| ///
|
| /// If a URI is not listed in this map, then the normal URI resolution
|
| /// algorithm will be used.
|
| ///
|
| /// TODO(paulberry): transition analyzer and dev_compiler to use the
|
| - /// "file:///bazel-root" mechanism, and then remove this.
|
| + /// "multi-root:" mechanism, and then remove this.
|
| @deprecated
|
| - Map<Uri, String> uriOverride = {};
|
| + Map<Uri, Uri> uriOverride = {};
|
|
|
| - /// Bazel roots.
|
| + /// Multi-roots.
|
| ///
|
| - /// Any Uri that resolves to "file:///bazel-root/$rest" will be searched for
|
| - /// at "$root/$rest" ("$root\\$rest" in Windows), where "$root" is drawn from
|
| - /// this list. If the file is not found at any of those locations, the URI
|
| - /// "file:///bazel-root/$rest" will be used directly.
|
| + /// Any Uri that resolves to "multi-root:///$rest" will be searched for
|
| + /// at "$root/$rest", where "$root" is drawn from this list.
|
| ///
|
| - /// Intended use: if the Bazel workspace is located at path "$workspace", this
|
| - /// could be set to `['$workspace', '$workspace/bazel-bin',
|
| - /// '$workspace/bazel-genfiles']`, effectively overlaying source and generated
|
| - /// files.
|
| - List<String> bazelRoots = [];
|
| + /// Intended use: if the user has a Bazel workspace located at path
|
| + /// "$workspace", this could be set to the file URIs corresponding to the
|
| + /// paths for "$workspace", "$workspace/bazel-bin",
|
| + /// and "$workspace/bazel-genfiles", effectively overlaying source and
|
| + /// generated files.
|
| + List<Uri> multiRoots = [];
|
|
|
| /// Sets the platform bit, which determines which patch files should be
|
| /// applied to the SDK.
|
| @@ -99,7 +101,7 @@ class CompilerOptions {
|
| ///
|
| /// All file system access performed by the front end goes through this
|
| /// mechanism, with one exception: if no value is specified for
|
| - /// [packagesFilePath], the packages file is located using the actual physical
|
| + /// [packagesFileUri], the packages file is located using the actual physical
|
| /// file system. TODO(paulberry): fix this.
|
| FileSystem fileSystem = PhysicalFileSystem.instance;
|
|
|
|
|