remove the option to pass in the --no-preview-dart-2 flag to analysis (#20041)
remove the option to pass in the --no-preview-dart-2 flag to analysis
This commit is contained in:
@@ -26,8 +26,6 @@ class AnalyzeCommand extends FlutterCommand {
|
||||
argParser.addFlag('watch',
|
||||
help: 'Run analysis continuously, watching the filesystem for changes.',
|
||||
negatable: false);
|
||||
argParser.addFlag('preview-dart-2',
|
||||
defaultsTo: true, help: 'Preview Dart 2.0 functionality.');
|
||||
argParser.addOption('write',
|
||||
valueHelp: 'file',
|
||||
help: 'Also output the results to a file. This is useful with --watch '
|
||||
@@ -87,7 +85,6 @@ class AnalyzeCommand extends FlutterCommand {
|
||||
argResults,
|
||||
runner.getRepoRoots(),
|
||||
runner.getRepoPackages(),
|
||||
previewDart2: argResults['preview-dart-2'],
|
||||
).analyze();
|
||||
} else {
|
||||
return new AnalyzeOnce(
|
||||
@@ -95,7 +92,6 @@ class AnalyzeCommand extends FlutterCommand {
|
||||
runner.getRepoRoots(),
|
||||
runner.getRepoPackages(),
|
||||
workingDirectory: workingDirectory,
|
||||
previewDart2: argResults['preview-dart-2'],
|
||||
).analyze();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,13 +19,10 @@ import '../globals.dart';
|
||||
import 'analyze_base.dart';
|
||||
|
||||
class AnalyzeContinuously extends AnalyzeBase {
|
||||
AnalyzeContinuously(ArgResults argResults, this.repoRoots, this.repoPackages, {
|
||||
this.previewDart2 = false,
|
||||
}) : super(argResults);
|
||||
AnalyzeContinuously(ArgResults argResults, this.repoRoots, this.repoPackages) : super(argResults);
|
||||
|
||||
final List<String> repoRoots;
|
||||
final List<Directory> repoPackages;
|
||||
final bool previewDart2;
|
||||
|
||||
String analysisTarget;
|
||||
bool firstAnalysis = true;
|
||||
@@ -60,7 +57,7 @@ class AnalyzeContinuously extends AnalyzeBase {
|
||||
|
||||
final String sdkPath = argResults['dart-sdk'] ?? sdk.dartSdkPath;
|
||||
|
||||
final AnalysisServer server = new AnalysisServer(sdkPath, directories, previewDart2: previewDart2);
|
||||
final AnalysisServer server = new AnalysisServer(sdkPath, directories);
|
||||
server.onAnalyzing.listen((bool isAnalyzing) => _handleAnalysisStatus(server, isAnalyzing));
|
||||
server.onErrors.listen(_handleAnalysisErrors);
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ class AnalyzeOnce extends AnalyzeBase {
|
||||
this.repoRoots,
|
||||
this.repoPackages, {
|
||||
this.workingDirectory,
|
||||
this.previewDart2 = false,
|
||||
}) : super(argResults);
|
||||
|
||||
final List<String> repoRoots;
|
||||
@@ -33,8 +32,6 @@ class AnalyzeOnce extends AnalyzeBase {
|
||||
/// The working directory for testing analysis using dartanalyzer.
|
||||
final Directory workingDirectory;
|
||||
|
||||
final bool previewDart2;
|
||||
|
||||
@override
|
||||
Future<Null> analyze() async {
|
||||
final String currentDirectory =
|
||||
@@ -88,11 +85,7 @@ class AnalyzeOnce extends AnalyzeBase {
|
||||
|
||||
final String sdkPath = argResults['dart-sdk'] ?? sdk.dartSdkPath;
|
||||
|
||||
final AnalysisServer server = new AnalysisServer(
|
||||
sdkPath,
|
||||
directories.toList(),
|
||||
previewDart2: previewDart2,
|
||||
);
|
||||
final AnalysisServer server = new AnalysisServer(sdkPath, directories.toList());
|
||||
|
||||
StreamSubscription<bool> subscription;
|
||||
subscription = server.onAnalyzing.listen((bool isAnalyzing) {
|
||||
|
||||
@@ -14,11 +14,10 @@ import '../base/utils.dart';
|
||||
import '../globals.dart';
|
||||
|
||||
class AnalysisServer {
|
||||
AnalysisServer(this.sdkPath, this.directories, {this.previewDart2 = false});
|
||||
AnalysisServer(this.sdkPath, this.directories);
|
||||
|
||||
final String sdkPath;
|
||||
final List<String> directories;
|
||||
final bool previewDart2;
|
||||
|
||||
Process _process;
|
||||
final StreamController<bool> _analyzingController =
|
||||
@@ -38,12 +37,6 @@ class AnalysisServer {
|
||||
sdkPath,
|
||||
];
|
||||
|
||||
if (previewDart2) {
|
||||
command.add('--preview-dart-2');
|
||||
} else {
|
||||
command.add('--no-preview-dart-2');
|
||||
}
|
||||
|
||||
printTrace('dart ${command.skip(1).join(' ')}');
|
||||
_process = await processManager.start(command);
|
||||
// This callback hookup can't throw.
|
||||
|
||||
Reference in New Issue
Block a user