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.driver; | 5 library analyzer_cli.src.driver; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 if (options.lints != _previousOptions.lints) { | 265 if (options.lints != _previousOptions.lints) { |
266 return false; | 266 return false; |
267 } | 267 } |
268 if (options.strongMode != _previousOptions.strongMode) { | 268 if (options.strongMode != _previousOptions.strongMode) { |
269 return false; | 269 return false; |
270 } | 270 } |
271 if (options.enableSuperMixins != _previousOptions.enableSuperMixins) { | 271 if (options.enableSuperMixins != _previousOptions.enableSuperMixins) { |
272 return false; | 272 return false; |
273 } | 273 } |
| 274 if (options.enableConditionalDirectives != |
| 275 _previousOptions.enableConditionalDirectives) { |
| 276 return false; |
| 277 } |
274 return true; | 278 return true; |
275 } | 279 } |
276 | 280 |
277 /// Decide on the appropriate policy for which files need to be fully parsed | 281 /// Decide on the appropriate policy for which files need to be fully parsed |
278 /// and which files need to be diet parsed, based on [options], and return an | 282 /// and which files need to be diet parsed, based on [options], and return an |
279 /// [AnalyzeFunctionBodiesPredicate] that implements this policy. | 283 /// [AnalyzeFunctionBodiesPredicate] that implements this policy. |
280 AnalyzeFunctionBodiesPredicate _chooseDietParsingPolicy( | 284 AnalyzeFunctionBodiesPredicate _chooseDietParsingPolicy( |
281 CommandLineOptions options) { | 285 CommandLineOptions options) { |
282 if (_isBatch) { | 286 if (_isBatch) { |
283 // As analyzer is currently implemented, once a file has been diet | 287 // As analyzer is currently implemented, once a file has been diet |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 | 576 |
573 if (options.log) { | 577 if (options.log) { |
574 AnalysisEngine.instance.logger = new StdLogger(); | 578 AnalysisEngine.instance.logger = new StdLogger(); |
575 } | 579 } |
576 | 580 |
577 // Prepare context options. | 581 // Prepare context options. |
578 AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl(); | 582 AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl(); |
579 contextOptions.hint = !options.disableHints; | 583 contextOptions.hint = !options.disableHints; |
580 contextOptions.enableStrictCallChecks = options.enableStrictCallChecks; | 584 contextOptions.enableStrictCallChecks = options.enableStrictCallChecks; |
581 contextOptions.enableSuperMixins = options.enableSuperMixins; | 585 contextOptions.enableSuperMixins = options.enableSuperMixins; |
| 586 contextOptions.enableConditionalDirectives = |
| 587 options.enableConditionalDirectives; |
582 contextOptions.generateImplicitErrors = options.showPackageWarnings; | 588 contextOptions.generateImplicitErrors = options.showPackageWarnings; |
583 contextOptions.generateSdkErrors = options.showSdkWarnings; | 589 contextOptions.generateSdkErrors = options.showSdkWarnings; |
584 contextOptions.lint = options.lints; | 590 contextOptions.lint = options.lints; |
585 contextOptions.strongMode = options.strongMode; | 591 contextOptions.strongMode = options.strongMode; |
586 configureContextOptions(contextOptions); | 592 configureContextOptions(contextOptions); |
587 | 593 |
588 // Set context options. | 594 // Set context options. |
589 context.analysisOptions = contextOptions; | 595 context.analysisOptions = contextOptions; |
590 context.sourceFactory.dartSdk.context.analysisOptions = contextOptions; | 596 context.sourceFactory.dartSdk.context.analysisOptions = contextOptions; |
591 | 597 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 for (var package in packages) { | 742 for (var package in packages) { |
737 var packageName = path.basename(package.path); | 743 var packageName = path.basename(package.path); |
738 var realPath = package.resolveSymbolicLinksSync(); | 744 var realPath = package.resolveSymbolicLinksSync(); |
739 result[packageName] = [ | 745 result[packageName] = [ |
740 PhysicalResourceProvider.INSTANCE.getFolder(realPath) | 746 PhysicalResourceProvider.INSTANCE.getFolder(realPath) |
741 ]; | 747 ]; |
742 } | 748 } |
743 return result; | 749 return result; |
744 } | 750 } |
745 } | 751 } |
OLD | NEW |