Index: pkg/analyzer/benchmark/errors_in_all_libraries.dart |
diff --git a/pkg/analyzer/benchmark/errors_in_all_libraries.dart b/pkg/analyzer/benchmark/errors_in_all_libraries.dart |
index be42c2b22cb7059f67f643553f2b354ca0965567..ad004bf2afc19f3e8e1516dbd99c8bf8ffb462a5 100644 |
--- a/pkg/analyzer/benchmark/errors_in_all_libraries.dart |
+++ b/pkg/analyzer/benchmark/errors_in_all_libraries.dart |
@@ -12,10 +12,10 @@ import 'dart:io'; |
import 'package:analyzer/dart/element/element.dart'; |
import 'package:analyzer/file_system/file_system.dart'; |
import 'package:analyzer/file_system/physical_file_system.dart'; |
+import 'package:analyzer/source/package_map_resolver.dart'; |
+import 'package:analyzer/src/context/builder.dart'; |
import 'package:analyzer/src/dart/sdk/sdk.dart'; |
import 'package:analyzer/src/generated/engine.dart'; |
-import 'package:analyzer/src/generated/java_io.dart'; |
-import 'package:analyzer/src/generated/sdk.dart'; |
import 'package:analyzer/src/generated/source.dart'; |
import 'package:analyzer/src/generated/source_io.dart'; |
import 'package:analyzer/src/source/source_resource.dart'; |
@@ -32,20 +32,25 @@ void main(List<String> args) { |
var start = new DateTime.now(); |
AnalysisEngine.instance.clearCaches(); |
+ AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
+ options.strongMode = true; |
+ options.strongModeHints = true; |
+ |
PhysicalResourceProvider resourceProvider = |
PhysicalResourceProvider.INSTANCE; |
- DartSdk sdk = new FolderBasedDartSdk( |
+ FolderBasedDartSdk sdk = new FolderBasedDartSdk( |
resourceProvider, resourceProvider.getFolder(args[0])); |
+ sdk.analysisOptions = options; |
+ |
+ ContextBuilder builder = new ContextBuilder(resourceProvider, null, null); |
AnalysisContext context = AnalysisEngine.instance.createAnalysisContext(); |
context.sourceFactory = new SourceFactory([ |
new DartUriResolver(sdk), |
new ResourceUriResolver(resourceProvider), |
- new PackageUriResolver([new JavaFile(packageRoot)]) |
+ new PackageMapUriResolver(resourceProvider, |
+ builder.convertPackagesToMap(builder.createPackageMap(packageRoot))) |
]); |
- |
- AnalysisOptionsImpl options = context.analysisOptions; |
- options.strongMode = true; |
- options.strongModeHints = true; |
+ context.analysisOptions = options; |
var mainSource = |
new FileSource(resourceProvider.getFile(p.fromUri(Platform.script))); |