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

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

Issue 2844883005: Use the dart:io Platform.resolvedExecutable API to locate the Dart SDK. (Closed)
Patch Set: Created 3 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 | « pkg/analyzer/lib/src/util/sdk.dart ('k') | pkg/analyzer_cli/test/driver_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/options.dart
diff --git a/pkg/analyzer_cli/lib/src/options.dart b/pkg/analyzer_cli/lib/src/options.dart
index 7e8b9cbb5269cfad824d05dfdab572fdaf7e034d..0e5aa0ec6dc298179142b2562f8b1e2d58fdc7af 100644
--- a/pkg/analyzer_cli/lib/src/options.dart
+++ b/pkg/analyzer_cli/lib/src/options.dart
@@ -7,10 +7,10 @@ import 'dart:io';
import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer/src/command_line/arguments.dart';
import 'package:analyzer/src/context/builder.dart';
+import 'package:analyzer/src/util/sdk.dart';
import 'package:analyzer_cli/src/ansi.dart' as ansi;
import 'package:analyzer_cli/src/driver.dart';
import 'package:args/args.dart';
-import 'package:cli_util/cli_util.dart' show getSdkDir;
const _binaryName = 'dartanalyzer';
@@ -234,12 +234,7 @@ class CommandLineOptions {
// Check SDK.
if (!options.buildModePersistentWorker) {
// Infer if unspecified.
- if (options.dartSdkPath == null) {
- Directory sdkDir = getSdkDir(args);
- if (sdkDir != null) {
- options.dartSdkPath = sdkDir.path;
- }
- }
+ options.dartSdkPath ??= getSdkPath(args);
String sdkPath = options.dartSdkPath;
« no previous file with comments | « pkg/analyzer/lib/src/util/sdk.dart ('k') | pkg/analyzer_cli/test/driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698