OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2016, 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 front_end.options; | |
6 | |
7 import 'compilation_error.dart'; | |
8 | |
9 /// Callback used to report errors encountered during compilation. | |
10 typedef void ErrorHandler(CompilationError error); | |
11 | |
12 /// 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.
| |
13 /// | |
14 /// TODO(paulberry): add a mechanism to allow file system operations to be | |
15 /// stubbed out for testing. | |
16 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".
| |
17 /// The path to the Dart SDK. | |
18 /// | |
19 /// If `null`, the SDK will be searched for using | |
20 /// [Platform.resolvedExecutable] as a starting point. | |
21 String sdkPath; | |
22 | |
23 /// Callback to which compilation errors should be delivered. | |
24 /// | |
25 /// If `null`, the first error will be reported by throwing an exception of | |
26 /// type [CompilationError]. | |
27 ErrorHandler onError; | |
28 | |
29 /// Path to the ".packages" file. | |
30 /// | |
31 /// If `null`, the ".packages" file will be found via the standard | |
32 /// package_config search algorithm. | |
33 String packagesFilePath; | |
34 | |
35 /// Paths to the input summary files (excluding the SDK summary). | |
36 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
| |
37 | |
38 /// Path to the SDK summary file. | |
39 /// | |
40 /// If `null`, the SDK summary will be searched for at a default location | |
41 /// within [sdkPath]. | |
42 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'
| |
43 | |
44 /// URI override map. | |
45 /// | |
46 /// This is a map from Uri to file path which overrides the normal URI | |
47 /// resolution algorithm. If not set, the normal URI resolution algorithm | |
48 /// will always be used. | |
49 /// | |
50 /// TODO(paulberry): transition analyzer and dev_compiler to use the | |
51 /// "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.
| |
52 @deprecated | |
53 Map<Uri, String> uriOverride = {}; | |
54 | |
55 /// Bazel roots. | |
56 /// | |
57 /// Any Uri that resolves to "file:///bazel-root/$rest" will be searched for | |
58 /// at "$root/$rest" ("$root\\$rest" in Windows), where "$root" is drawn from | |
59 /// this list. If the file is not found at any of those locations, the URI | |
60 /// "file:///bazel-root/$rest" will be used directly. | |
61 /// | |
62 /// Intended use: if the Bazel workspace is located at path "$workspace", this | |
63 /// could be set to `['$workspace', '$workspace/bazel-bin', | |
64 /// '$workspace/bazel-genfiles']`, effectively overlaying source and generated | |
65 /// files. | |
66 List<String> bazelRoots = []; | |
67 | |
68 /// Sets the platform bit, which determines which patch files should be | |
69 /// applied to the SDK. | |
70 /// | |
71 /// The value should be a power of two, and should match the `PLATFORM` bit | |
72 /// flags in sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart. If | |
73 /// zero, no patch files will be applied. | |
74 int platformBit; | |
75 | |
76 /// The declared variables for use by configurable imports and constant | |
77 /// evaluation. | |
78 Map<String, String> declaredVariables; | |
79 } | |
OLD | NEW |