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