| 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/file_system/physical_file_system.dart'; | 9 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 10 import 'package:analyzer/src/command_line/arguments.dart'; | 10 import 'package:analyzer/src/command_line/arguments.dart'; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 /// List of summary file paths to use in build mode. | 47 /// List of summary file paths to use in build mode. |
| 48 final List<String> buildSummaryInputs; | 48 final List<String> buildSummaryInputs; |
| 49 | 49 |
| 50 /// Whether to skip analysis when creating summaries in build mode. | 50 /// Whether to skip analysis when creating summaries in build mode. |
| 51 final bool buildSummaryOnly; | 51 final bool buildSummaryOnly; |
| 52 | 52 |
| 53 /// Whether to use diet parsing, i.e. skip function bodies. We don't need to | 53 /// Whether to use diet parsing, i.e. skip function bodies. We don't need to |
| 54 /// analyze function bodies to use summaries during future compilation steps. | 54 /// analyze function bodies to use summaries during future compilation steps. |
| 55 final bool buildSummaryOnlyDiet; | 55 final bool buildSummaryOnlyDiet; |
| 56 | 56 |
| 57 /// Whether to use exclude informative data from created summaries. | |
| 58 final bool buildSummaryExcludeInformative; | |
| 59 | |
| 60 /// The path to output the summary when creating summaries in build mode. | 57 /// The path to output the summary when creating summaries in build mode. |
| 61 final String buildSummaryOutput; | 58 final String buildSummaryOutput; |
| 62 | 59 |
| 63 /// The path to output the semantic-only summary when creating summaries in | 60 /// The path to output the semantic-only summary when creating summaries in |
| 64 /// build mode. | 61 /// build mode. |
| 65 final String buildSummaryOutputSemantic; | 62 final String buildSummaryOutputSemantic; |
| 66 | 63 |
| 67 /// Whether to suppress a nonzero exit code in build mode. | 64 /// Whether to suppress a nonzero exit code in build mode. |
| 68 final bool buildSuppressExitCode; | 65 final bool buildSuppressExitCode; |
| 69 | 66 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 final bool useAnalysisDriverMemoryByteStore; | 141 final bool useAnalysisDriverMemoryByteStore; |
| 145 | 142 |
| 146 /// Initialize options from the given parsed [args]. | 143 /// Initialize options from the given parsed [args]. |
| 147 CommandLineOptions._fromArgs(ArgResults args) | 144 CommandLineOptions._fromArgs(ArgResults args) |
| 148 : buildAnalysisOutput = args['build-analysis-output'], | 145 : buildAnalysisOutput = args['build-analysis-output'], |
| 149 buildMode = args['build-mode'], | 146 buildMode = args['build-mode'], |
| 150 buildModePersistentWorker = args['persistent_worker'], | 147 buildModePersistentWorker = args['persistent_worker'], |
| 151 buildSummaryInputs = args['build-summary-input'] as List<String>, | 148 buildSummaryInputs = args['build-summary-input'] as List<String>, |
| 152 buildSummaryOnly = args['build-summary-only'], | 149 buildSummaryOnly = args['build-summary-only'], |
| 153 buildSummaryOnlyDiet = args['build-summary-only-diet'], | 150 buildSummaryOnlyDiet = args['build-summary-only-diet'], |
| 154 buildSummaryExcludeInformative = | |
| 155 args['build-summary-exclude-informative'], | |
| 156 buildSummaryOutput = args['build-summary-output'], | 151 buildSummaryOutput = args['build-summary-output'], |
| 157 buildSummaryOutputSemantic = args['build-summary-output-semantic'], | 152 buildSummaryOutputSemantic = args['build-summary-output-semantic'], |
| 158 buildSuppressExitCode = args['build-suppress-exit-code'], | 153 buildSuppressExitCode = args['build-suppress-exit-code'], |
| 159 contextBuilderOptions = createContextBuilderOptions(args), | 154 contextBuilderOptions = createContextBuilderOptions(args), |
| 160 dartSdkPath = args['dart-sdk'], | 155 dartSdkPath = args['dart-sdk'], |
| 161 dartSdkSummaryPath = args['dart-sdk-summary'], | 156 dartSdkSummaryPath = args['dart-sdk-summary'], |
| 162 disableCacheFlushing = args['disable-cache-flushing'], | 157 disableCacheFlushing = args['disable-cache-flushing'], |
| 163 disableHints = args['no-hints'], | 158 disableHints = args['no-hints'], |
| 164 displayVersion = args['version'], | 159 displayVersion = args['version'], |
| 165 enableTypeChecks = args['enable_type_checks'], | 160 enableTypeChecks = args['enable_type_checks'], |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 hide: hide) | 377 hide: hide) |
| 383 ..addOption('build-summary-output-semantic', | 378 ..addOption('build-summary-output-semantic', |
| 384 help: 'Specifies the path to the file where the semantic summary ' | 379 help: 'Specifies the path to the file where the semantic summary ' |
| 385 'information should be written.', | 380 'information should be written.', |
| 386 hide: hide) | 381 hide: hide) |
| 387 ..addFlag('build-summary-only', | 382 ..addFlag('build-summary-only', |
| 388 help: 'Disable analysis (only generate summaries).', | 383 help: 'Disable analysis (only generate summaries).', |
| 389 defaultsTo: false, | 384 defaultsTo: false, |
| 390 negatable: false, | 385 negatable: false, |
| 391 hide: hide) | 386 hide: hide) |
| 392 ..addFlag('build-summary-only-ast', | |
| 393 help: 'deprecated -- Generate summaries using ASTs.', | |
| 394 defaultsTo: false, | |
| 395 negatable: false, | |
| 396 hide: hide) | |
| 397 ..addFlag('build-summary-only-diet', | 387 ..addFlag('build-summary-only-diet', |
| 398 help: 'Diet parse function bodies.', | 388 help: 'Diet parse function bodies.', |
| 399 defaultsTo: false, | 389 defaultsTo: false, |
| 400 negatable: false, | 390 negatable: false, |
| 401 hide: hide) | 391 hide: hide) |
| 402 ..addFlag('build-summary-exclude-informative', | |
| 403 help: 'Exclude @informative information (docs, offsets, etc). ' | |
| 404 'Deprecated: please use --build-summary-output-semantic instead.', | |
| 405 defaultsTo: false, | |
| 406 negatable: false, | |
| 407 hide: hide) | |
| 408 ..addFlag('build-suppress-exit-code', | 392 ..addFlag('build-suppress-exit-code', |
| 409 help: 'Exit with code 0 even if errors are found.', | 393 help: 'Exit with code 0 even if errors are found.', |
| 410 defaultsTo: false, | 394 defaultsTo: false, |
| 411 negatable: false, | 395 negatable: false, |
| 412 hide: hide); | 396 hide: hide); |
| 413 | 397 |
| 414 // Hidden flags. | 398 // Hidden flags. |
| 415 if (!hide) { | 399 if (!hide) { |
| 416 parser.addSeparator('Less frequently used flags:'); | 400 parser.addSeparator('Less frequently used flags:'); |
| 417 } | 401 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 'Usage: $_binaryName [options...] <directory or list of files>'); | 510 'Usage: $_binaryName [options...] <directory or list of files>'); |
| 527 errorSink.writeln(''); | 511 errorSink.writeln(''); |
| 528 errorSink.writeln(parser.usage); | 512 errorSink.writeln(parser.usage); |
| 529 errorSink.writeln(''); | 513 errorSink.writeln(''); |
| 530 errorSink.writeln(''' | 514 errorSink.writeln(''' |
| 531 Run "dartanalyzer -h -v" for verbose help output, including less commonly used o
ptions. | 515 Run "dartanalyzer -h -v" for verbose help output, including less commonly used o
ptions. |
| 532 For more information, see http://www.dartlang.org/tools/analyzer. | 516 For more information, see http://www.dartlang.org/tools/analyzer. |
| 533 '''); | 517 '''); |
| 534 } | 518 } |
| 535 } | 519 } |
| OLD | NEW |