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

Unified Diff: pkg/analyzer_cli/lib/src/build_mode.dart

Issue 1882373003: Use the provided dart sdk path in worker mode (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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_cli/test/build_mode_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/lib/src/build_mode.dart
diff --git a/pkg/analyzer_cli/lib/src/build_mode.dart b/pkg/analyzer_cli/lib/src/build_mode.dart
index 511c6c099ddb23d18eae2b513c724a92eaeb2252..7bc499946f76bb4ad8218c94797e11e572644919 100644
--- a/pkg/analyzer_cli/lib/src/build_mode.dart
+++ b/pkg/analyzer_cli/lib/src/build_mode.dart
@@ -348,7 +348,6 @@ class WorkerLoop {
* Performs analysis with given [options].
*/
void analyze(CommandLineOptions options) {
- options.dartSdkPath ??= dartSdkPath;
new BuildMode(options, new AnalysisStats()).analyze();
}
@@ -361,9 +360,16 @@ class WorkerLoop {
if (request == null) {
return true;
}
+ // Add in the dart-sdk argument if `dartSdkPath` is not null, otherwise it
+ // will try to find the currently installed sdk.
+ var arguments = new List.from(request.arguments);
+ if (dartSdkPath != null &&
+ !arguments.any((arg) => arg.startsWith('--dart-sdk'))) {
+ arguments.add('--dart-sdk=$dartSdkPath');
+ }
// Prepare options.
CommandLineOptions options =
- CommandLineOptions.parse(request.arguments, (String msg) {
+ CommandLineOptions.parse(arguments, (String msg) {
throw new ArgumentError(msg);
});
// Analyze and respond.
« no previous file with comments | « no previous file | pkg/analyzer_cli/test/build_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698