| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 context.directory.manager; | 5 library context.directory.manager; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:core'; | 10 import 'dart:core'; |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 List<String> excludeList = toStringList(exclude); | 709 List<String> excludeList = toStringList(exclude); |
| 710 if (excludeList != null) { | 710 if (excludeList != null) { |
| 711 setIgnorePatternsForContext(info, excludeList); | 711 setIgnorePatternsForContext(info, excludeList); |
| 712 } | 712 } |
| 713 } | 713 } |
| 714 } | 714 } |
| 715 | 715 |
| 716 /** | 716 /** |
| 717 * Process [options] for the given context [info]. | 717 * Process [options] for the given context [info]. |
| 718 */ | 718 */ |
| 719 void processOptionsForDriver(ContextInfo info, Map<String, Object> options, | 719 void processOptionsForDriver(ContextInfo info, Map<String, Object> options) { |
| 720 {bool optionsRemoved: false}) { | 720 if (options == null) { |
| 721 if (options == null && !optionsRemoved) { | |
| 722 return; | 721 return; |
| 723 } | 722 } |
| 724 AnalysisOptionsImpl analysisOptions = info.analysisDriver.analysisOptions; | 723 AnalysisOptionsImpl analysisOptions = info.analysisDriver.analysisOptions; |
| 725 | 724 |
| 726 // In case options files are removed, revert to defaults. | 725 // Check for embedded options. |
| 727 if (optionsRemoved) { | 726 Map embeddedOptions = _getEmbeddedOptions(info); |
| 728 // Start with defaults. | 727 if (embeddedOptions != null) { |
| 729 analysisOptions.resetToDefaults(); | 728 options = _toStringMap(new Merger().merge(embeddedOptions, options)); |
| 730 | |
| 731 // Apply inherited options. | |
| 732 options = _toStringMap(_getEmbeddedOptions(info)); | |
| 733 if (options != null) { | |
| 734 applyToAnalysisOptions(analysisOptions, options); | |
| 735 } | |
| 736 } else { | |
| 737 // Check for embedded options. | |
| 738 Map embeddedOptions = _getEmbeddedOptions(info); | |
| 739 if (embeddedOptions != null) { | |
| 740 options = _toStringMap(new Merger().merge(embeddedOptions, options)); | |
| 741 } | |
| 742 } | 729 } |
| 743 | 730 |
| 744 applyToAnalysisOptions(analysisOptions, options); | 731 applyToAnalysisOptions(analysisOptions, options); |
| 745 | 732 |
| 746 // Nothing more to do. | |
| 747 if (options == null) { | |
| 748 return; | |
| 749 } | |
| 750 | |
| 751 var analyzer = options[AnalyzerOptions.analyzer]; | 733 var analyzer = options[AnalyzerOptions.analyzer]; |
| 752 if (analyzer is Map) { | 734 if (analyzer is Map) { |
| 753 // Set ignore patterns. | 735 // Set ignore patterns. |
| 754 YamlList exclude = analyzer[AnalyzerOptions.exclude]; | 736 YamlList exclude = analyzer[AnalyzerOptions.exclude]; |
| 755 List<String> excludeList = toStringList(exclude); | 737 List<String> excludeList = toStringList(exclude); |
| 756 if (excludeList != null) { | 738 if (excludeList != null) { |
| 757 setIgnorePatternsForContext(info, excludeList); | 739 setIgnorePatternsForContext(info, excludeList); |
| 758 } | 740 } |
| 759 } | 741 } |
| 760 } | 742 } |
| (...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1975 } | 1957 } |
| 1976 return _embedderLocator; | 1958 return _embedderLocator; |
| 1977 } | 1959 } |
| 1978 | 1960 |
| 1979 @override | 1961 @override |
| 1980 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { | 1962 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { |
| 1981 return _sdkExtensionFinder ??= | 1963 return _sdkExtensionFinder ??= |
| 1982 new SdkExtensionFinder(buildPackageMap(resourceProvider)); | 1964 new SdkExtensionFinder(buildPackageMap(resourceProvider)); |
| 1983 } | 1965 } |
| 1984 } | 1966 } |
| OLD | NEW |