Index: pkg/front_end/lib/options.dart |
diff --git a/pkg/front_end/lib/options.dart b/pkg/front_end/lib/options.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0a0cf3810a4d9e4899d6a43092963595fba23e1b |
--- /dev/null |
+++ b/pkg/front_end/lib/options.dart |
@@ -0,0 +1,79 @@ |
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+library front_end.options; |
+ |
+import 'compilation_error.dart'; |
+ |
+/// Callback used to report errors encountered during compilation. |
+typedef void ErrorHandler(CompilationError error); |
+ |
+/// Front-end Analysis options relevant to compiler back ends. |
+/// |
+/// TODO(paulberry): add a mechanism to allow file system operations to be |
+/// stubbed out for testing. |
+class Options { |
+ /// The path to the Dart SDK. |
+ /// |
+ /// If `null`, the SDK will be searched for using [Platform.script] as a |
scheglov
2016/10/16 21:19:38
Do you mean Platform.resolvedExecutable?
Paul Berry
2016/10/17 12:54:39
Done.
|
+ /// starting point. |
+ String sdkPath; |
+ |
+ /// Callback to which compilation errors should be delivered. |
+ /// |
+ /// If `null`, the first error will be reported by throwing an exception of |
+ /// type [CompilationError]. |
+ ErrorHandles onError; |
scheglov
2016/10/16 21:19:38
ErrorHandler
Paul Berry
2016/10/17 12:54:39
Done.
|
+ |
+ /// Path to the ".packages" file. |
+ /// |
+ /// If `null`, the ".packages" file will be found via the standard |
+ /// package_config search algorithm. |
+ String packagesFilePath; |
+ |
+ /// Paths to the input summary files (excluding the SDK summary). |
+ List<String> inputSummaries = []; |
+ |
+ /// Path to the SDK summary file. |
+ /// |
+ /// If `null`, the SDK summary will be searched for at a default location |
+ /// within [sdkPath]. |
+ String sdkSummary; |
+ |
+ /// URI override map. |
+ /// |
+ /// This is a map from Uri to file path which overrides the normal URI |
+ /// resolution algorithm. If not set, the normal URI resolution algorithm |
+ /// will always be used. |
+ /// |
+ /// TODO(paulberry): transition analyzer and dev_compiler to use the |
+ /// "file:///bazel-root" mechanism, and then remove this. |
+ @deprecated |
+ Map<Uri, String> uriOverride = {}; |
+ |
+ /// Bazel 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. |
+ /// |
+ /// 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 = []; |
+ |
+ /// Sets the platform bit, which determines which patch files should be |
+ /// applied to the SDK. |
+ /// |
+ /// The value should be a power of two, and should match the `PLATFORM` bit |
+ /// flags in sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart. If |
+ /// zero, no patch files will be applied. |
+ int platformBit; |
+ |
+ /// The declared variables for use by configurable imports and constant |
+ /// evaluation. |
+ Map<String, String> declaredVariables; |
+} |