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 'compilation_error.dart'; | 7 import 'compilation_error.dart'; |
| 8 import 'file_system.dart'; |
8 | 9 |
9 /// Callback used to report errors encountered during compilation. | 10 /// Callback used to report errors encountered during compilation. |
10 typedef void ErrorHandler(CompilationError error); | 11 typedef void ErrorHandler(CompilationError error); |
11 | 12 |
12 /// Front-end options relevant to compiler back ends. | 13 /// 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 { | 14 class CompilerOptions { |
17 /// The path to the Dart SDK. | 15 /// The path to the Dart SDK. |
18 /// | 16 /// |
19 /// If `null`, the SDK will be searched for using | 17 /// If `null`, the SDK will be searched for using |
20 /// [Platform.resolvedExecutable] as a starting point. | 18 /// [Platform.resolvedExecutable] as a starting point. |
21 /// | 19 /// |
22 /// This option is mutually exclusive with [sdkSummary]. | 20 /// This option is mutually exclusive with [sdkSummary]. |
23 String sdkPath; | 21 String sdkPath; |
24 | 22 |
25 /// Callback to which compilation errors should be delivered. | 23 /// Callback to which compilation errors should be delivered. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 /// applied to the SDK. | 79 /// applied to the SDK. |
82 /// | 80 /// |
83 /// The value should be a power of two, and should match the `PLATFORM` bit | 81 /// 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 | 82 /// flags in sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart. If |
85 /// zero, no patch files will be applied. | 83 /// zero, no patch files will be applied. |
86 int platformBit; | 84 int platformBit; |
87 | 85 |
88 /// The declared variables for use by configurable imports and constant | 86 /// The declared variables for use by configurable imports and constant |
89 /// evaluation. | 87 /// evaluation. |
90 Map<String, String> declaredVariables; | 88 Map<String, String> declaredVariables; |
| 89 |
| 90 /// The [FileSystem] which should be used by the front end to access files. |
| 91 /// |
| 92 /// TODO(paulberry): once an implementation of [FileSystem] has been created |
| 93 /// which uses the actual physical filesystem, make that the default. |
| 94 /// |
| 95 /// All file system access performed by the front end goes through this |
| 96 /// mechanism, with one exception: if no value is specified for |
| 97 /// [packagesFilePath], the packages file is located using the actual physical |
| 98 /// filesystem. TODO(paulberry): fix this. |
| 99 FileSystem fileSystem; |
91 } | 100 } |
OLD | NEW |