forked from qt-creator/qt-creator
QmlDesigner: create error output file for puppet builds
Change-Id: I140820702d11e5bc20e6063bdee13411a5f2eeaa Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
6eec39c308
commit
045d1496b5
@@ -67,6 +67,12 @@ bool PuppetBuildProgressDialog::useFallbackPuppet() const
|
|||||||
return m_useFallbackPuppet;
|
return m_useFallbackPuppet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PuppetBuildProgressDialog::setErrorOutputFile(const QString &filePath)
|
||||||
|
{
|
||||||
|
ui->openErrorOutputFileLabel->setText(QString::fromLatin1("<a href='file:///%1'>%2</a>").arg(
|
||||||
|
filePath, ui->openErrorOutputFileLabel->text()));
|
||||||
|
}
|
||||||
|
|
||||||
void PuppetBuildProgressDialog::setUseFallbackPuppet()
|
void PuppetBuildProgressDialog::setUseFallbackPuppet()
|
||||||
{
|
{
|
||||||
m_useFallbackPuppet = true;
|
m_useFallbackPuppet = true;
|
||||||
|
@@ -51,6 +51,7 @@ public:
|
|||||||
void setProgress(int progress);
|
void setProgress(int progress);
|
||||||
void newBuildOutput(const QByteArray &standardOutput);
|
void newBuildOutput(const QByteArray &standardOutput);
|
||||||
bool useFallbackPuppet() const;
|
bool useFallbackPuppet() const;
|
||||||
|
void setErrorOutputFile(const QString &filePath);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void setUseFallbackPuppet();
|
void setUseFallbackPuppet();
|
||||||
|
@@ -391,21 +391,31 @@ bool PuppetCreator::startBuildProcess(const QString &buildDirectoryPath,
|
|||||||
if (command.isEmpty())
|
if (command.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
const QString errorOutputFilePath(buildDirectoryPath + QLatin1String("/build_error_output.txt"));
|
||||||
|
if (QFile::exists(errorOutputFilePath))
|
||||||
|
QFile(errorOutputFilePath).remove();
|
||||||
|
progressDialog->setErrorOutputFile(errorOutputFilePath);
|
||||||
|
|
||||||
QProcess process;
|
QProcess process;
|
||||||
|
process.setStandardErrorFile(errorOutputFilePath);
|
||||||
process.setProcessChannelMode(QProcess::SeparateChannels);
|
process.setProcessChannelMode(QProcess::SeparateChannels);
|
||||||
process.setProcessEnvironment(processEnvironment());
|
process.setProcessEnvironment(processEnvironment());
|
||||||
process.setWorkingDirectory(buildDirectoryPath);
|
process.setWorkingDirectory(buildDirectoryPath);
|
||||||
process.start(command, processArguments);
|
process.start(command, processArguments);
|
||||||
process.waitForStarted();
|
process.waitForStarted();
|
||||||
while (process.waitForReadyRead(-1)) {
|
while (process.waitForReadyRead(100) || process.state() == QProcess::Running) {
|
||||||
if (progressDialog->useFallbackPuppet())
|
if (progressDialog->useFallbackPuppet())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QByteArray newOutput = process.readAllStandardOutput();
|
QApplication::processEvents(QEventLoop::ExcludeSocketNotifiers);
|
||||||
if (progressDialog)
|
|
||||||
progressDialog->newBuildOutput(newOutput);
|
|
||||||
|
|
||||||
m_compileLog.append(newOutput);
|
QByteArray newOutput = process.readAllStandardOutput();
|
||||||
|
if (!newOutput.isEmpty()) {
|
||||||
|
if (progressDialog)
|
||||||
|
progressDialog->newBuildOutput(newOutput);
|
||||||
|
|
||||||
|
m_compileLog.append(QString::fromLatin1(newOutput));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
process.waitForFinished();
|
process.waitForFinished();
|
||||||
|
Reference in New Issue
Block a user