forked from qt-creator/qt-creator
		
	Merge remote-tracking branch 'origin/2.7' into 2.8
Conflicts: src/plugins/qmlprofiler/qmlprofilerengine.cpp Change-Id: Ic9dc22d2d4a7306cfc4ef0ec158993e3768a9853
This commit is contained in:
		@@ -169,6 +169,7 @@ bool AndroidPackageCreationStep::init()
 | 
			
		||||
    m_certificatePasswdForRun = m_certificatePasswd;
 | 
			
		||||
    m_jarSigner = AndroidConfigurations::instance().jarsignerPath();
 | 
			
		||||
    m_zipAligner = AndroidConfigurations::instance().zipalignPath();
 | 
			
		||||
    m_environment = bc->environment();
 | 
			
		||||
 | 
			
		||||
    ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
 | 
			
		||||
    if (tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE))
 | 
			
		||||
@@ -686,6 +687,7 @@ bool AndroidPackageCreationStep::createPackage()
 | 
			
		||||
    emit addOutput(tr("Creating package file ..."), MessageOutput);
 | 
			
		||||
 | 
			
		||||
    QProcess *const buildProc = new QProcess;
 | 
			
		||||
    buildProc->setProcessEnvironment(m_environment.toProcessEnvironment());
 | 
			
		||||
 | 
			
		||||
    connect(buildProc, SIGNAL(readyReadStandardOutput()), this,
 | 
			
		||||
        SLOT(handleBuildStdOutOutput()));
 | 
			
		||||
@@ -802,6 +804,10 @@ bool AndroidPackageCreationStep::runCommand(QProcess *buildProc
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    buildProc->waitForFinished(-1);
 | 
			
		||||
 | 
			
		||||
    handleProcessOutput(buildProc, false);
 | 
			
		||||
    handleProcessOutput(buildProc, true);
 | 
			
		||||
 | 
			
		||||
    if (buildProc->error() != QProcess::UnknownError
 | 
			
		||||
        || buildProc->exitCode() != 0) {
 | 
			
		||||
        QString mainMessage = tr("Packaging Error: Command '%1 %2' failed.")
 | 
			
		||||
@@ -821,13 +827,7 @@ void AndroidPackageCreationStep::handleBuildStdOutOutput()
 | 
			
		||||
    QProcess *const process = qobject_cast<QProcess *>(sender());
 | 
			
		||||
    if (!process)
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    process->setReadChannel(QProcess::StandardOutput);
 | 
			
		||||
    while (process->canReadLine()) {
 | 
			
		||||
        QString line = QString::fromLocal8Bit(process->readLine());
 | 
			
		||||
        m_outputParser.stdOutput(line);
 | 
			
		||||
        emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline);
 | 
			
		||||
    }
 | 
			
		||||
    handleProcessOutput(process, false);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AndroidPackageCreationStep::handleBuildStdErrOutput()
 | 
			
		||||
@@ -836,11 +836,21 @@ void AndroidPackageCreationStep::handleBuildStdErrOutput()
 | 
			
		||||
    if (!process)
 | 
			
		||||
        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()) {
 | 
			
		||||
        QString line = QString::fromLocal8Bit(process->readLine());
 | 
			
		||||
        m_outputParser.stdError(line);
 | 
			
		||||
        emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline);
 | 
			
		||||
        if (stdErr)
 | 
			
		||||
            m_outputParser.stdError(line);
 | 
			
		||||
        else
 | 
			
		||||
            m_outputParser.stdOutput(line);
 | 
			
		||||
        emit addOutput(line, stdErr ? BuildStep::ErrorOutput
 | 
			
		||||
                                    : BuildStep::NormalOutput,
 | 
			
		||||
                       BuildStep::DontAppendNewline);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user