OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library front_end.compiler_options; | 5 library front_end.compiler_options; |
6 | 6 |
7 import 'package:front_end/src/base/performace_logger.dart'; | 7 import 'package:front_end/src/base/performace_logger.dart'; |
8 import 'package:front_end/src/incremental/byte_store.dart'; | 8 import 'package:front_end/src/incremental/byte_store.dart'; |
9 import 'package:kernel/target/targets.dart' show Target; | 9 import 'package:kernel/target/targets.dart' show Target; |
10 | 10 |
11 import 'compilation_message.dart'; | 11 import 'compilation_message.dart'; |
12 import 'file_system.dart'; | 12 import 'file_system.dart'; |
13 import 'physical_file_system.dart'; | 13 import 'physical_file_system.dart'; |
14 | 14 |
15 /// Callback used to report errors encountered during compilation. | 15 /// Callback used to report errors encountered during compilation. |
16 typedef void ErrorHandler(CompilationMessage error); | 16 typedef void ErrorHandler(CompilationMessage error); |
17 | 17 |
18 /// Front-end options relevant to compiler back ends. | 18 /// Front-end options relevant to compiler back ends. |
19 /// | 19 /// |
20 /// Not intended to be implemented or extended by clients. | 20 /// Not intended to be implemented or extended by clients. |
21 class CompilerOptions { | 21 class CompilerOptions { |
22 /// The URI of the root of the Dart SDK (typically a "file:" URI). | 22 /// The URI of the root of the Dart SDK (typically a "file:" URI). |
23 /// | 23 /// |
24 /// If `null`, the SDK will be searched for using | 24 /// If `null`, the SDK will be searched for using |
25 /// [Platform.resolvedExecutable] as a starting point. | 25 /// [Platform.resolvedExecutable] as a starting point. |
26 Uri sdkRoot; | 26 Uri sdkRoot; |
27 | 27 |
28 /// Map of `dart:*` libraries to URIs in the [fileSystem]. | 28 /// Uri to a platform libraries specification file. |
29 /// | 29 /// |
30 /// Keys in the map are the name of the library with no `dart:` prefix, for | 30 /// A libraries specification file is a JSON file that describes how to map |
31 /// example: | 31 /// `dart:*` libraries to URIs in the underlying [fileSystem]. See |
| 32 /// `package:front_end/src/base/libraries_spec.dart` for details on the |
| 33 /// format. |
32 /// | 34 /// |
33 /// {'core': 'file:///sdk/lib/core/core.dart'} | 35 /// If a value is not specified and `compileSdk = true`, the compiler will |
34 /// | 36 /// infer at a default location under [sdkRoot], typically under |
35 /// If `null`, the default set of libraries will be loaded from | 37 /// `lib/libraries.json`. |
36 /// `sdkRoot/lib/libraries.json`. | 38 Uri librariesSpecUri; |
37 // TODO(sigmund): also provide an option to specify the .json file, then | |
38 // consider dropping this option. | |
39 Map<String, Uri> dartLibraries; | |
40 | 39 |
41 /// Callback to which compilation errors should be delivered. | 40 /// Callback to which compilation errors should be delivered. |
42 /// | 41 /// |
43 /// By default, when no callback is provided, the compiler will report | 42 /// By default, when no callback is provided, the compiler will report |
44 /// messages on the console and will throw when fatal errors are discovered. | 43 /// messages on the console and will throw when fatal errors are discovered. |
45 ErrorHandler onError; | 44 ErrorHandler onError; |
46 | 45 |
47 /// Whether messages should be reported using the compiler's internal | 46 /// Whether messages should be reported using the compiler's internal |
48 /// reporting mechanism. | 47 /// reporting mechanism. |
49 /// | 48 /// |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 /// | 225 /// |
227 /// Typically used by developers to debug internals of the compiler. | 226 /// Typically used by developers to debug internals of the compiler. |
228 bool throwOnWarnings = false; | 227 bool throwOnWarnings = false; |
229 | 228 |
230 /// Whether the compiler should throw as soon as it encounters a | 229 /// Whether the compiler should throw as soon as it encounters a |
231 /// compilation nit. | 230 /// compilation nit. |
232 /// | 231 /// |
233 /// Typically used by developers to debug internals of the compiler. | 232 /// Typically used by developers to debug internals of the compiler. |
234 bool throwOnNits = false; | 233 bool throwOnNits = false; |
235 } | 234 } |
OLD | NEW |