Skip to content

Commit 2563a1b

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Add an option to dartfix to specify the SDK used by analysis
Change-Id: Iaa0d37e3db9ecea4a577c4d6155362d5cd8ce2d8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124842 Reviewed-by: Paul Berry <paulberry@google.com> Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
1 parent 667f77e commit 2563a1b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/dartfix/lib/src/options.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const pedanticOption = 'pedantic';
1818
const previewDirOption = 'preview-dir';
1919
const previewPortOption = 'preview-port';
2020
const requiredOption = 'required';
21+
const sdkOption = 'sdk';
2122

2223
const _binaryName = 'dartfix';
2324
const _colorOption = 'color';
@@ -58,7 +59,7 @@ class Options {
5859
previewDir = results[previewDirOption] as String,
5960
previewPort = results[previewPortOption] as String,
6061
requiredFixes = results[requiredOption] as bool,
61-
sdkPath = _getSdkPath(),
62+
sdkPath = results[sdkOption] as String ?? _getSdkPath(),
6263
serverSnapshot = results[_serverSnapshot] as String,
6364
showHelp = results[_helpOption] as bool || results.arguments.isEmpty,
6465
targets = results.rest,
@@ -102,6 +103,10 @@ class Options {
102103
help: 'Display this help message.',
103104
defaultsTo: false,
104105
negatable: false)
106+
..addOption(sdkOption,
107+
help: 'Path to the SDK to analyze against.',
108+
valueHelp: 'path',
109+
hide: true)
105110
..addOption(_serverSnapshot,
106111
help: 'Path to the analysis server snapshot file.',
107112
valueHelp: 'path',

0 commit comments

Comments
 (0)