Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: pkg/analyzer/benchmark/errors_in_all_libraries.dart

Issue 2320733003: Remove final references to PackageUriResolver (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/example/resolver_driver.dart » ('j') | pkg/analyzer/example/resolver_driver.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)));
« no previous file with comments | « no previous file | pkg/analyzer/example/resolver_driver.dart » ('j') | pkg/analyzer/example/resolver_driver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698