Unverified Commit e3106497 authored by Konstantin Scheglov's avatar Konstantin Scheglov Committed by GitHub

Add '--protocol-traffic-log' option to 'analyze' command. (#78674)

parent fd1ccd53
......@@ -55,6 +55,11 @@ class AnalyzeCommand extends FlutterCommand {
valueHelp: 'path-to-sdk',
help: 'The path to the Dart SDK.',
hide: !verboseHelp);
argParser.addOption('protocol-traffic-log',
valueHelp: 'path-to-protocol-traffic-log',
help: 'The path to write the request and response protocol. This is '
'only intended to be used for debugging the tooling.',
hide: !verboseHelp);
// Hidden option to enable a benchmarking mode.
argParser.addFlag('benchmark',
......
......@@ -86,6 +86,7 @@ abstract class AnalyzeBase {
String get sdkPath => argResults['dart-sdk'] as String ?? artifacts.getArtifactPath(Artifact.engineDartSdkPath);
bool get isBenchmarking => argResults['benchmark'] as bool;
bool get isDartDocs => argResults['dartdocs'] as bool;
String get protocolTrafficLog => argResults['protocol-traffic-log'] as String;
static int countMissingDartDocs(List<AnalysisError> errors) {
return errors.where((AnalysisError error) {
......
......@@ -77,6 +77,7 @@ class AnalyzeContinuously extends AnalyzeBase {
platform: platform,
processManager: processManager,
terminal: terminal,
protocolTrafficLog: protocolTrafficLog,
);
server.onAnalyzing.listen((bool isAnalyzing) => _handleAnalysisStatus(server, isAnalyzing));
server.onErrors.listen(_handleAnalysisErrors);
......
......@@ -95,6 +95,7 @@ class AnalyzeOnce extends AnalyzeBase {
logger: logger,
processManager: processManager,
terminal: terminal,
protocolTrafficLog: protocolTrafficLog,
);
Stopwatch timer;
......
......@@ -29,11 +29,13 @@ class AnalysisServer {
@required Logger logger,
@required Platform platform,
@required Terminal terminal,
String protocolTrafficLog,
}) : _fileSystem = fileSystem,
_processManager = processManager,
_logger = logger,
_platform = platform,
_terminal = terminal;
_terminal = terminal,
_protocolTrafficLog = protocolTrafficLog;
final String sdkPath;
final List<String> directories;
......@@ -42,6 +44,7 @@ class AnalysisServer {
final Logger _logger;
final Platform _platform;
final Terminal _terminal;
final String _protocolTrafficLog;
Process _process;
final StreamController<bool> _analyzingController =
......@@ -67,6 +70,8 @@ class AnalysisServer {
'--disable-server-feature-search',
'--sdk',
sdkPath,
if (_protocolTrafficLog != null)
'--protocol-traffic-log=$_protocolTrafficLog',
];
_logger.printTrace('dart ${command.skip(1).join(' ')}');
......
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