Commit 2d4d1713 authored by Phil Quitslund's avatar Phil Quitslund Committed by GitHub

Roll to Dart SDK `1.20.0-dev.5.0`. (#5911)

* Roll to Dart SDK `1.20.0-dev.5.0`.

* bumps to `1.20.0-dev.5.0`.
* updates `analyzer` API use.

* Add explicit types.
parent 51cd8b67
......@@ -74,7 +74,7 @@ class WidgetController {
/// * Use [firstWidget] if you expect to match several but only want the first.
Iterable<Widget/*=T*/> widgetList/*<T extends Widget>*/(Finder finder) {
TestAsyncUtils.guardSync();
return finder.evaluate().map((Element element) => element.widget);
return finder.evaluate().map/*<T>*/((Element element) => element.widget);
}
......@@ -219,7 +219,7 @@ class WidgetController {
/// * Use [firstRenderObject] if you expect to match several but only want the first.
Iterable<RenderObject/*=T*/> renderObjectList/*<T extends RenderObject>*/(Finder finder) {
TestAsyncUtils.guardSync();
return finder.evaluate().map((Element element) => element.renderObject);
return finder.evaluate().map/*<T>*/((Element element) => element.renderObject);
}
......
......@@ -85,7 +85,7 @@ Future<Null> main(List<String> args) async {
..addCommand(new UpdatePackagesCommand(hidden: !verboseHelp))
..addCommand(new UpgradeCommand());
return Chain.capture(() async {
return Chain.capture/*<Future<Null>>*/(() async {
// Initialize globals.
context[Logger] = new StdoutLogger();
context[DeviceManager] = new DeviceManager();
......
......@@ -10,6 +10,7 @@ import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer/plugin/options.dart';
import 'package:analyzer/source/analysis_options_provider.dart';
import 'package:analyzer/source/error_processor.dart';
import 'package:analyzer/source/package_map_resolver.dart';
import 'package:analyzer/src/context/builder.dart'; // ignore: implementation_imports
import 'package:analyzer/src/dart/sdk/sdk.dart'; // ignore: implementation_imports
import 'package:analyzer/src/generated/engine.dart'; // ignore: implementation_imports
......@@ -32,6 +33,8 @@ class AnalysisDriver {
AnalysisOptionsProvider analysisOptionsProvider =
new AnalysisOptionsProvider();
file_system.ResourceProvider resourceProvider = PhysicalResourceProvider.INSTANCE;
AnalysisContext context;
DriverOptions options;
......@@ -110,7 +113,7 @@ class AnalysisDriver {
resolvers.add(new DartUriResolver(sdk));
} else {
// Fall back to a standard SDK if no embedder is found.
FolderBasedDartSdk sdk = new FolderBasedDartSdk(PhysicalResourceProvider.INSTANCE,
FolderBasedDartSdk sdk = new FolderBasedDartSdk(resourceProvider,
PhysicalResourceProvider.INSTANCE.getFolder(sdkDir));
sdk.analysisOptions = context.analysisOptions;
......@@ -118,11 +121,15 @@ class AnalysisDriver {
}
if (options.packageRootPath != null) {
JavaFile packageDirectory = new JavaFile(options.packageRootPath);
resolvers.add(new PackageUriResolver(<JavaFile>[packageDirectory]));
ContextBuilder builder = new ContextBuilder(resourceProvider, null, null);
builder.defaultPackagesDirectoryPath = options.packageRootPath;
PackageMapUriResolver packageUriResolver = new PackageMapUriResolver(resourceProvider,
builder.convertPackagesToMap(builder.createPackageMap('')));
resolvers.add(packageUriResolver);
}
resolvers.add(new file_system.ResourceUriResolver(PhysicalResourceProvider.INSTANCE));
resolvers.add(new file_system.ResourceUriResolver(resourceProvider));
return resolvers;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment