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 /// Uri to a platform libraries specification file. | 28 /// Map of `dart:*` libraries to URIs in the [fileSystem]. |
29 /// | 29 /// |
30 /// A libraries specification file is a JSON file that describes how to map | 30 /// Keys in the map are the name of the library with no `dart:` prefix, for |
31 /// `dart:*` libraries to URIs in the underlying [fileSystem]. See | 31 /// example: |
32 /// `package:front_end/src/base/libraries_specification.dart` for details on | |
33 /// the format. | |
34 /// | 32 /// |
35 /// If a value is not specified and `compileSdk = true`, the compiler will | 33 /// {'core': 'file:///sdk/lib/core/core.dart'} |
36 /// infer at a default location under [sdkRoot], typically under | 34 /// |
37 /// `lib/libraries.json`. | 35 /// If `null`, the default set of libraries will be loaded from |
38 Uri librariesSpecificationUri; | 36 /// `sdkRoot/lib/libraries.json`. |
| 37 // TODO(sigmund): also provide an option to specify the .json file, then |
| 38 // consider dropping this option. |
| 39 Map<String, Uri> dartLibraries; |
39 | 40 |
40 /// Callback to which compilation errors should be delivered. | 41 /// Callback to which compilation errors should be delivered. |
41 /// | 42 /// |
42 /// By default, when no callback is provided, the compiler will report | 43 /// By default, when no callback is provided, the compiler will report |
43 /// messages on the console and will throw when fatal errors are discovered. | 44 /// messages on the console and will throw when fatal errors are discovered. |
44 ErrorHandler onError; | 45 ErrorHandler onError; |
45 | 46 |
46 /// Whether messages should be reported using the compiler's internal | 47 /// Whether messages should be reported using the compiler's internal |
47 /// reporting mechanism. | 48 /// reporting mechanism. |
48 /// | 49 /// |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 /// | 226 /// |
226 /// Typically used by developers to debug internals of the compiler. | 227 /// Typically used by developers to debug internals of the compiler. |
227 bool throwOnWarnings = false; | 228 bool throwOnWarnings = false; |
228 | 229 |
229 /// Whether the compiler should throw as soon as it encounters a | 230 /// Whether the compiler should throw as soon as it encounters a |
230 /// compilation nit. | 231 /// compilation nit. |
231 /// | 232 /// |
232 /// Typically used by developers to debug internals of the compiler. | 233 /// Typically used by developers to debug internals of the compiler. |
233 bool throwOnNits = false; | 234 bool throwOnNits = false; |
234 } | 235 } |
OLD | NEW |