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

Unified Diff: pkg/analysis_server/lib/src/server/driver.dart

Issue 2242853002: Deprecate DirectoryBasedDartSdk and transition existing uses to the new API (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/analysis_server/lib/src/socket_server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/server/driver.dart
diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart
index b6c878f06ec24d1c59db9def08df2f7c0138b5c3..e21d2c869d00242d5226096aa895d1a568b8c272 100644
--- a/pkg/analysis_server/lib/src/server/driver.dart
+++ b/pkg/analysis_server/lib/src/server/driver.dart
@@ -20,11 +20,10 @@ import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer/instrumentation/file_instrumentation.dart';
import 'package:analyzer/instrumentation/instrumentation.dart';
import 'package:analyzer/plugin/resolver_provider.dart';
+import 'package:analyzer/src/dart/sdk/sdk.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/incremental_logger.dart';
-import 'package:analyzer/src/generated/java_io.dart';
import 'package:analyzer/src/generated/sdk.dart';
-import 'package:analyzer/src/generated/sdk_io.dart';
import 'package:args/args.dart';
import 'package:linter/src/plugin/linter_plugin.dart';
import 'package:plugin/manager.dart';
@@ -405,18 +404,22 @@ class Driver implements ServerStarter {
ExtensionManager manager = new ExtensionManager();
manager.processPlugins(plugins);
- JavaFile defaultSdkDirectory;
+ String defaultSdkPath;
if (results[SDK_OPTION] != null) {
- defaultSdkDirectory = new JavaFile(results[SDK_OPTION]);
+ defaultSdkPath = results[SDK_OPTION];
} else {
// No path to the SDK was provided.
// Use DirectoryBasedDartSdk.defaultSdkDirectory, which will make a guess.
- defaultSdkDirectory = DirectoryBasedDartSdk.defaultSdkDirectory;
+ defaultSdkPath = FolderBasedDartSdk
+ .defaultSdkDirectory(PhysicalResourceProvider.INSTANCE)
+ .path;
}
bool useSummaries = analysisServerOptions.fileReadMode == 'as-is';
SdkCreator defaultSdkCreator = (AnalysisOptions options) {
- DirectoryBasedDartSdk sdk =
- new DirectoryBasedDartSdk(defaultSdkDirectory);
+ PhysicalResourceProvider resourceProvider =
+ PhysicalResourceProvider.INSTANCE;
+ FolderBasedDartSdk sdk = new FolderBasedDartSdk(resourceProvider,
skybrian 2016/08/24 01:55:10 This seems to have broken the --sdk flag. Its valu
+ FolderBasedDartSdk.defaultSdkDirectory(resourceProvider));
sdk.analysisOptions = options;
sdk.useSummary = useSummaries;
return sdk;
@@ -424,7 +427,7 @@ class Driver implements ServerStarter {
// TODO(brianwilkerson) It would be nice to avoid creating an SDK that
// cannot be re-used, but the SDK is needed to create a package map provider
// in the case where we need to run `pub` in order to get the package map.
- DirectoryBasedDartSdk defaultSdk = defaultSdkCreator(null);
+ DartSdk defaultSdk = defaultSdkCreator(null);
//
// Initialize the instrumentation service.
//
@@ -448,8 +451,7 @@ class Driver implements ServerStarter {
//
socketServer = new SocketServer(
analysisServerOptions,
- new DartSdkManager(defaultSdkDirectory.getAbsolutePath(), useSummaries,
- defaultSdkCreator),
+ new DartSdkManager(defaultSdkPath, useSummaries, defaultSdkCreator),
defaultSdk,
service,
serverPlugin,
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/socket_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698