Index: pkg/analyzer/lib/src/context/builder.dart |
diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart |
index d0d9b1e85f58404960ea7183bf44c4c1dc49367e..75875f709f76d6504cf73ba48225a63745d2fb50 100644 |
--- a/pkg/analyzer/lib/src/context/builder.dart |
+++ b/pkg/analyzer/lib/src/context/builder.dart |
@@ -336,9 +336,20 @@ class ContextBuilder { |
if (optionsFile != null) { |
List<OptionsProcessor> optionsProcessors = |
AnalysisEngine.instance.optionsPlugin.optionsProcessors; |
+ // TODO(danrubel) restructure so that we don't recalculate the package map |
+ // more than once per path. |
+ Packages packages = createPackageMap(path); |
+ Map<String, List<Folder>> packageMap = convertPackagesToMap(packages); |
+ List<UriResolver> resolvers = <UriResolver>[ |
+ new ResourceUriResolver(resourceProvider), |
+ new PackageMapUriResolver(resourceProvider, packageMap), |
+ ]; |
+ SourceFactory sourceFactory = |
+ new SourceFactory(resolvers, packages, resourceProvider); |
try { |
Map<String, YamlNode> optionMap = |
- new AnalysisOptionsProvider().getOptionsFromFile(optionsFile); |
+ new AnalysisOptionsProvider(sourceFactory) |
+ .getOptionsFromFile(optionsFile); |
optionsProcessors.forEach( |
(OptionsProcessor p) => p.optionsProcessed(context, optionMap)); |
applyToAnalysisOptions(options, optionMap); |