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

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

Issue 394923004: As a temporary measure, allow SDK to be specified on analysis server cmd line. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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/analysis_server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/driver.dart
diff --git a/pkg/analysis_server/lib/driver.dart b/pkg/analysis_server/lib/driver.dart
index c3c6f24ab34a78305f4b7d5f277cfb13bbfd6f35..e21077732ac3872a0a27716ce25159219601dff3 100644
--- a/pkg/analysis_server/lib/driver.dart
+++ b/pkg/analysis_server/lib/driver.dart
@@ -9,6 +9,9 @@ import 'dart:io';
import 'package:analysis_server/http_server.dart';
import 'package:analysis_server/src/socket_server.dart';
import 'package:analysis_server/stdio_server.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:logging/logging.dart';
@@ -39,15 +42,20 @@ class Driver {
*/
static const String LOG_FILE_OPTION = "log";
- SocketServer socketServer = new SocketServer();
+ /**
+ * The path to the SDK.
+ * TODO(paulberry): get rid of this once the 'analysis.updateSdks' request is
+ * operational.
+ */
+ static const String SDK_OPTION = 'sdk';
+
+ SocketServer socketServer;
HttpAnalysisServer httpServer;
StdioAnalysisServer stdioServer;
Driver() {
- httpServer = new HttpAnalysisServer(socketServer);
- stdioServer = new StdioAnalysisServer(socketServer);
}
/**
@@ -62,6 +70,8 @@ class Driver {
"[port] the port on which the server will listen");
parser.addOption(LOG_FILE_OPTION, help:
"[path] file to log debugging messages to");
+ parser.addOption(SDK_OPTION, help:
+ "[path] path to the sdk");
ArgResults results = parser.parse(args);
if (results[HELP_OPTION]) {
@@ -95,6 +105,18 @@ class Driver {
return;
}
}
+ DartSdk defaultSdk;
+ if (results[SDK_OPTION] != null) {
+ defaultSdk = new DirectoryBasedDartSdk(new JavaFile(results[SDK_OPTION]));
+ } else {
+ // No path to the SDK provided; use DirectoryBasedDartSdk.defaultSdk,
+ // which will make a guess.
+ defaultSdk = DirectoryBasedDartSdk.defaultSdk;
+ }
+
+ socketServer = new SocketServer(defaultSdk);
+ httpServer = new HttpAnalysisServer(socketServer);
+ stdioServer = new StdioAnalysisServer(socketServer);
if (serve_http) {
httpServer.serveHttp(port);
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/analysis_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698