| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 /// Whether to use build mode. | 39 /// Whether to use build mode. |
| 40 final bool buildMode; | 40 final bool buildMode; |
| 41 | 41 |
| 42 /// List of summary file paths to use in build mode. | 42 /// List of summary file paths to use in build mode. |
| 43 final List<String> buildSummaryInputs; | 43 final List<String> buildSummaryInputs; |
| 44 | 44 |
| 45 /// Whether to skip analysis when creating summaries in build mode. | 45 /// Whether to skip analysis when creating summaries in build mode. |
| 46 final bool buildSummaryOnly; | 46 final bool buildSummaryOnly; |
| 47 | 47 |
| 48 /// Whether to create summaries using only ASTs, i.e. don't perform |
| 49 /// resolution. |
| 50 final bool buildSummaryOnlyAst; |
| 51 |
| 48 /// Whether to use diet parsing, i.e. skip function bodies. We don't need to | 52 /// Whether to use diet parsing, i.e. skip function bodies. We don't need to |
| 49 /// analyze function bodies to use summaries during future compilation steps. | 53 /// analyze function bodies to use summaries during future compilation steps. |
| 50 final bool buildSummaryOnlyDiet; | 54 final bool buildSummaryOnlyDiet; |
| 51 | 55 |
| 52 /// Whether to use exclude informative data from created summaries. | 56 /// Whether to use exclude informative data from created summaries. |
| 53 final bool buildSummaryExcludeInformative; | 57 final bool buildSummaryExcludeInformative; |
| 54 | 58 |
| 55 /// The path to output the summary when creating summaries in build mode. | 59 /// The path to output the summary when creating summaries in build mode. |
| 56 final String buildSummaryOutput; | 60 final String buildSummaryOutput; |
| 57 | 61 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 final bool strongMode; | 141 final bool strongMode; |
| 138 | 142 |
| 139 /// Initialize options from the given parsed [args]. | 143 /// Initialize options from the given parsed [args]. |
| 140 CommandLineOptions._fromArgs( | 144 CommandLineOptions._fromArgs( |
| 141 ArgResults args, Map<String, String> definedVariables) | 145 ArgResults args, Map<String, String> definedVariables) |
| 142 : buildAnalysisOutput = args['build-analysis-output'], | 146 : buildAnalysisOutput = args['build-analysis-output'], |
| 143 buildMode = args['build-mode'], | 147 buildMode = args['build-mode'], |
| 144 buildSummaryFallback = args['build-summary-fallback'], | 148 buildSummaryFallback = args['build-summary-fallback'], |
| 145 buildSummaryInputs = args['build-summary-input'], | 149 buildSummaryInputs = args['build-summary-input'], |
| 146 buildSummaryOnly = args['build-summary-only'], | 150 buildSummaryOnly = args['build-summary-only'], |
| 151 buildSummaryOnlyAst = args['build-summary-only-ast'], |
| 147 buildSummaryOnlyDiet = args['build-summary-only-diet'], | 152 buildSummaryOnlyDiet = args['build-summary-only-diet'], |
| 148 buildSummaryExcludeInformative = | 153 buildSummaryExcludeInformative = |
| 149 args['build-summary-exclude-informative'], | 154 args['build-summary-exclude-informative'], |
| 150 buildSummaryOutput = args['build-summary-output'], | 155 buildSummaryOutput = args['build-summary-output'], |
| 151 buildSuppressExitCode = args['build-suppress-exit-code'], | 156 buildSuppressExitCode = args['build-suppress-exit-code'], |
| 152 dartSdkPath = args['dart-sdk'], | 157 dartSdkPath = args['dart-sdk'], |
| 153 definedVariables = definedVariables, | 158 definedVariables = definedVariables, |
| 154 analysisOptionsFile = args['options'], | 159 analysisOptionsFile = args['options'], |
| 155 disableHints = args['no-hints'], | 160 disableHints = args['no-hints'], |
| 156 displayVersion = args['version'], | 161 displayVersion = args['version'], |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 hide: true) | 348 hide: true) |
| 344 ..addOption('build-summary-output', | 349 ..addOption('build-summary-output', |
| 345 help: 'Specifies the path to the file where the summary information ' | 350 help: 'Specifies the path to the file where the summary information ' |
| 346 'should be written.', | 351 'should be written.', |
| 347 hide: true) | 352 hide: true) |
| 348 ..addFlag('build-summary-only', | 353 ..addFlag('build-summary-only', |
| 349 help: 'Disable analysis (only generate summaries).', | 354 help: 'Disable analysis (only generate summaries).', |
| 350 defaultsTo: false, | 355 defaultsTo: false, |
| 351 negatable: false, | 356 negatable: false, |
| 352 hide: true) | 357 hide: true) |
| 358 ..addFlag('build-summary-only-ast', |
| 359 help: 'Generate summaries using ASTs.', |
| 360 defaultsTo: false, |
| 361 negatable: false, |
| 362 hide: true) |
| 353 ..addFlag('build-summary-only-diet', | 363 ..addFlag('build-summary-only-diet', |
| 354 help: 'Diet parse function bodies.', | 364 help: 'Diet parse function bodies.', |
| 355 defaultsTo: false, | 365 defaultsTo: false, |
| 356 negatable: false, | 366 negatable: false, |
| 357 hide: true) | 367 hide: true) |
| 358 ..addFlag('build-summary-exclude-informative', | 368 ..addFlag('build-summary-exclude-informative', |
| 359 help: 'Exclude @informative information (docs, offsets, etc).', | 369 help: 'Exclude @informative information (docs, offsets, etc).', |
| 360 defaultsTo: false, | 370 defaultsTo: false, |
| 361 negatable: false, | 371 negatable: false, |
| 362 hide: true) | 372 hide: true) |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 | 615 |
| 606 int _getNextFlagIndex(args, i) { | 616 int _getNextFlagIndex(args, i) { |
| 607 for (; i < args.length; ++i) { | 617 for (; i < args.length; ++i) { |
| 608 if (args[i].startsWith('--')) { | 618 if (args[i].startsWith('--')) { |
| 609 return i; | 619 return i; |
| 610 } | 620 } |
| 611 } | 621 } |
| 612 return i; | 622 return i; |
| 613 } | 623 } |
| 614 } | 624 } |
| OLD | NEW |