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.compiler_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 options relevant to compiler back ends. |
| 13 /// |
| 14 /// TODO(paulberry): add a mechanism to allow file system operations to be |
| 15 /// stubbed out for testing. |
| 16 class 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 /// |
| 22 /// This option is mutually exclusive with [sdkSummary]. |
| 23 String sdkPath; |
| 24 |
| 25 /// Callback to which compilation errors should be delivered. |
| 26 /// |
| 27 /// If `null`, the first error will be reported by throwing an exception of |
| 28 /// type [CompilationError]. |
| 29 ErrorHandler onError; |
| 30 |
| 31 /// Path to the ".packages" file. |
| 32 /// |
| 33 /// If `null`, the ".packages" file will be found via the standard |
| 34 /// package_config search algorithm. |
| 35 String packagesFilePath; |
| 36 |
| 37 /// Paths to the input summary files (excluding the SDK summary). These files |
| 38 /// should all be linked summaries. They should also be closed, in the sense |
| 39 /// that any libraries they reference should also appear in [inputSummaries] |
| 40 /// or [sdkSummary]. |
| 41 List<String> inputSummaries = []; |
| 42 |
| 43 /// Path to the SDK summary file. |
| 44 /// |
| 45 /// This should be a linked summary. If `null`, the SDK summary will be |
| 46 /// searched for at a default location within [sdkPath]. |
| 47 /// |
| 48 /// This option is mutually exclusive with [sdkPath]. TODO(paulberry): if the |
| 49 /// VM does not contain a pickled copy of the SDK, we might need to change |
| 50 /// this. |
| 51 String sdkSummary; |
| 52 |
| 53 /// URI override map. |
| 54 /// |
| 55 /// This is a map from Uri to file path. Any URI override listed in this map |
| 56 /// takes precedence over the URI resolution that would be implied by the |
| 57 /// packages file (see [packagesFilePath]) and/or [bazelRoots]. |
| 58 /// |
| 59 /// If a URI is not listed in this map, then the normal URI resolution |
| 60 /// algorithm will be used. |
| 61 /// |
| 62 /// TODO(paulberry): transition analyzer and dev_compiler to use the |
| 63 /// "file:///bazel-root" mechanism, and then remove this. |
| 64 @deprecated |
| 65 Map<Uri, String> uriOverride = {}; |
| 66 |
| 67 /// Bazel roots. |
| 68 /// |
| 69 /// Any Uri that resolves to "file:///bazel-root/$rest" will be searched for |
| 70 /// at "$root/$rest" ("$root\\$rest" in Windows), where "$root" is drawn from |
| 71 /// this list. If the file is not found at any of those locations, the URI |
| 72 /// "file:///bazel-root/$rest" will be used directly. |
| 73 /// |
| 74 /// Intended use: if the Bazel workspace is located at path "$workspace", this |
| 75 /// could be set to `['$workspace', '$workspace/bazel-bin', |
| 76 /// '$workspace/bazel-genfiles']`, effectively overlaying source and generated |
| 77 /// files. |
| 78 List<String> bazelRoots = []; |
| 79 |
| 80 /// Sets the platform bit, which determines which patch files should be |
| 81 /// applied to the SDK. |
| 82 /// |
| 83 /// The value should be a power of two, and should match the `PLATFORM` bit |
| 84 /// flags in sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart. If |
| 85 /// zero, no patch files will be applied. |
| 86 int platformBit; |
| 87 |
| 88 /// The declared variables for use by configurable imports and constant |
| 89 /// evaluation. |
| 90 Map<String, String> declaredVariables; |
| 91 } |
OLD | NEW |