Chromium Code Reviews| 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..e7f48f32579b6e5348a35d11cd6e10d25891fe80 |
| --- /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. |
|
Brian Wilkerson
2016/10/17 15:08:14
nit: Remove "Analysis"? It doesn't appear to be ad
Paul Berry
2016/10/17 17:04:27
Done.
|
| +/// |
| +/// TODO(paulberry): add a mechanism to allow file system operations to be |
| +/// stubbed out for testing. |
| +class Options { |
|
Brian Wilkerson
2016/10/17 15:08:14
"Options" is really generic. I doubt that you want
Paul Berry
2016/10/17 17:04:27
Ok, renamed to "CompilerOptions".
|
| + /// The path to the Dart SDK. |
| + /// |
| + /// If `null`, the SDK will be searched for using |
| + /// [Platform.resolvedExecutable] as a 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]. |
| + ErrorHandler onError; |
| + |
| + /// 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 = []; |
|
Brian Wilkerson
2016/10/17 15:08:14
Is there a strong connection between inputSummarie
Siggi Cherem (dart-lang)
2016/10/17 16:27:29
I don't believe there should be any connection.
Paul Berry
2016/10/17 17:04:27
Yes, that's true. Although in practice I'm not su
Brian Wilkerson
2016/10/17 17:09:16
So, the packagesFilePath is used to resolve packag
Paul Berry
2016/10/17 17:32:06
Correct.
Siggi Cherem (dart-lang)
2016/10/17 18:25:31
Thanks for writing the pseudocode, it reminds me t
Paul Berry
2016/10/17 18:38:43
Acknowledged. In the interest of trying to get th
|
| + |
| + /// Path to the SDK summary file. |
| + /// |
| + /// If `null`, the SDK summary will be searched for at a default location |
| + /// within [sdkPath]. |
| + String sdkSummary; |
|
Brian Wilkerson
2016/10/17 15:08:14
Perhaps mention that it is critical that the sdkSu
Siggi Cherem (dart-lang)
2016/10/17 16:27:29
I think this option is important to have:
- it he
Paul Berry
2016/10/17 17:04:27
Actually this is not critical. As with the situat
Brian Wilkerson
2016/10/17 17:09:16
Are we planning on shipping a version of the SDK t
Brian Wilkerson
2016/10/17 17:20:44
It sounds like the two are mutually exclusive. Is
Paul Berry
2016/10/17 17:32:06
Some of these are Google-internal use cases. Let'
|
| + |
| + /// 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. |
|
Brian Wilkerson
2016/10/17 15:08:14
Is this mechanism one that you created, or is this
Siggi Cherem (dart-lang)
2016/10/17 16:27:29
This is a mechanism we introduced in dart2js when
Brian Wilkerson
2016/10/17 17:09:16
Yes, I would like to get more info. Thanks!
Analy
Paul Berry
2016/10/17 17:32:06
Since we already have some discussion to do, I'm h
Siggi Cherem (dart-lang)
2016/10/17 18:25:31
Sounds good - I'm happy to join on VC if you like.
|
| + @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; |
| +} |