Commit 8127ebe2 authored by Daniel Teske's avatar Daniel Teske
Browse files

Android: Show complete output of ant run



Change-Id: I4964e5bf22a715375a7fa080604d16692c956fc2
Reviewed-by: default avatarBogDan Vatra <bogdan@kde.org>
parent 8011d0c3
...@@ -818,6 +818,10 @@ bool AndroidPackageCreationStep::runCommand(QProcess *buildProc ...@@ -818,6 +818,10 @@ bool AndroidPackageCreationStep::runCommand(QProcess *buildProc
return false; return false;
} }
buildProc->waitForFinished(-1); buildProc->waitForFinished(-1);
handleProcessOutput(buildProc, false);
handleProcessOutput(buildProc, true);
if (buildProc->error() != QProcess::UnknownError if (buildProc->error() != QProcess::UnknownError
|| buildProc->exitCode() != 0) { || buildProc->exitCode() != 0) {
QString mainMessage = tr("Packaging Error: Command '%1 %2' failed.") QString mainMessage = tr("Packaging Error: Command '%1 %2' failed.")
...@@ -837,13 +841,7 @@ void AndroidPackageCreationStep::handleBuildStdOutOutput() ...@@ -837,13 +841,7 @@ void AndroidPackageCreationStep::handleBuildStdOutOutput()
QProcess *const process = qobject_cast<QProcess *>(sender()); QProcess *const process = qobject_cast<QProcess *>(sender());
if (!process) if (!process)
return; return;
handleProcessOutput(process, false);
process->setReadChannel(QProcess::StandardOutput);
while (process->canReadLine()) {
QString line = QString::fromLocal8Bit(process->readLine());
m_outputParser.stdOutput(line);
emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline);
}
} }
void AndroidPackageCreationStep::handleBuildStdErrOutput() void AndroidPackageCreationStep::handleBuildStdErrOutput()
...@@ -852,11 +850,21 @@ void AndroidPackageCreationStep::handleBuildStdErrOutput() ...@@ -852,11 +850,21 @@ void AndroidPackageCreationStep::handleBuildStdErrOutput()
if (!process) if (!process)
return; return;
process->setReadChannel(QProcess::StandardError); handleProcessOutput(process, true);
}
void AndroidPackageCreationStep::handleProcessOutput(QProcess *process, bool stdErr)
{
process->setReadChannel(stdErr ? QProcess::StandardError : QProcess::StandardOutput);
while (process->canReadLine()) { while (process->canReadLine()) {
QString line = QString::fromLocal8Bit(process->readLine()); QString line = QString::fromLocal8Bit(process->readLine());
m_outputParser.stdError(line); if (stdErr)
emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline); m_outputParser.stdError(line);
else
m_outputParser.stdOutput(line);
emit addOutput(line, stdErr ? BuildStep::ErrorOutput
: BuildStep::NormalOutput,
BuildStep::DontAppendNewline);
} }
} }
......
...@@ -113,6 +113,7 @@ private: ...@@ -113,6 +113,7 @@ private:
static const Core::Id CreatePackageId; static const Core::Id CreatePackageId;
private: private:
void handleProcessOutput(QProcess *process, bool stdErr);
Utils::FileName m_keystorePath; Utils::FileName m_keystorePath;
QString m_keystorePasswd; QString m_keystorePasswd;
QString m_certificateAlias; QString m_certificateAlias;
......
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