| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 /// The path of the root folder of the package to analyze. | 80 /// The path of the root folder of the package to analyze. |
| 81 final String packageModePath; | 81 final String packageModePath; |
| 82 | 82 |
| 83 /// The name of the package being analyzed. | 83 /// The name of the package being analyzed. |
| 84 final String packageName; | 84 final String packageName; |
| 85 | 85 |
| 86 /// Mapping of package names to package summary file paths. | 86 /// Mapping of package names to package summary file paths. |
| 87 final Map<String, String> packageSummaryInputs; | 87 final Map<String, String> packageSummaryInputs; |
| 88 | 88 |
| 89 /// Whether to skip analysis when creating summaries. |
| 90 final bool packageSummaryOnly; |
| 91 |
| 89 /// The path to find the package summary. | 92 /// The path to find the package summary. |
| 90 final String packageSummaryOutput; | 93 final String packageSummaryOutput; |
| 91 | 94 |
| 92 /// The path to the package root | 95 /// The path to the package root |
| 93 final String packageRootPath; | 96 final String packageRootPath; |
| 94 | 97 |
| 95 /// The path to a `.packages` configuration file | 98 /// The path to a `.packages` configuration file |
| 96 final String packageConfigPath; | 99 final String packageConfigPath; |
| 97 | 100 |
| 98 /// The path to a file to write a performance log. | 101 /// The path to a file to write a performance log. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 enableTypeChecks = args['enable_type_checks'], | 134 enableTypeChecks = args['enable_type_checks'], |
| 132 hintsAreFatal = args['fatal-hints'], | 135 hintsAreFatal = args['fatal-hints'], |
| 133 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], | 136 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], |
| 134 lints = args['lints'], | 137 lints = args['lints'], |
| 135 log = args['log'], | 138 log = args['log'], |
| 136 machineFormat = args['machine'] || args['format'] == 'machine', | 139 machineFormat = args['machine'] || args['format'] == 'machine', |
| 137 packageMode = args['package-mode'], | 140 packageMode = args['package-mode'], |
| 138 packageModePath = args['package-mode-path'], | 141 packageModePath = args['package-mode-path'], |
| 139 packageName = args['package-name'], | 142 packageName = args['package-name'], |
| 140 packageSummaryInputs = _parsePackageSummaryInputs(args), | 143 packageSummaryInputs = _parsePackageSummaryInputs(args), |
| 144 packageSummaryOnly = args['package-summary-only'], |
| 141 packageSummaryOutput = args['package-summary-output'], | 145 packageSummaryOutput = args['package-summary-output'], |
| 142 packageConfigPath = args['packages'], | 146 packageConfigPath = args['packages'], |
| 143 packageRootPath = args['package-root'], | 147 packageRootPath = args['package-root'], |
| 144 perfReport = args['x-perf-report'], | 148 perfReport = args['x-perf-report'], |
| 145 shouldBatch = args['batch'], | 149 shouldBatch = args['batch'], |
| 146 showPackageWarnings = | 150 showPackageWarnings = |
| 147 args['show-package-warnings'] || args['package-warnings'], | 151 args['show-package-warnings'] || args['package-warnings'], |
| 148 showSdkWarnings = args['show-sdk-warnings'] || args['warnings'], | 152 showSdkWarnings = args['show-sdk-warnings'] || args['warnings'], |
| 149 sourceFiles = args.rest, | 153 sourceFiles = args.rest, |
| 150 warningsAreFatal = args['fatal-warnings'], | 154 warningsAreFatal = args['fatal-warnings'], |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 help: '--package-summary-input=packageName,/path/to/package.sum ' | 310 help: '--package-summary-input=packageName,/path/to/package.sum ' |
| 307 'specifies the summary file that contains information about ' | 311 'specifies the summary file that contains information about ' |
| 308 'every library of the specified package.', | 312 'every library of the specified package.', |
| 309 allowMultiple: true, | 313 allowMultiple: true, |
| 310 splitCommas: false, | 314 splitCommas: false, |
| 311 hide: true) | 315 hide: true) |
| 312 ..addOption('package-summary-output', | 316 ..addOption('package-summary-output', |
| 313 help: 'Specifies the path to the file where the summary information ' | 317 help: 'Specifies the path to the file where the summary information ' |
| 314 'about the package should be written to.', | 318 'about the package should be written to.', |
| 315 hide: true) | 319 hide: true) |
| 320 ..addFlag('package-summary-only', |
| 321 help: 'Disable analysis (only generate summaries).', |
| 322 defaultsTo: false, |
| 323 negatable: false, |
| 324 hide: true) |
| 316 // | 325 // |
| 317 // Hidden flags. | 326 // Hidden flags. |
| 318 // | 327 // |
| 319 ..addFlag('enable-async', | 328 ..addFlag('enable-async', |
| 320 help: 'Enable support for the proposed async feature.', | 329 help: 'Enable support for the proposed async feature.', |
| 321 defaultsTo: false, | 330 defaultsTo: false, |
| 322 negatable: false, | 331 negatable: false, |
| 323 hide: true) | 332 hide: true) |
| 324 ..addFlag('enable-enum', | 333 ..addFlag('enable-enum', |
| 325 help: 'Enable support for the proposed enum feature.', | 334 help: 'Enable support for the proposed enum feature.', |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 | 573 |
| 565 int _getNextFlagIndex(args, i) { | 574 int _getNextFlagIndex(args, i) { |
| 566 for (; i < args.length; ++i) { | 575 for (; i < args.length; ++i) { |
| 567 if (args[i].startsWith('--')) { | 576 if (args[i].startsWith('--')) { |
| 568 return i; | 577 return i; |
| 569 } | 578 } |
| 570 } | 579 } |
| 571 return i; | 580 return i; |
| 572 } | 581 } |
| 573 } | 582 } |
| OLD | NEW |