Skip to content

Commit 80ad4be

Browse files
srawlinsCommit Queue
authored and
Commit Queue
committed
dartdev: Add an AOT option to 'dart fix'
Work towards #50498 Change-Id: Ie09063325062e1b2c3b70d3a2a65df4c33c74095 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425981 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Siva Annamalai <[email protected]>
1 parent eb03a16 commit 80ad4be

File tree

1 file changed

+30
-23
lines changed

1 file changed

+30
-23
lines changed

pkg/dartdev/lib/src/commands/fix.dart

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,37 @@ To use the tool, run either ['dart fix --dry-run'] for a preview of the proposed
3636
late String argsTarget;
3737

3838
FixCommand({bool verbose = false}) : super(cmdName, cmdDescription, verbose) {
39-
argParser.addFlag('dry-run',
40-
abbr: 'n',
39+
argParser
40+
..addFlag('dry-run',
41+
abbr: 'n',
42+
defaultsTo: false,
43+
negatable: false,
44+
help: 'Preview the proposed changes but make no changes.')
45+
..addFlag(
46+
'apply',
4147
defaultsTo: false,
4248
negatable: false,
43-
help: 'Preview the proposed changes but make no changes.');
44-
argParser.addFlag(
45-
'apply',
46-
defaultsTo: false,
47-
negatable: false,
48-
help: 'Apply the proposed changes.',
49-
);
50-
argParser.addMultiOption(
51-
'code',
52-
help: 'Apply fixes for one (or more) diagnostic codes.',
53-
valueHelp: 'code1,code2,...',
54-
);
55-
argParser.addFlag(
56-
'compare-to-golden',
57-
defaultsTo: false,
58-
negatable: false,
59-
help:
60-
'Compare the result of applying fixes to a golden file for testing.',
61-
hide: !verbose,
62-
);
63-
argParser.addExperimentalFlags(verbose: verbose);
49+
help: 'Apply the proposed changes.',
50+
)
51+
..addMultiOption(
52+
'code',
53+
help: 'Apply fixes for one (or more) diagnostic codes.',
54+
valueHelp: 'code1,code2,...',
55+
)
56+
..addFlag(
57+
'compare-to-golden',
58+
defaultsTo: false,
59+
negatable: false,
60+
help:
61+
'Compare the result of applying fixes to a golden file for testing.',
62+
hide: !verbose,
63+
)
64+
..addFlag(
65+
useAotSnapshotFlag,
66+
help: 'Use the AOT analysis server snapshot',
67+
hide: true,
68+
)
69+
..addExperimentalFlags(verbose: verbose);
6470
}
6571

6672
@override
@@ -120,6 +126,7 @@ To use the tool, run either ['dart fix --dry-run'] for a preview of the proposed
120126
argResults: argResults,
121127
suppressAnalytics: suppressAnalytics,
122128
enabledExperiments: args.enabledExperiments,
129+
useAotSnapshot: args.flag(useAotSnapshotFlag),
123130
);
124131

125132
await server.start(setAnalysisRoots: false);

0 commit comments

Comments
 (0)