| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 /// Whether to report lints | 106 /// Whether to report lints |
| 107 final bool lints; | 107 final bool lints; |
| 108 | 108 |
| 109 /// Whether to log additional analysis messages and exceptions | 109 /// Whether to log additional analysis messages and exceptions |
| 110 final bool log; | 110 final bool log; |
| 111 | 111 |
| 112 /// Whether to use machine format for error display | 112 /// Whether to use machine format for error display |
| 113 final bool machineFormat; | 113 final bool machineFormat; |
| 114 | 114 |
| 115 /// The path to the root folder of the incremental cache. |
| 116 final String incrementalCachePath; |
| 117 |
| 115 /// The path to the package root | 118 /// The path to the package root |
| 116 final String packageRootPath; | 119 final String packageRootPath; |
| 117 | 120 |
| 118 /// The path to a `.packages` configuration file | 121 /// The path to a `.packages` configuration file |
| 119 final String packageConfigPath; | 122 final String packageConfigPath; |
| 120 | 123 |
| 121 /// The path to a file to write a performance log. | 124 /// The path to a file to write a performance log. |
| 122 /// (Or null if not enabled.) | 125 /// (Or null if not enabled.) |
| 123 final String perfReport; | 126 final String perfReport; |
| 124 | 127 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 displayVersion = args['version'], | 172 displayVersion = args['version'], |
| 170 enableNullAwareOperators = args['enable-null-aware-operators'], | 173 enableNullAwareOperators = args['enable-null-aware-operators'], |
| 171 enableStrictCallChecks = args['enable-strict-call-checks'], | 174 enableStrictCallChecks = args['enable-strict-call-checks'], |
| 172 enableSuperMixins = args['supermixin'], | 175 enableSuperMixins = args['supermixin'], |
| 173 enableTypeChecks = args['enable_type_checks'], | 176 enableTypeChecks = args['enable_type_checks'], |
| 174 hintsAreFatal = args['fatal-hints'], | 177 hintsAreFatal = args['fatal-hints'], |
| 175 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], | 178 ignoreUnrecognizedFlags = args['ignore-unrecognized-flags'], |
| 176 lints = args['lints'], | 179 lints = args['lints'], |
| 177 log = args['log'], | 180 log = args['log'], |
| 178 machineFormat = args['machine'] || args['format'] == 'machine', | 181 machineFormat = args['machine'] || args['format'] == 'machine', |
| 182 incrementalCachePath = args['incremental-cache-path'], |
| 179 packageConfigPath = args['packages'], | 183 packageConfigPath = args['packages'], |
| 180 packageRootPath = args['package-root'], | 184 packageRootPath = args['package-root'], |
| 181 perfReport = args['x-perf-report'], | 185 perfReport = args['x-perf-report'], |
| 182 shouldBatch = args['batch'], | 186 shouldBatch = args['batch'], |
| 183 showPackageWarnings = args['show-package-warnings'] || | 187 showPackageWarnings = args['show-package-warnings'] || |
| 184 args['package-warnings'] || | 188 args['package-warnings'] || |
| 185 args['x-package-warnings-prefix'] != null, | 189 args['x-package-warnings-prefix'] != null, |
| 186 showPackageWarningsPrefix = args['x-package-warnings-prefix'], | 190 showPackageWarningsPrefix = args['x-package-warnings-prefix'], |
| 187 showSdkWarnings = args['show-sdk-warnings'] || args['warnings'], | 191 showSdkWarnings = args['show-sdk-warnings'] || args['warnings'], |
| 188 sourceFiles = args.rest, | 192 sourceFiles = args.rest, |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 help: 'Display this help message.', | 348 help: 'Display this help message.', |
| 345 defaultsTo: false, | 349 defaultsTo: false, |
| 346 negatable: false) | 350 negatable: false) |
| 347 ..addOption('url-mapping', | 351 ..addOption('url-mapping', |
| 348 help: '--url-mapping=libraryUri,/path/to/library.dart directs the ' | 352 help: '--url-mapping=libraryUri,/path/to/library.dart directs the ' |
| 349 'analyzer to use "library.dart" as the source for an import ' | 353 'analyzer to use "library.dart" as the source for an import ' |
| 350 'of "libraryUri".', | 354 'of "libraryUri".', |
| 351 allowMultiple: true, | 355 allowMultiple: true, |
| 352 splitCommas: false) | 356 splitCommas: false) |
| 353 // | 357 // |
| 358 // Incremental analysis. |
| 359 // |
| 360 ..addOption('incremental-cache-path', |
| 361 help: 'The path to the folder with information to support ' |
| 362 'incremental analysis, e.g. summary files, errors, etc.', |
| 363 hide: true) |
| 364 // |
| 354 // Build mode. | 365 // Build mode. |
| 355 // | 366 // |
| 356 ..addFlag('persistent_worker', | 367 ..addFlag('persistent_worker', |
| 357 help: 'Enable Bazel persistent worker mode.', | 368 help: 'Enable Bazel persistent worker mode.', |
| 358 defaultsTo: false, | 369 defaultsTo: false, |
| 359 negatable: false, | 370 negatable: false, |
| 360 hide: true) | 371 hide: true) |
| 361 ..addOption('build-analysis-output', | 372 ..addOption('build-analysis-output', |
| 362 help: | 373 help: |
| 363 'Specifies the path to the file where analysis results should be w
ritten.', | 374 'Specifies the path to the file where analysis results should be w
ritten.', |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 | 684 |
| 674 int _getNextFlagIndex(args, i) { | 685 int _getNextFlagIndex(args, i) { |
| 675 for (; i < args.length; ++i) { | 686 for (; i < args.length; ++i) { |
| 676 if (args[i].startsWith('--')) { | 687 if (args[i].startsWith('--')) { |
| 677 return i; | 688 return i; |
| 678 } | 689 } |
| 679 } | 690 } |
| 680 return i; | 691 return i; |
| 681 } | 692 } |
| 682 } | 693 } |
| OLD | NEW |