Unverified Commit 3b7942c4 authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Fix multi-step build handling process. (#24310)

* Fix multi-step build handling process.

Stop listening for new step updates after 'all done.' log message. Make sure that we don't delete file too soon, until listener had a chance to process the 'all done' message.

Fixes https://github.com/flutter/flutter/issues/18750

* Emit 'all output' explicitly when build process is done.
parent 29d5210d
......@@ -443,18 +443,23 @@ Future<XcodeBuildResult> buildXcodeProject({
Status initialBuildStatus;
Directory tempDir;
File scriptOutputPipeFile;
if (logger.hasTerminal) {
tempDir = fs.systemTempDirectory.createTempSync('flutter_build_log_pipe.');
final File scriptOutputPipeFile = tempDir.childFile('pipe_to_stdout');
scriptOutputPipeFile = tempDir.childFile('pipe_to_stdout');
os.makePipe(scriptOutputPipeFile.path);
Future<void> listenToScriptOutputLine() async {
final List<String> lines = await scriptOutputPipeFile.readAsLines();
for (String line in lines) {
if (line == 'done') {
if (line == 'done' || line == 'all done') {
buildSubStatus?.stop();
buildSubStatus = null;
if (line == 'all done') {
// Free pipe file.
tempDir?.deleteSync(recursive: true);
return null;
}
} else {
initialBuildStatus.cancel();
buildSubStatus = logger.startProgress(
......@@ -480,11 +485,11 @@ Future<XcodeBuildResult> buildXcodeProject({
workingDirectory: app.project.hostAppRoot.path,
allowReentrantFlutter: true
);
// Notifies listener that no more output is coming.
scriptOutputPipeFile?.writeAsStringSync('all done');
buildSubStatus?.stop();
initialBuildStatus?.cancel();
buildStopwatch.stop();
// Free pipe file.
tempDir?.deleteSync(recursive: true);
printStatus(
'Xcode build done.'.padRight(kDefaultStatusPadding + 1)
+ '${getElapsedAsSeconds(buildStopwatch.elapsed).padLeft(5)}',
......
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