Unverified Commit 5ba2d79a authored by Devon Carew's avatar Devon Carew Committed by GitHub

remove the use of the analysis server --enable-experiments flag from flutter analyze (#69966)

parent e18533e7
......@@ -30,7 +30,6 @@ class AnalyzeCommand extends FlutterCommand {
_logger = logger,
_terminal = terminal,
_platform = platform {
addEnableExperimentation(hide: !verboseHelp);
argParser.addFlag('flutter-repo',
negatable: false,
help: 'Include all the examples and tests from the Flutter repository.',
......@@ -126,7 +125,6 @@ class AnalyzeCommand extends FlutterCommand {
platform: _platform,
processManager: _processManager,
terminal: _terminal,
experiments: stringsArg('enable-experiment'),
artifacts: _artifacts,
).analyze();
} else {
......@@ -140,7 +138,6 @@ class AnalyzeCommand extends FlutterCommand {
platform: _platform,
processManager: _processManager,
terminal: _terminal,
experiments: stringsArg('enable-experiment'),
artifacts: _artifacts,
).analyze();
}
......
......@@ -28,7 +28,6 @@ abstract class AnalyzeBase {
@required this.platform,
@required this.processManager,
@required this.terminal,
@required this.experiments,
@required this.artifacts,
});
......@@ -49,8 +48,6 @@ abstract class AnalyzeBase {
@protected
final Terminal terminal;
@protected
final List<String> experiments;
@protected
final Artifacts artifacts;
/// Called by [AnalyzeCommand] to start the analysis process.
......
......@@ -26,7 +26,6 @@ class AnalyzeContinuously extends AnalyzeBase {
@required Terminal terminal,
@required Platform platform,
@required ProcessManager processManager,
@required List<String> experiments,
@required Artifacts artifacts,
}) : super(
argResults,
......@@ -37,7 +36,6 @@ class AnalyzeContinuously extends AnalyzeBase {
platform: platform,
terminal: terminal,
processManager: processManager,
experiments: experiments,
artifacts: artifacts,
);
......@@ -77,7 +75,6 @@ class AnalyzeContinuously extends AnalyzeBase {
platform: platform,
processManager: processManager,
terminal: terminal,
experiments: experiments,
);
server.onAnalyzing.listen((bool isAnalyzing) => _handleAnalysisStatus(server, isAnalyzing));
server.onErrors.listen(_handleAnalysisErrors);
......
......@@ -27,7 +27,6 @@ class AnalyzeOnce extends AnalyzeBase {
@required Platform platform,
@required ProcessManager processManager,
@required Terminal terminal,
@required List<String> experiments,
@required Artifacts artifacts,
this.workingDirectory,
}) : super(
......@@ -39,7 +38,6 @@ class AnalyzeOnce extends AnalyzeBase {
platform: platform,
processManager: processManager,
terminal: terminal,
experiments: experiments,
artifacts: artifacts,
);
......@@ -95,7 +93,6 @@ class AnalyzeOnce extends AnalyzeBase {
logger: logger,
processManager: processManager,
terminal: terminal,
experiments: experiments,
);
Stopwatch timer;
......
......@@ -27,13 +27,11 @@ class AnalysisServer {
@required Logger logger,
@required Platform platform,
@required Terminal terminal,
@required List<String> experiments,
}) : _fileSystem = fileSystem,
_processManager = processManager,
_logger = logger,
_platform = platform,
_terminal = terminal,
_experiments = experiments;
_terminal = terminal;
final String sdkPath;
final List<String> directories;
......@@ -42,7 +40,6 @@ class AnalysisServer {
final Logger _logger;
final Platform _platform;
final Terminal _terminal;
final List<String> _experiments;
Process _process;
final StreamController<bool> _analyzingController =
......@@ -64,11 +61,6 @@ class AnalysisServer {
_fileSystem.path.join(sdkPath, 'bin', 'dart'),
'--disable-dart-dev',
snapshot,
for (String experiment in _experiments)
...<String>[
'--enable-experiment',
experiment,
],
'--disable-server-feature-completion',
'--disable-server-feature-search',
'--sdk',
......
......@@ -93,7 +93,6 @@ void main() {
processManager: processManager,
logger: logger,
terminal: terminal,
experiments: <String>[],
);
int errorCount = 0;
......@@ -132,7 +131,6 @@ void main() {
processManager: processManager,
logger: logger,
terminal: terminal,
experiments: <String>[],
);
int errorCount = 0;
......@@ -158,7 +156,6 @@ void main() {
processManager: processManager,
logger: logger,
terminal: terminal,
experiments: <String>[],
);
int errorCount = 0;
......@@ -171,42 +168,6 @@ void main() {
expect(errorCount, 0);
});
testWithoutContext('Can forward null-safety experiments to the AnalysisServer', () async {
final Completer<void> completer = Completer<void>();
final StreamController<List<int>> stdin = StreamController<List<int>>();
const String fakeSdkPath = 'dart-sdk';
final FakeCommand fakeCommand = FakeCommand(
command: const <String>[
'dart-sdk/bin/dart',
'--disable-dart-dev',
'dart-sdk/bin/snapshots/analysis_server.dart.snapshot',
'--enable-experiment',
'non-nullable',
'--disable-server-feature-completion',
'--disable-server-feature-search',
'--sdk',
'dart-sdk',
],
completer: completer,
stdin: IOSink(stdin.sink),
);
server = AnalysisServer(fakeSdkPath, <String>[''],
fileSystem: MemoryFileSystem.test(),
platform: FakePlatform(),
processManager: FakeProcessManager.list(<FakeCommand>[
fakeCommand,
]),
logger: BufferLogger.test(),
terminal: Terminal.test(),
experiments: <String>[
'non-nullable'
],
);
await server.start();
});
testUsingContext('Can run AnalysisService with customized cache location', () async {
final Completer<void> completer = Completer<void>();
final StreamController<List<int>> stdin = StreamController<List<int>>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment