Index: pkg/analyzer/lib/src/lint/analysis.dart |
diff --git a/pkg/analyzer/lib/src/lint/analysis.dart b/pkg/analyzer/lib/src/lint/analysis.dart |
index 57d85e258fb0b302f7e95029857da220edc9940f..84a8a3c7f7b19629c4a9951abace3d29444efa0b 100644 |
--- a/pkg/analyzer/lib/src/lint/analysis.dart |
+++ b/pkg/analyzer/lib/src/lint/analysis.dart |
@@ -21,7 +21,7 @@ import 'package:analyzer/src/lint/linter.dart'; |
import 'package:analyzer/src/lint/project.dart'; |
import 'package:analyzer/src/lint/registry.dart'; |
import 'package:analyzer/src/services/lint.dart'; |
-import 'package:cli_util/cli_util.dart' as cli_util; |
+import 'package:analyzer/src/util/sdk.dart'; |
import 'package:package_config/packages.dart' show Packages; |
import 'package:package_config/packages_file.dart' as pkgfile show parse; |
import 'package:package_config/src/packages_impl.dart' show MapPackages; |
@@ -134,12 +134,8 @@ class LintDriver { |
} |
String get sdkDir { |
- if (options.dartSdkPath != null) { |
- return options.dartSdkPath; |
- } |
- // In case no SDK has been specified, fall back to inferring it |
- // TODO: pass args to cli_util |
- return cli_util.getSdkDir().path; |
+ // In case no SDK has been specified, fall back to inferring it. |
+ return options.dartSdkPath ?? getSdkPath(); |
} |
List<AnalysisErrorInfo> analyze(Iterable<io.File> files) { |