| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 /// Whether to use diet parsing, i.e. skip function bodies. We don't need to | 55 /// Whether to use diet parsing, i.e. skip function bodies. We don't need to |
| 56 /// analyze function bodies to use summaries during future compilation steps. | 56 /// analyze function bodies to use summaries during future compilation steps. |
| 57 final bool buildSummaryOnlyDiet; | 57 final bool buildSummaryOnlyDiet; |
| 58 | 58 |
| 59 /// Whether to use exclude informative data from created summaries. | 59 /// Whether to use exclude informative data from created summaries. |
| 60 final bool buildSummaryExcludeInformative; | 60 final bool buildSummaryExcludeInformative; |
| 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 /// The path to output the semantic-only summary when creating summaries in |
| 66 /// build mode. |
| 67 final String buildSummaryOutputSemantic; |
| 68 |
| 65 /// Whether to output a summary in "fallback mode". | 69 /// Whether to output a summary in "fallback mode". |
| 66 final bool buildSummaryFallback; | 70 final bool buildSummaryFallback; |
| 67 | 71 |
| 68 /// Whether to suppress a nonzero exit code in build mode. | 72 /// Whether to suppress a nonzero exit code in build mode. |
| 69 final bool buildSuppressExitCode; | 73 final bool buildSuppressExitCode; |
| 70 | 74 |
| 71 /// The path to the dart SDK. | 75 /// The path to the dart SDK. |
| 72 String dartSdkPath; | 76 String dartSdkPath; |
| 73 | 77 |
| 74 /// The path to the dart SDK summary file. | 78 /// The path to the dart SDK summary file. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 buildMode = args['build-mode'], | 160 buildMode = args['build-mode'], |
| 157 buildModePersistentWorker = args['persistent_worker'], | 161 buildModePersistentWorker = args['persistent_worker'], |
| 158 buildSummaryFallback = args['build-summary-fallback'], | 162 buildSummaryFallback = args['build-summary-fallback'], |
| 159 buildSummaryInputs = args['build-summary-input'], | 163 buildSummaryInputs = args['build-summary-input'], |
| 160 buildSummaryOnly = args['build-summary-only'], | 164 buildSummaryOnly = args['build-summary-only'], |
| 161 buildSummaryOnlyAst = args['build-summary-only-ast'], | 165 buildSummaryOnlyAst = args['build-summary-only-ast'], |
| 162 buildSummaryOnlyDiet = args['build-summary-only-diet'], | 166 buildSummaryOnlyDiet = args['build-summary-only-diet'], |
| 163 buildSummaryExcludeInformative = | 167 buildSummaryExcludeInformative = |
| 164 args['build-summary-exclude-informative'], | 168 args['build-summary-exclude-informative'], |
| 165 buildSummaryOutput = args['build-summary-output'], | 169 buildSummaryOutput = args['build-summary-output'], |
| 170 buildSummaryOutputSemantic = args['build-summary-output-semantic'], |
| 166 buildSuppressExitCode = args['build-suppress-exit-code'], | 171 buildSuppressExitCode = args['build-suppress-exit-code'], |
| 167 dartSdkPath = args['dart-sdk'], | 172 dartSdkPath = args['dart-sdk'], |
| 168 dartSdkSummaryPath = args['dart-sdk-summary'], | 173 dartSdkSummaryPath = args['dart-sdk-summary'], |
| 169 definedVariables = definedVariables, | 174 definedVariables = definedVariables, |
| 170 analysisOptionsFile = args['options'], | 175 analysisOptionsFile = args['options'], |
| 171 disableHints = args['no-hints'], | 176 disableHints = args['no-hints'], |
| 172 displayVersion = args['version'], | 177 displayVersion = args['version'], |
| 173 enableNullAwareOperators = args['enable-null-aware-operators'], | 178 enableNullAwareOperators = args['enable-null-aware-operators'], |
| 174 enableStrictCallChecks = args['enable-strict-call-checks'], | 179 enableStrictCallChecks = args['enable-strict-call-checks'], |
| 175 enableSuperMixins = args['supermixin'], | 180 enableSuperMixins = args['supermixin'], |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 help: 'Enable build mode.', | 383 help: 'Enable build mode.', |
| 379 defaultsTo: false, | 384 defaultsTo: false, |
| 380 negatable: false, | 385 negatable: false, |
| 381 hide: true) | 386 hide: true) |
| 382 ..addOption('build-summary-input', | 387 ..addOption('build-summary-input', |
| 383 help: 'Path to a summary file that contains information from a ' | 388 help: 'Path to a summary file that contains information from a ' |
| 384 'previous analysis run. May be specified multiple times.', | 389 'previous analysis run. May be specified multiple times.', |
| 385 allowMultiple: true, | 390 allowMultiple: true, |
| 386 hide: true) | 391 hide: true) |
| 387 ..addOption('build-summary-output', | 392 ..addOption('build-summary-output', |
| 388 help: 'Specifies the path to the file where the summary information ' | 393 help: 'Specifies the path to the file where the full summary ' |
| 389 'should be written.', | 394 'information should be written.', |
| 395 hide: true) |
| 396 ..addOption('build-summary-output-semantic', |
| 397 help: 'Specifies the path to the file where the semantic summary ' |
| 398 'information should be written.', |
| 390 hide: true) | 399 hide: true) |
| 391 ..addFlag('build-summary-only', | 400 ..addFlag('build-summary-only', |
| 392 help: 'Disable analysis (only generate summaries).', | 401 help: 'Disable analysis (only generate summaries).', |
| 393 defaultsTo: false, | 402 defaultsTo: false, |
| 394 negatable: false, | 403 negatable: false, |
| 395 hide: true) | 404 hide: true) |
| 396 ..addFlag('build-summary-only-ast', | 405 ..addFlag('build-summary-only-ast', |
| 397 help: 'Generate summaries using ASTs.', | 406 help: 'Generate summaries using ASTs.', |
| 398 defaultsTo: false, | 407 defaultsTo: false, |
| 399 negatable: false, | 408 negatable: false, |
| 400 hide: true) | 409 hide: true) |
| 401 ..addFlag('build-summary-only-diet', | 410 ..addFlag('build-summary-only-diet', |
| 402 help: 'Diet parse function bodies.', | 411 help: 'Diet parse function bodies.', |
| 403 defaultsTo: false, | 412 defaultsTo: false, |
| 404 negatable: false, | 413 negatable: false, |
| 405 hide: true) | 414 hide: true) |
| 406 ..addFlag('build-summary-exclude-informative', | 415 ..addFlag('build-summary-exclude-informative', |
| 407 help: 'Exclude @informative information (docs, offsets, etc).', | 416 help: 'Exclude @informative information (docs, offsets, etc). ' |
| 417 'Deprecated: please use --build-summary-output-semantic instead.', |
| 408 defaultsTo: false, | 418 defaultsTo: false, |
| 409 negatable: false, | 419 negatable: false, |
| 410 hide: true) | 420 hide: true) |
| 411 ..addFlag('build-summary-fallback', | 421 ..addFlag('build-summary-fallback', |
| 412 help: 'If outputting a summary, output it in fallback mode.', | 422 help: 'If outputting a summary, output it in fallback mode.', |
| 413 defaultsTo: false, | 423 defaultsTo: false, |
| 414 negatable: false, | 424 negatable: false, |
| 415 hide: true) | 425 hide: true) |
| 416 ..addFlag('build-suppress-exit-code', | 426 ..addFlag('build-suppress-exit-code', |
| 417 help: 'Exit with code 0 even if errors are found.', | 427 help: 'Exit with code 0 even if errors are found.', |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 | 694 |
| 685 int _getNextFlagIndex(args, i) { | 695 int _getNextFlagIndex(args, i) { |
| 686 for (; i < args.length; ++i) { | 696 for (; i < args.length; ++i) { |
| 687 if (args[i].startsWith('--')) { | 697 if (args[i].startsWith('--')) { |
| 688 return i; | 698 return i; |
| 689 } | 699 } |
| 690 } | 700 } |
| 691 return i; | 701 return i; |
| 692 } | 702 } |
| 693 } | 703 } |
| OLD | NEW |