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

Unified Diff: pkg/front_end/lib/compiler_options.dart

Issue 2614063007: Use URIs rather than paths in front end API. (Closed)
Patch Set: Run dartfmt Created 3 years, 11 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 | « no previous file | pkg/front_end/lib/file_system.dart » ('j') | pkg/front_end/lib/physical_file_system.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | pkg/front_end/lib/file_system.dart » ('j') | pkg/front_end/lib/physical_file_system.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698