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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 /// The path to output the summary when creating summaries in build mode. | 62 /// The path to output the summary when creating summaries in build mode. |
63 final String buildSummaryOutput; | 63 final String buildSummaryOutput; |
64 | 64 |
65 /// Whether to output a summary in "fallback mode". | 65 /// Whether to output a summary in "fallback mode". |
66 final bool buildSummaryFallback; | 66 final bool buildSummaryFallback; |
67 | 67 |
68 /// Whether to suppress a nonzero exit code in build mode. | 68 /// Whether to suppress a nonzero exit code in build mode. |
69 final bool buildSuppressExitCode; | 69 final bool buildSuppressExitCode; |
70 | 70 |
71 /// The path to the dart SDK | 71 /// The path to the dart SDK. |
72 String dartSdkPath; | 72 String dartSdkPath; |
73 | 73 |
| 74 /// The path to the dart SDK summary file. |
| 75 String dartSdkSummaryPath; |
| 76 |
74 /// A table mapping the names of defined variables to their values. | 77 /// A table mapping the names of defined variables to their values. |
75 final Map<String, String> definedVariables; | 78 final Map<String, String> definedVariables; |
76 | 79 |
77 /// Whether to report hints | 80 /// Whether to report hints |
78 final bool disableHints; | 81 final bool disableHints; |
79 | 82 |
80 /// Whether to display version information | 83 /// Whether to display version information |
81 final bool displayVersion; | 84 final bool displayVersion; |
82 | 85 |
83 /// Whether to enable null-aware operators (DEP 9). | 86 /// Whether to enable null-aware operators (DEP 9). |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 buildSummaryFallback = args['build-summary-fallback'], | 155 buildSummaryFallback = args['build-summary-fallback'], |
153 buildSummaryInputs = args['build-summary-input'], | 156 buildSummaryInputs = args['build-summary-input'], |
154 buildSummaryOnly = args['build-summary-only'], | 157 buildSummaryOnly = args['build-summary-only'], |
155 buildSummaryOnlyAst = args['build-summary-only-ast'], | 158 buildSummaryOnlyAst = args['build-summary-only-ast'], |
156 buildSummaryOnlyDiet = args['build-summary-only-diet'], | 159 buildSummaryOnlyDiet = args['build-summary-only-diet'], |
157 buildSummaryExcludeInformative = | 160 buildSummaryExcludeInformative = |
158 args['build-summary-exclude-informative'], | 161 args['build-summary-exclude-informative'], |
159 buildSummaryOutput = args['build-summary-output'], | 162 buildSummaryOutput = args['build-summary-output'], |
160 buildSuppressExitCode = args['build-suppress-exit-code'], | 163 buildSuppressExitCode = args['build-suppress-exit-code'], |
161 dartSdkPath = args['dart-sdk'], | 164 dartSdkPath = args['dart-sdk'], |
| 165 dartSdkSummaryPath = args['dart-sdk-summary'], |
162 definedVariables = definedVariables, | 166 definedVariables = definedVariables, |
163 analysisOptionsFile = args['options'], | 167 analysisOptionsFile = args['options'], |
164 disableHints = args['no-hints'], | 168 disableHints = args['no-hints'], |
165 displayVersion = args['version'], | 169 displayVersion = args['version'], |
166 enableNullAwareOperators = args['enable-null-aware-operators'], | 170 enableNullAwareOperators = args['enable-null-aware-operators'], |
167 enableStrictCallChecks = args['enable-strict-call-checks'], | 171 enableStrictCallChecks = args['enable-strict-call-checks'], |
168 enableSuperMixins = args['supermixin'], | 172 enableSuperMixins = args['supermixin'], |
169 enableTypeChecks = args['enable_type_checks'], | 173 enableTypeChecks = args['enable_type_checks'], |
170 hintsAreFatal = args['fatal-hints'], | 174 hintsAreFatal = args['fatal-hints'], |
171 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], | 175 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 } | 270 } |
267 | 271 |
268 args = args.expand((String arg) => arg.split('=')).toList(); | 272 args = args.expand((String arg) => arg.split('=')).toList(); |
269 var parser = new CommandLineParser() | 273 var parser = new CommandLineParser() |
270 ..addFlag('batch', | 274 ..addFlag('batch', |
271 abbr: 'b', | 275 abbr: 'b', |
272 help: 'Read commands from standard input (for testing).', | 276 help: 'Read commands from standard input (for testing).', |
273 defaultsTo: false, | 277 defaultsTo: false, |
274 negatable: false) | 278 negatable: false) |
275 ..addOption('dart-sdk', help: 'The path to the Dart SDK.') | 279 ..addOption('dart-sdk', help: 'The path to the Dart SDK.') |
| 280 ..addOption('dart-sdk-summary', |
| 281 help: 'The path to the Dart SDK summary file.', hide: true) |
276 ..addOption('packages', | 282 ..addOption('packages', |
277 help: | 283 help: |
278 'Path to the package resolution configuration file, which supplies
' | 284 'Path to the package resolution configuration file, which supplies
' |
279 'a mapping of package names to paths. This option cannot be ' | 285 'a mapping of package names to paths. This option cannot be ' |
280 'used with --package-root.') | 286 'used with --package-root.') |
281 ..addOption('package-root', | 287 ..addOption('package-root', |
282 abbr: 'p', | 288 abbr: 'p', |
283 help: 'Path to a package root directory (deprecated). This option ' | 289 help: 'Path to a package root directory (deprecated). This option ' |
284 'cannot be used with --packages.') | 290 'cannot be used with --packages.') |
285 ..addOption('options', help: 'Path to an analysis options file.') | 291 ..addOption('options', help: 'Path to an analysis options file.') |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 | 673 |
668 int _getNextFlagIndex(args, i) { | 674 int _getNextFlagIndex(args, i) { |
669 for (; i < args.length; ++i) { | 675 for (; i < args.length; ++i) { |
670 if (args[i].startsWith('--')) { | 676 if (args[i].startsWith('--')) { |
671 return i; | 677 return i; |
672 } | 678 } |
673 } | 679 } |
674 return i; | 680 return i; |
675 } | 681 } |
676 } | 682 } |
OLD | NEW |