| 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 12 matching lines...) Expand all Loading... |
| 23 import 'package:analyzer/source/sdk_ext.dart'; | 23 import 'package:analyzer/source/sdk_ext.dart'; |
| 24 import 'package:analyzer/src/context/builder.dart'; | 24 import 'package:analyzer/src/context/builder.dart'; |
| 25 import 'package:analyzer/src/context/context.dart' as context; | 25 import 'package:analyzer/src/context/context.dart' as context; |
| 26 import 'package:analyzer/src/dart/analysis/driver.dart'; | 26 import 'package:analyzer/src/dart/analysis/driver.dart'; |
| 27 import 'package:analyzer/src/dart/sdk/sdk.dart'; | 27 import 'package:analyzer/src/dart/sdk/sdk.dart'; |
| 28 import 'package:analyzer/src/generated/engine.dart'; | 28 import 'package:analyzer/src/generated/engine.dart'; |
| 29 import 'package:analyzer/src/generated/java_io.dart'; | 29 import 'package:analyzer/src/generated/java_io.dart'; |
| 30 import 'package:analyzer/src/generated/sdk.dart'; | 30 import 'package:analyzer/src/generated/sdk.dart'; |
| 31 import 'package:analyzer/src/generated/source.dart'; | 31 import 'package:analyzer/src/generated/source.dart'; |
| 32 import 'package:analyzer/src/generated/source_io.dart'; | 32 import 'package:analyzer/src/generated/source_io.dart'; |
| 33 import 'package:analyzer/src/lint/config.dart'; |
| 34 import 'package:analyzer/src/lint/linter.dart'; |
| 35 import 'package:analyzer/src/lint/registry.dart'; |
| 33 import 'package:analyzer/src/task/options.dart'; | 36 import 'package:analyzer/src/task/options.dart'; |
| 34 import 'package:analyzer/src/util/absolute_path.dart'; | 37 import 'package:analyzer/src/util/absolute_path.dart'; |
| 35 import 'package:analyzer/src/util/glob.dart'; | 38 import 'package:analyzer/src/util/glob.dart'; |
| 36 import 'package:analyzer/src/util/yaml.dart'; | 39 import 'package:analyzer/src/util/yaml.dart'; |
| 37 import 'package:linter/src/config.dart'; | |
| 38 import 'package:linter/src/linter.dart'; | |
| 39 import 'package:linter/src/rules.dart'; | |
| 40 import 'package:package_config/packages.dart'; | 40 import 'package:package_config/packages.dart'; |
| 41 import 'package:package_config/packages_file.dart' as pkgfile show parse; | 41 import 'package:package_config/packages_file.dart' as pkgfile show parse; |
| 42 import 'package:package_config/src/packages_impl.dart' show MapPackages; | 42 import 'package:package_config/src/packages_impl.dart' show MapPackages; |
| 43 import 'package:path/path.dart' as pathos; | 43 import 'package:path/path.dart' as pathos; |
| 44 import 'package:watcher/watcher.dart'; | 44 import 'package:watcher/watcher.dart'; |
| 45 import 'package:yaml/yaml.dart'; | 45 import 'package:yaml/yaml.dart'; |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Information tracked by the [ContextManager] for each context. | 48 * Information tracked by the [ContextManager] for each context. |
| 49 */ | 49 */ |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 // Check for embedded options. | 702 // Check for embedded options. |
| 703 Map embeddedOptions = _getEmbeddedOptions(info); | 703 Map embeddedOptions = _getEmbeddedOptions(info); |
| 704 if (embeddedOptions != null) { | 704 if (embeddedOptions != null) { |
| 705 options = _toStringMap(new Merger().merge(embeddedOptions, options)); | 705 options = _toStringMap(new Merger().merge(embeddedOptions, options)); |
| 706 } | 706 } |
| 707 } | 707 } |
| 708 | 708 |
| 709 var lintOptions = options['linter']; | 709 var lintOptions = options['linter']; |
| 710 if (lintOptions != null) { | 710 if (lintOptions != null) { |
| 711 LintConfig config = new LintConfig.parseMap(lintOptions); | 711 LintConfig config = new LintConfig.parseMap(lintOptions); |
| 712 Iterable<LintRule> lintRules = ruleRegistry.enabled(config); | 712 Iterable<LintRule> lintRules = Registry.ruleRegistry.enabled(config); |
| 713 if (lintRules.isNotEmpty) { | 713 if (lintRules.isNotEmpty) { |
| 714 analysisOptions.lint = true; | 714 analysisOptions.lint = true; |
| 715 analysisOptions.lintRules = lintRules.toList(); | 715 analysisOptions.lintRules = lintRules.toList(); |
| 716 } | 716 } |
| 717 } | 717 } |
| 718 | 718 |
| 719 applyToAnalysisOptions(analysisOptions, options); | 719 applyToAnalysisOptions(analysisOptions, options); |
| 720 | 720 |
| 721 // Nothing more to do. | 721 // Nothing more to do. |
| 722 if (options == null) { | 722 if (options == null) { |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1926 } | 1926 } |
| 1927 return _embedderLocator; | 1927 return _embedderLocator; |
| 1928 } | 1928 } |
| 1929 | 1929 |
| 1930 @override | 1930 @override |
| 1931 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { | 1931 SdkExtensionFinder getSdkExtensionFinder(ResourceProvider resourceProvider) { |
| 1932 return _sdkExtensionFinder ??= | 1932 return _sdkExtensionFinder ??= |
| 1933 new SdkExtensionFinder(buildPackageMap(resourceProvider)); | 1933 new SdkExtensionFinder(buildPackageMap(resourceProvider)); |
| 1934 } | 1934 } |
| 1935 } | 1935 } |
| OLD | NEW |