OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer_cli.src.options; | 5 library analyzer_cli.src.options; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:analyzer_cli/src/driver.dart'; | 9 import 'package:analyzer_cli/src/driver.dart'; |
10 import 'package:args/args.dart'; | 10 import 'package:args/args.dart'; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 /// The path to the dart SDK. | 68 /// The path to the dart SDK. |
69 String dartSdkPath; | 69 String dartSdkPath; |
70 | 70 |
71 /// The path to the dart SDK summary file. | 71 /// The path to the dart SDK summary file. |
72 String dartSdkSummaryPath; | 72 String dartSdkSummaryPath; |
73 | 73 |
74 /// A table mapping the names of defined variables to their values. | 74 /// A table mapping the names of defined variables to their values. |
75 final Map<String, String> definedVariables; | 75 final Map<String, String> definedVariables; |
76 | 76 |
| 77 /// Whether to disable cache flushing. This option can improve analysis |
| 78 /// speed at the expense of memory usage. It may also be useful for working |
| 79 /// around bugs. |
| 80 final bool disableCacheFlushing; |
| 81 |
77 /// Whether to report hints | 82 /// Whether to report hints |
78 final bool disableHints; | 83 final bool disableHints; |
79 | 84 |
80 /// Whether to display version information | 85 /// Whether to display version information |
81 final bool displayVersion; | 86 final bool displayVersion; |
82 | 87 |
83 /// A flag indicating whether access to field formal parameters should be | 88 /// A flag indicating whether access to field formal parameters should be |
84 /// allowed in a constructor's initializer list. | 89 /// allowed in a constructor's initializer list. |
85 final bool enableInitializingFormalAccess; | 90 final bool enableInitializingFormalAccess; |
86 | 91 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 buildSummaryOnlyDiet = args['build-summary-only-diet'], | 169 buildSummaryOnlyDiet = args['build-summary-only-diet'], |
165 buildSummaryExcludeInformative = | 170 buildSummaryExcludeInformative = |
166 args['build-summary-exclude-informative'], | 171 args['build-summary-exclude-informative'], |
167 buildSummaryOutput = args['build-summary-output'], | 172 buildSummaryOutput = args['build-summary-output'], |
168 buildSummaryOutputSemantic = args['build-summary-output-semantic'], | 173 buildSummaryOutputSemantic = args['build-summary-output-semantic'], |
169 buildSuppressExitCode = args['build-suppress-exit-code'], | 174 buildSuppressExitCode = args['build-suppress-exit-code'], |
170 dartSdkPath = args['dart-sdk'], | 175 dartSdkPath = args['dart-sdk'], |
171 dartSdkSummaryPath = args['dart-sdk-summary'], | 176 dartSdkSummaryPath = args['dart-sdk-summary'], |
172 definedVariables = definedVariables, | 177 definedVariables = definedVariables, |
173 analysisOptionsFile = args['options'], | 178 analysisOptionsFile = args['options'], |
| 179 disableCacheFlushing = args['disable-cache-flushing'], |
174 disableHints = args['no-hints'], | 180 disableHints = args['no-hints'], |
175 displayVersion = args['version'], | 181 displayVersion = args['version'], |
176 enableInitializingFormalAccess = args['initializing-formal-access'], | 182 enableInitializingFormalAccess = args['initializing-formal-access'], |
177 enableNullAwareOperators = args['enable-null-aware-operators'], | 183 enableNullAwareOperators = args['enable-null-aware-operators'], |
178 enableStrictCallChecks = args['enable-strict-call-checks'], | 184 enableStrictCallChecks = args['enable-strict-call-checks'], |
179 enableSuperMixins = args['supermixin'], | 185 enableSuperMixins = args['supermixin'], |
180 enableTypeChecks = args['enable_type_checks'], | 186 enableTypeChecks = args['enable_type_checks'], |
181 hintsAreFatal = args['fatal-hints'], | 187 hintsAreFatal = args['fatal-hints'], |
182 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], | 188 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], |
183 lints = args['lints'], | 189 lints = args['lints'], |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 ..addFlag('version', | 313 ..addFlag('version', |
308 help: 'Print the analyzer version.', | 314 help: 'Print the analyzer version.', |
309 defaultsTo: false, | 315 defaultsTo: false, |
310 negatable: false) | 316 negatable: false) |
311 ..addFlag('lints', | 317 ..addFlag('lints', |
312 help: 'Show lint results.', defaultsTo: false, negatable: false) | 318 help: 'Show lint results.', defaultsTo: false, negatable: false) |
313 ..addFlag('no-hints', | 319 ..addFlag('no-hints', |
314 help: 'Do not show hint results.', | 320 help: 'Do not show hint results.', |
315 defaultsTo: false, | 321 defaultsTo: false, |
316 negatable: false) | 322 negatable: false) |
| 323 ..addFlag('disable-cache-flushing', defaultsTo: false, hide: true) |
317 ..addFlag('ignore-unrecognized-flags', | 324 ..addFlag('ignore-unrecognized-flags', |
318 help: 'Ignore unrecognized command line flags.', | 325 help: 'Ignore unrecognized command line flags.', |
319 defaultsTo: false, | 326 defaultsTo: false, |
320 negatable: false) | 327 negatable: false) |
321 ..addFlag('fatal-hints', | 328 ..addFlag('fatal-hints', |
322 help: 'Treat hints as fatal.', defaultsTo: false, negatable: false) | 329 help: 'Treat hints as fatal.', defaultsTo: false, negatable: false) |
323 ..addFlag('fatal-warnings', | 330 ..addFlag('fatal-warnings', |
324 help: 'Treat non-type warnings as fatal.', | 331 help: 'Treat non-type warnings as fatal.', |
325 defaultsTo: false, | 332 defaultsTo: false, |
326 negatable: false) | 333 negatable: false) |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 | 701 |
695 int _getNextFlagIndex(args, i) { | 702 int _getNextFlagIndex(args, i) { |
696 for (; i < args.length; ++i) { | 703 for (; i < args.length; ++i) { |
697 if (args[i].startsWith('--')) { | 704 if (args[i].startsWith('--')) { |
698 return i; | 705 return i; |
699 } | 706 } |
700 } | 707 } |
701 return i; | 708 return i; |
702 } | 709 } |
703 } | 710 } |
OLD | NEW |