diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-01-12 10:59:12 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-01-19 16:08:57 +0000 |
commit | c05a3fdb3de59a3b9bd91dafee20453d5a138cfc (patch) | |
tree | 7d0e56d73efc477b5cfa195781f7971c4410219e /src | |
parent | 0e874ba59935cfaba1c4c0e12a423064814ddaa4 (diff) |
Give the values of BuildStep::OutputFormat better names
The old ones did not convey their meaning very well. In particular,
NormalOutput and MessageOutput were easily confused.
Change-Id: Ia0a8c1b1c366ab3f5c59f751b37b8b1f68f6831d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src')
26 files changed, 100 insertions, 94 deletions
diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index e039ba0de1..423774c7e9 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -133,7 +133,7 @@ bool AndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps) if (bc->buildType() != ProjectExplorer::BuildConfiguration::Release) emit addOutput(tr("Warning: Signing a debug or profile package."), - BuildStep::ErrorMessageOutput); + OutputFormat::ErrorMessage); } QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit()); @@ -143,7 +143,7 @@ bool AndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps) int minSDKForKit = AndroidManager::minimumSDK(target()->kit()); if (AndroidManager::minimumSDK(target()) < minSDKForKit) { emit addOutput(tr("The API level set for the APK is less than the minimum required by the kit." - "\nThe minimum API level required by the kit is %1.").arg(minSDKForKit), ErrorOutput); + "\nThe minimum API level required by the kit is %1.").arg(minSDKForKit), OutputFormat::Stderr); return false; } diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index f76d50708d..5212b13192 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -143,18 +143,18 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps) m_androiddeployqtArgs.clear(); if (AndroidManager::checkForQt51Files(project()->projectDirectory())) - emit addOutput(tr("Found old folder \"android\" in source directory. Qt 5.2 does not use that folder by default."), ErrorOutput); + emit addOutput(tr("Found old folder \"android\" in source directory. Qt 5.2 does not use that folder by default."), OutputFormat::Stderr); m_targetArch = AndroidManager::targetArch(target()); if (m_targetArch.isEmpty()) { - emit addOutput(tr("No Android arch set by the .pro file."), ErrorOutput); + emit addOutput(tr("No Android arch set by the .pro file."), OutputFormat::Stderr); return false; } AndroidBuildApkStep *androidBuildApkStep = AndroidGlobal::buildStep<AndroidBuildApkStep>(target()->activeBuildConfiguration()); if (!androidBuildApkStep) { - emit addOutput(tr("Cannot find the android build step."), ErrorOutput); + emit addOutput(tr("Cannot find the android build step."), OutputFormat::Stderr); return false; } @@ -206,7 +206,7 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps) if (m_useAndroiddeployqt) { Utils::FileName tmp = AndroidManager::androidQtSupport(target())->androiddeployqtPath(target()); if (tmp.isEmpty()) { - emit addOutput(tr("Cannot find the androiddeployqt tool."), ErrorOutput); + emit addOutput(tr("Cannot find the androiddeployqt tool."), OutputFormat::Stderr); return false; } @@ -220,7 +220,7 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps) Utils::QtcProcess::addArg(&m_androiddeployqtArgs, QLatin1String("--input")); tmp = AndroidManager::androidQtSupport(target())->androiddeployJsonPath(target()); if (tmp.isEmpty()) { - emit addOutput(tr("Cannot find the androiddeploy Json file."), ErrorOutput); + emit addOutput(tr("Cannot find the androiddeploy Json file."), OutputFormat::Stderr); return false; } Utils::QtcProcess::addArg(&m_androiddeployqtArgs, tmp.toString()); @@ -284,11 +284,11 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy(QFutureInter if (m_uninstallPreviousPackageRun) { const QString packageName = AndroidManager::packageName(m_manifestName); if (packageName.isEmpty()) { - emit addOutput(tr("Cannot find the package name."), ErrorOutput); + emit addOutput(tr("Cannot find the package name."), OutputFormat::Stderr); return Failure; } - emit addOutput(tr("Uninstall previous package %1.").arg(packageName), MessageOutput); + emit addOutput(tr("Uninstall previous package %1.").arg(packageName), OutputFormat::NormalMessage); runCommand(m_adbPath, AndroidDeviceInfo::adbSelector(m_serialNumber) << QLatin1String("uninstall") << packageName); @@ -320,7 +320,7 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy(QFutureInter emit addOutput(tr("Starting: \"%1\" %2") .arg(QDir::toNativeSeparators(m_command), args), - BuildStep::MessageOutput); + BuildStep::OutputFormat::NormalMessage); while (!m_process->waitForFinished(200)) { if (m_process->state() == QProcess::NotRunning) @@ -351,13 +351,13 @@ AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::runDeploy(QFutureInter if (exitStatus == QProcess::NormalExit && exitCode == 0) { emit addOutput(tr("The process \"%1\" exited normally.").arg(m_command), - BuildStep::MessageOutput); + BuildStep::OutputFormat::NormalMessage); } else if (exitStatus == QProcess::NormalExit) { emit addOutput(tr("The process \"%1\" exited with code %2.") .arg(m_command, QString::number(exitCode)), - BuildStep::ErrorMessageOutput); + BuildStep::OutputFormat::ErrorMessage); } else { - emit addOutput(tr("The process \"%1\" crashed.").arg(m_command), BuildStep::ErrorMessageOutput); + emit addOutput(tr("The process \"%1\" crashed.").arg(m_command), BuildStep::OutputFormat::ErrorMessage); } if (exitCode == 0 && exitStatus == QProcess::NormalExit) { @@ -428,7 +428,7 @@ void AndroidDeployQtStep::run(QFutureInterface<bool> &fi) } } - emit addOutput(tr("Pulling files necessary for debugging."), MessageOutput); + emit addOutput(tr("Pulling files necessary for debugging."), OutputFormat::NormalMessage); QString localAppProcessFile = QString::fromLatin1("%1/app_process").arg(m_buildDirectory); QFile::remove(localAppProcessFile); @@ -446,7 +446,7 @@ void AndroidDeployQtStep::run(QFutureInterface<bool> &fi) returnValue = Failure; emit addOutput(tr("Package deploy: Failed to pull \"%1\" to \"%2\".") .arg(m_appProcessBinaries.join(QLatin1String("\", \""))) - .arg(localAppProcessFile), ErrorMessageOutput); + .arg(localAppProcessFile), OutputFormat::ErrorMessage); } runCommand(m_adbPath, @@ -461,10 +461,10 @@ void AndroidDeployQtStep::runCommand(const QString &program, const QStringList & { Utils::SynchronousProcess buildProc; buildProc.setTimeoutS(2 * 60); - emit addOutput(tr("Package deploy: Running command \"%1 %2\".").arg(program).arg(arguments.join(QLatin1Char(' '))), BuildStep::MessageOutput); + emit addOutput(tr("Package deploy: Running command \"%1 %2\".").arg(program).arg(arguments.join(QLatin1Char(' '))), BuildStep::OutputFormat::NormalMessage); Utils::SynchronousProcessResponse response = buildProc.run(program, arguments); if (response.result != Utils::SynchronousProcessResponse::Finished || response.exitCode != 0) - emit addOutput(response.exitMessage(program, 2 * 60), BuildStep::ErrorMessageOutput); + emit addOutput(response.exitMessage(program, 2 * 60), BuildStep::OutputFormat::ErrorMessage); } AndroidDeviceInfo AndroidDeployQtStep::deviceInfo() const @@ -489,7 +489,7 @@ void AndroidDeployQtStep::processReadyReadStdOutput(DeployErrorCode &errorCode) void AndroidDeployQtStep::stdOutput(const QString &line) { - emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline); + emit addOutput(line, BuildStep::OutputFormat::Stdout, BuildStep::DontAppendNewline); } void AndroidDeployQtStep::processReadyReadStdError(DeployErrorCode &errorCode) @@ -504,7 +504,7 @@ void AndroidDeployQtStep::processReadyReadStdError(DeployErrorCode &errorCode) void AndroidDeployQtStep::stdError(const QString &line) { - emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline); + emit addOutput(line, BuildStep::OutputFormat::Stderr, BuildStep::DontAppendNewline); } AndroidDeployQtStep::DeployErrorCode AndroidDeployQtStep::parseDeployErrors(QString &deployOutputLine) const diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.cpp b/src/plugins/autotoolsprojectmanager/autogenstep.cpp index 99bce38854..d41440c91a 100644 --- a/src/plugins/autotoolsprojectmanager/autogenstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autogenstep.cpp @@ -134,7 +134,7 @@ void AutogenStep::run(QFutureInterface<bool> &fi) } if (!m_runAutogen) { - emit addOutput(tr("Configuration unchanged, skipping autogen step."), BuildStep::MessageOutput); + emit addOutput(tr("Configuration unchanged, skipping autogen step."), BuildStep::OutputFormat::NormalMessage); reportRunResult(fi, true); return; } diff --git a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp index 88aea423f0..099e9aa1ab 100644 --- a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp @@ -129,7 +129,7 @@ void AutoreconfStep::run(QFutureInterface<bool> &fi) m_runAutoreconf = true; if (!m_runAutoreconf) { - emit addOutput(tr("Configuration unchanged, skipping autoreconf step."), BuildStep::MessageOutput); + emit addOutput(tr("Configuration unchanged, skipping autoreconf step."), BuildStep::OutputFormat::NormalMessage); reportRunResult(fi, true); return; } diff --git a/src/plugins/autotoolsprojectmanager/configurestep.cpp b/src/plugins/autotoolsprojectmanager/configurestep.cpp index f226ecdaf6..cf1739b6e0 100644 --- a/src/plugins/autotoolsprojectmanager/configurestep.cpp +++ b/src/plugins/autotoolsprojectmanager/configurestep.cpp @@ -147,7 +147,7 @@ void ConfigureStep::run(QFutureInterface<bool>& fi) } if (!m_runConfigure) { - emit addOutput(tr("Configuration unchanged, skipping configure step."), BuildStep::MessageOutput); + emit addOutput(tr("Configuration unchanged, skipping configure step."), BuildStep::OutputFormat::NormalMessage); reportRunResult(fi, true); return; } diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 940789a0a7..6d8dc80282 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -237,10 +237,10 @@ void CMakeBuildStep::run(QFutureInterface<bool> &fi) bool mustDelay = false; if (bc->persistCMakeState()) { - emit addOutput(tr("Persisting CMake state..."), BuildStep::MessageOutput); + emit addOutput(tr("Persisting CMake state..."), BuildStep::OutputFormat::NormalMessage); mustDelay = true; } else if (bc->updateCMakeStateBeforeBuild()) { - emit addOutput(tr("Running CMake in preparation to build..."), BuildStep::MessageOutput); + emit addOutput(tr("Running CMake in preparation to build..."), BuildStep::OutputFormat::NormalMessage); mustDelay = true; } else { mustDelay = false; diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index 420b7bf9ae..2fd786d68e 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -108,7 +108,7 @@ bool IosDeployStep::init(QList<const BuildStep *> &earlierSteps) m_deviceType = runConfig->deviceType(); } else { emit addOutput(tr("Error: no device available, deploy failed."), - BuildStep::ErrorMessageOutput); + BuildStep::OutputFormat::ErrorMessage); return false; } return true; @@ -210,7 +210,7 @@ void IosDeployStep::handleErrorMsg(IosToolHandler *handler, const QString &msg) TaskHub::addTask(Task::Warning, tr("The Info.plist might be incorrect."), ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); - emit addOutput(msg, BuildStep::ErrorMessageOutput); + emit addOutput(msg, BuildStep::OutputFormat::ErrorMessage); } BuildStepConfigWidget *IosDeployStep::createConfigWidget() diff --git a/src/plugins/ios/iosdeploystep.h b/src/plugins/ios/iosdeploystep.h index 2dc7916dea..068df59c49 100644 --- a/src/plugins/ios/iosdeploystep.h +++ b/src/plugins/ios/iosdeploystep.h @@ -93,7 +93,7 @@ private: QString deviceId() const; QString appBundle() const; void raiseError(const QString &error); - void writeOutput(const QString &text, OutputFormat = MessageOutput); + void writeOutput(const QString &text, OutputFormat = OutputFormat::NormalMessage); void checkProvisioningProfile(); TransferStatus m_transferStatus; diff --git a/src/plugins/nim/project/nimcompilercleanstep.cpp b/src/plugins/nim/project/nimcompilercleanstep.cpp index dd0329765a..57be7cb0f5 100644 --- a/src/plugins/nim/project/nimcompilercleanstep.cpp +++ b/src/plugins/nim/project/nimcompilercleanstep.cpp @@ -63,24 +63,24 @@ bool NimCompilerCleanStep::init(QList<const BuildStep *> &) void NimCompilerCleanStep::run(QFutureInterface<bool> &fi) { if (!m_buildDir.exists()) { - emit addOutput(tr("Build directory \"%1\" does not exist.").arg(m_buildDir.toUserOutput()), BuildStep::ErrorMessageOutput); + emit addOutput(tr("Build directory \"%1\" does not exist.").arg(m_buildDir.toUserOutput()), BuildStep::OutputFormat::ErrorMessage); reportRunResult(fi, false); return; } if (!removeCacheDirectory()) { - emit addOutput(tr("Failed to delete the cache directory."), BuildStep::ErrorMessageOutput); + emit addOutput(tr("Failed to delete the cache directory."), BuildStep::OutputFormat::ErrorMessage); reportRunResult(fi, false); return; } if (!removeOutFilePath()) { - emit addOutput(tr("Failed to delete the out file."), BuildStep::ErrorMessageOutput); + emit addOutput(tr("Failed to delete the out file."), BuildStep::OutputFormat::ErrorMessage); reportRunResult(fi, false); return; } - emit addOutput(tr("Clean step completed successfully."), BuildStep::MessageOutput); + emit addOutput(tr("Clean step completed successfully."), BuildStep::OutputFormat::NormalMessage); reportRunResult(fi, true); } diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index adf23706ff..9a1c42553b 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -130,7 +130,7 @@ IOutputParser *AbstractProcessStep::outputParser() const void AbstractProcessStep::emitFaultyConfigurationMessage() { emit addOutput(tr("Configuration is faulty. Check the Issues view for details."), - BuildStep::MessageOutput); + BuildStep::OutputFormat::NormalMessage); } bool AbstractProcessStep::ignoreReturnValue() @@ -173,7 +173,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi) if (!wd.mkpath(wd.absolutePath())) { emit addOutput(tr("Could not create directory \"%1\"") .arg(QDir::toNativeSeparators(wd.absolutePath())), - BuildStep::ErrorMessageOutput); + BuildStep::OutputFormat::ErrorMessage); reportRunResult(fi, false); return; } @@ -238,7 +238,7 @@ void AbstractProcessStep::processStarted() emit addOutput(tr("Starting: \"%1\" %2") .arg(QDir::toNativeSeparators(m_param.effectiveCommand()), m_param.prettyArguments()), - BuildStep::MessageOutput); + BuildStep::OutputFormat::NormalMessage); } /*! @@ -255,13 +255,13 @@ void AbstractProcessStep::processFinished(int exitCode, QProcess::ExitStatus sta QString command = QDir::toNativeSeparators(m_param.effectiveCommand()); if (status == QProcess::NormalExit && exitCode == 0) { emit addOutput(tr("The process \"%1\" exited normally.").arg(command), - BuildStep::MessageOutput); + BuildStep::OutputFormat::NormalMessage); } else if (status == QProcess::NormalExit) { emit addOutput(tr("The process \"%1\" exited with code %2.") .arg(command, QString::number(m_process->exitCode())), - BuildStep::ErrorMessageOutput); + BuildStep::OutputFormat::ErrorMessage); } else { - emit addOutput(tr("The process \"%1\" crashed.").arg(command), BuildStep::ErrorMessageOutput); + emit addOutput(tr("The process \"%1\" crashed.").arg(command), BuildStep::OutputFormat::ErrorMessage); } } @@ -276,7 +276,7 @@ void AbstractProcessStep::processStartupFailed() emit addOutput(tr("Could not start process \"%1\" %2") .arg(QDir::toNativeSeparators(m_param.effectiveCommand()), m_param.prettyArguments()), - BuildStep::ErrorMessageOutput); + BuildStep::OutputFormat::ErrorMessage); m_timer.stop(); } @@ -313,7 +313,7 @@ void AbstractProcessStep::stdOutput(const QString &line) { if (m_outputParserChain) m_outputParserChain->stdOutput(line); - emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline); + emit addOutput(line, BuildStep::OutputFormat::Stdout, BuildStep::DontAppendNewline); } void AbstractProcessStep::processReadyReadStdError() @@ -337,7 +337,7 @@ void AbstractProcessStep::stdError(const QString &line) { if (m_outputParserChain) m_outputParserChain->stdError(line); - emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline); + emit addOutput(line, BuildStep::OutputFormat::Stderr, BuildStep::DontAppendNewline); } QFutureInterface<bool> *AbstractProcessStep::futureInterface() const diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp index 89c88c43fe..43d3b9469b 100644 --- a/src/plugins/projectexplorer/buildmanager.cpp +++ b/src/plugins/projectexplorer/buildmanager.cpp @@ -225,14 +225,14 @@ void BuildManager::finish() QString time = format.toString(QLatin1String("h:mm:ss")); if (time.startsWith(QLatin1String("0:"))) time.remove(0, 2); // Don't display zero hours - m_instance->addToOutputWindow(tr("Elapsed time: %1.") .arg(time), BuildStep::MessageOutput); + m_instance->addToOutputWindow(tr("Elapsed time: %1.") .arg(time), BuildStep::OutputFormat::NormalMessage); QApplication::alert(ICore::mainWindow(), 3000); } void BuildManager::emitCancelMessage() { - m_instance->addToOutputWindow(tr("Canceled build/deployment."), BuildStep::ErrorMessageOutput); + m_instance->addToOutputWindow(tr("Canceled build/deployment."), BuildStep::OutputFormat::ErrorMessage); } void BuildManager::clearBuildQueue() @@ -338,7 +338,7 @@ void BuildManager::addToOutputWindow(const QString &string, BuildStep::OutputFor BuildStep::OutputNewlineSetting newlineSettings) { QString stringToWrite; - if (format == BuildStep::MessageOutput || format == BuildStep::ErrorMessageOutput) { + if (format == BuildStep::OutputFormat::NormalMessage || format == BuildStep::OutputFormat::ErrorMessage) { stringToWrite = QTime::currentTime().toString(); stringToWrite += QLatin1String(": "); } @@ -381,13 +381,13 @@ void BuildManager::nextBuildQueue() Target *t = d->m_currentBuildStep->target(); const QString projectName = d->m_currentBuildStep->project()->displayName(); const QString targetName = t->displayName(); - addToOutputWindow(tr("Error while building/deploying project %1 (kit: %2)").arg(projectName, targetName), BuildStep::ErrorOutput); + addToOutputWindow(tr("Error while building/deploying project %1 (kit: %2)").arg(projectName, targetName), BuildStep::OutputFormat::Stderr); const QList<Task> kitTasks = t->kit()->validate(); if (!kitTasks.isEmpty()) { addToOutputWindow(tr("The kit %1 has configuration issues which might be the root cause for this problem.") - .arg(targetName), BuildStep::ErrorOutput); + .arg(targetName), BuildStep::OutputFormat::Stderr); } - addToOutputWindow(tr("When executing step \"%1\"").arg(d->m_currentBuildStep->displayName()), BuildStep::ErrorOutput); + addToOutputWindow(tr("When executing step \"%1\"").arg(d->m_currentBuildStep->displayName()), BuildStep::OutputFormat::Stderr); // NBS TODO fix in qtconcurrent d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, tr("Error while building/deploying project %1 (kit: %2)").arg(projectName, targetName)); @@ -432,13 +432,13 @@ void BuildManager::nextStep() if (d->m_currentBuildStep->project() != d->m_previousBuildStepProject) { const QString projectName = d->m_currentBuildStep->project()->displayName(); addToOutputWindow(tr("Running steps for project %1...") - .arg(projectName), BuildStep::MessageOutput); + .arg(projectName), BuildStep::OutputFormat::NormalMessage); d->m_previousBuildStepProject = d->m_currentBuildStep->project(); } if (d->m_skipDisabled) { addToOutputWindow(tr("Skipping disabled step %1.") - .arg(d->m_currentBuildStep->displayName()), BuildStep::MessageOutput); + .arg(d->m_currentBuildStep->displayName()), BuildStep::OutputFormat::NormalMessage); nextBuildQueue(); return; } @@ -471,7 +471,7 @@ bool BuildManager::buildQueueAppend(QList<BuildStep *> steps, QStringList names, TaskHub::clearTasks(Constants::TASK_CATEGORY_DEPLOYMENT); foreach (const QString &str, preambleMessage) - addToOutputWindow(str, BuildStep::MessageOutput, BuildStep::DontAppendNewline); + addToOutputWindow(str, BuildStep::OutputFormat::NormalMessage, BuildStep::DontAppendNewline); } QList<const BuildStep *> earlierSteps; @@ -496,8 +496,8 @@ bool BuildManager::buildQueueAppend(QList<BuildStep *> steps, QStringList names, // print something for the user const QString projectName = bs->project()->displayName(); const QString targetName = bs->target()->displayName(); - addToOutputWindow(tr("Error while building/deploying project %1 (kit: %2)").arg(projectName, targetName), BuildStep::ErrorOutput); - addToOutputWindow(tr("When executing step \"%1\"").arg(bs->displayName()), BuildStep::ErrorOutput); + addToOutputWindow(tr("Error while building/deploying project %1 (kit: %2)").arg(projectName, targetName), BuildStep::OutputFormat::Stderr); + addToOutputWindow(tr("When executing step \"%1\"").arg(bs->displayName()), BuildStep::OutputFormat::Stderr); // disconnect the buildsteps again for (int j = 0; j <= i; ++j) diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h index dc243a3bcb..c1c6949ede 100644 --- a/src/plugins/projectexplorer/buildstep.h +++ b/src/plugins/projectexplorer/buildstep.h @@ -72,7 +72,11 @@ public: Target *target() const; Project *project() const; - enum OutputFormat { NormalOutput, ErrorOutput, MessageOutput, ErrorMessageOutput }; + enum class OutputFormat { + Stdout, Stderr, // These are for forwarded output from external tools + NormalMessage, ErrorMessage // These are for messages from Creator itself + }; + enum OutputNewlineSetting { DoAppendNewline, DontAppendNewline }; static void reportRunResult(QFutureInterface<bool> &fi, bool success); diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index 31d22f0d15..72e5a9a26c 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -254,18 +254,18 @@ void CompileOutputWindow::appendText(const QString &text, BuildStep::OutputForma Theme *theme = Utils::creatorTheme(); QTextCharFormat textFormat; switch (format) { - case BuildStep::NormalOutput: + case BuildStep::OutputFormat::Stdout: textFormat.setForeground(theme->color(Theme::TextColorNormal)); textFormat.setFontWeight(QFont::Normal); break; - case BuildStep::ErrorOutput: + case BuildStep::OutputFormat::Stderr: textFormat.setForeground(theme->color(Theme::OutputPanes_ErrorMessageTextColor)); textFormat.setFontWeight(QFont::Normal); break; - case BuildStep::MessageOutput: + case BuildStep::OutputFormat::NormalMessage: textFormat.setForeground(theme->color(Theme::OutputPanes_MessageOutput)); break; - case BuildStep::ErrorMessageOutput: + case BuildStep::OutputFormat::ErrorMessage: textFormat.setForeground(theme->color(Theme::OutputPanes_ErrorMessageTextColor)); textFormat.setFontWeight(QFont::Bold); break; diff --git a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp index ef571502f2..a978543354 100644 --- a/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicecheckbuildstep.cpp @@ -55,7 +55,7 @@ bool DeviceCheckBuildStep::init(QList<const BuildStep *> &earlierSteps) Core::Id deviceTypeId = DeviceTypeKitInformation::deviceTypeId(target()->kit()); IDeviceFactory *factory = IDeviceFactory::find(deviceTypeId); if (!factory || !factory->canCreate()) { - emit addOutput(tr("No device configured."), BuildStep::ErrorMessageOutput); + emit addOutput(tr("No device configured."), BuildStep::OutputFormat::ErrorMessage); return false; } @@ -64,13 +64,13 @@ bool DeviceCheckBuildStep::init(QList<const BuildStep *> &earlierSteps) QMessageBox::Yes|QMessageBox::No); msgBox.setDefaultButton(QMessageBox::Yes); if (msgBox.exec() == QMessageBox::No) { - emit addOutput(tr("No device configured."), BuildStep::ErrorMessageOutput); + emit addOutput(tr("No device configured."), BuildStep::OutputFormat::ErrorMessage); return false; } IDevice::Ptr newDevice = factory->create(deviceTypeId); if (newDevice.isNull()) { - emit addOutput(tr("No device configured."), BuildStep::ErrorMessageOutput); + emit addOutput(tr("No device configured."), BuildStep::OutputFormat::ErrorMessage); return false; } diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp index 5c0b99aadc..4b84a080a9 100644 --- a/src/plugins/projectexplorer/outputparser_test.cpp +++ b/src/plugins/projectexplorer/outputparser_test.cpp @@ -118,7 +118,7 @@ void OutputParserTester::testOutputMangling(const QString &input, { reset(); - childParser()->outputAdded(input, BuildStep::NormalOutput); + childParser()->outputAdded(input, BuildStep::OutputFormat::Stdout); QCOMPARE(m_receivedOutput, output); QVERIFY(m_receivedStdErrChildLine.isNull()); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index 5517c3f8eb..5e1ffa775a 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -356,7 +356,7 @@ void QbsBuildStep::handleProgress(int value) void QbsBuildStep::handleCommandDescriptionReport(const QString &highlight, const QString &message) { Q_UNUSED(highlight); - emit addOutput(message, NormalOutput); + emit addOutput(message, OutputFormat::Stdout); } void QbsBuildStep::handleProcessResultReport(const qbs::ProcessResult &result) @@ -370,15 +370,15 @@ void QbsBuildStep::handleProcessResultReport(const qbs::ProcessResult &result) QString commandline = result.executableFilePath() + QLatin1Char(' ') + Utils::QtcProcess::joinArgs(result.arguments()); - addOutput(commandline, NormalOutput); + addOutput(commandline, OutputFormat::Stdout); foreach (const QString &line, result.stdErr()) { m_parser->stdError(line); - addOutput(line, ErrorOutput); + addOutput(line, OutputFormat::Stderr); } foreach (const QString &line, result.stdOut()) { m_parser->stdOutput(line); - addOutput(line, NormalOutput); + addOutput(line, OutputFormat::Stdout); } m_parser->flush(); } @@ -390,7 +390,7 @@ void QbsBuildStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, con Utils::FileName::fromString(file), line, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE); emit addTask(task, 1); - emit addOutput(message, NormalOutput); + emit addOutput(message, OutputFormat::Stdout); } QString QbsBuildStep::buildVariant() const @@ -480,7 +480,7 @@ void QbsBuildStep::build() QString error; m_job = qbsProject()->build(options, m_products, error); if (!m_job) { - emit addOutput(error, ErrorMessageOutput); + emit addOutput(error, OutputFormat::ErrorMessage); reportRunResult(*m_fi, false); return; } diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.cpp b/src/plugins/qbsprojectmanager/qbscleanstep.cpp index faaf2a04e4..02ae120956 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.cpp +++ b/src/plugins/qbsprojectmanager/qbscleanstep.cpp @@ -200,7 +200,7 @@ void QbsCleanStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, con Utils::FileName::fromString(file), line, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE); emit addTask(task, 1); - emit addOutput(message, NormalOutput); + emit addOutput(message, OutputFormat::Stdout); } void QbsCleanStep::setDryRun(bool dr) diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp index 14687dac63..87e16ead04 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp @@ -219,7 +219,7 @@ void QbsInstallStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, Utils::FileName::fromString(file), line, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE); emit addTask(task, 1); - emit addOutput(message, NormalOutput); + emit addOutput(message, OutputFormat::Stdout); } void QbsInstallStep::setInstallRoot(const QString &ir) diff --git a/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.cpp b/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.cpp index 9cc262c414..40e8b3942a 100644 --- a/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.cpp +++ b/src/plugins/qmakeandroidsupport/androidpackageinstallationstep.cpp @@ -103,9 +103,9 @@ void AndroidPackageInstallationStep::run(QFutureInterface<bool> &fi) foreach (const QString &dir, m_androidDirsToClean) { Utils::FileName androidDir = Utils::FileName::fromString(dir); if (!dir.isEmpty() && androidDir.exists()) { - emit addOutput(tr("Removing directory %1").arg(dir), MessageOutput); + emit addOutput(tr("Removing directory %1").arg(dir), OutputFormat::NormalMessage); if (!Utils::FileUtils::removeRecursively(androidDir, &error)) { - emit addOutput(error, ErrorOutput); + emit addOutput(error, OutputFormat::Stderr); reportRunResult(fi, false); return; } diff --git a/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkstep.cpp b/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkstep.cpp index fb0350ef98..ea90d04037 100644 --- a/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkstep.cpp +++ b/src/plugins/qmakeandroidsupport/qmakeandroidbuildapkstep.cpp @@ -119,7 +119,7 @@ Utils::FileName QmakeAndroidBuildApkStep::androidPackageSourceDir() const bool QmakeAndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps) { if (AndroidManager::checkForQt51Files(project()->projectDirectory())) - emit addOutput(tr("Found old folder \"android\" in source directory. Qt 5.2 does not use that folder by default."), ErrorOutput); + emit addOutput(tr("Found old folder \"android\" in source directory. Qt 5.2 does not use that folder by default."), OutputFormat::Stderr); if (!AndroidBuildApkStep::init(earlierSteps)) return false; @@ -221,7 +221,7 @@ bool QmakeAndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps) void QmakeAndroidBuildApkStep::run(QFutureInterface<bool> &fi) { if (m_skipBuilding) { - emit addOutput(tr("No application .pro file found, not building an APK."), BuildStep::ErrorMessageOutput); + emit addOutput(tr("No application .pro file found, not building an APK."), BuildStep::OutputFormat::ErrorMessage); reportRunResult(fi, true); return; } @@ -247,7 +247,7 @@ void QmakeAndroidBuildApkStep::processStarted() emit addOutput(tr("Starting: \"%1\" %2") .arg(QDir::toNativeSeparators(m_command), m_argumentsPasswordConcealed), - BuildStep::MessageOutput); + BuildStep::OutputFormat::NormalMessage); } ProjectExplorer::BuildStepConfigWidget *QmakeAndroidBuildApkStep::createConfigWidget() diff --git a/src/plugins/qmakeprojectmanager/makestep.cpp b/src/plugins/qmakeprojectmanager/makestep.cpp index a824ddafac..ec32d8f189 100644 --- a/src/plugins/qmakeprojectmanager/makestep.cpp +++ b/src/plugins/qmakeprojectmanager/makestep.cpp @@ -283,7 +283,7 @@ void MakeStep::run(QFutureInterface<bool> & fi) if (!QFileInfo::exists(m_makeFileToCheck)) { if (!ignoreReturnValue()) - emit addOutput(tr("Cannot find Makefile. Check your build settings."), BuildStep::MessageOutput); + emit addOutput(tr("Cannot find Makefile. Check your build settings."), BuildStep::OutputFormat::NormalMessage); const bool success = ignoreReturnValue(); reportRunResult(fi, success); return; diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index f58f9b79e4..e393f6d495 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -281,7 +281,7 @@ void QMakeStep::run(QFutureInterface<bool> &fi) } if (!m_needToRunQMake) { - emit addOutput(tr("Configuration unchanged, skipping qmake step."), BuildStep::MessageOutput); + emit addOutput(tr("Configuration unchanged, skipping qmake step."), BuildStep::OutputFormat::NormalMessage); reportRunResult(fi, true); return; } diff --git a/src/plugins/remotelinux/abstractpackagingstep.cpp b/src/plugins/remotelinux/abstractpackagingstep.cpp index 92fcf8fade..aa45cf15f2 100644 --- a/src/plugins/remotelinux/abstractpackagingstep.cpp +++ b/src/plugins/remotelinux/abstractpackagingstep.cpp @@ -169,7 +169,7 @@ void AbstractPackagingStep::raiseError(const QString &errorMessage) Task task = Task(Task::Error, errorMessage, Utils::FileName(), -1, Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task); - emit addOutput(errorMessage, BuildStep::ErrorOutput); + emit addOutput(errorMessage, BuildStep::OutputFormat::Stderr); } void AbstractPackagingStep::raiseWarning(const QString &warningMessage) @@ -177,7 +177,7 @@ void AbstractPackagingStep::raiseWarning(const QString &warningMessage) Task task = Task(Task::Warning, warningMessage, Utils::FileName(), -1, Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task); - emit addOutput(warningMessage, ErrorMessageOutput); + emit addOutput(warningMessage, OutputFormat::ErrorMessage); } } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index c8c8c52f4c..e70ac3e76b 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -81,7 +81,7 @@ bool AbstractRemoteLinuxDeployStep::init(QList<const BuildStep *> &earlierSteps) deployService()->setTarget(target()); const bool canDeploy = initInternal(&error); if (!canDeploy) - emit addOutput(tr("Cannot deploy: %1").arg(error), ErrorMessageOutput); + emit addOutput(tr("Cannot deploy: %1").arg(error), OutputFormat::ErrorMessage); return canDeploy; } @@ -110,7 +110,8 @@ void AbstractRemoteLinuxDeployStep::cancel() if (d->hasError) return; - emit addOutput(tr("User requests deployment to stop; cleaning up."), MessageOutput); + emit addOutput(tr("User requests deployment to stop; cleaning up."), + OutputFormat::NormalMessage); d->hasError = true; deployService()->stop(); } @@ -127,7 +128,7 @@ RemoteLinuxDeployConfiguration *AbstractRemoteLinuxDeployStep::deployConfigurati void AbstractRemoteLinuxDeployStep::handleProgressMessage(const QString &message) { - emit addOutput(message, MessageOutput); + emit addOutput(message, OutputFormat::NormalMessage); } void AbstractRemoteLinuxDeployStep::handleErrorMessage(const QString &message) @@ -135,7 +136,7 @@ void AbstractRemoteLinuxDeployStep::handleErrorMessage(const QString &message) ProjectExplorer::Task task = Task(Task::Error, message, Utils::FileName(), -1, Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task, 1); // TODO correct? - emit addOutput(message, ErrorMessageOutput); + emit addOutput(message, OutputFormat::ErrorMessage); d->hasError = true; } @@ -144,27 +145,27 @@ void AbstractRemoteLinuxDeployStep::handleWarningMessage(const QString &message) ProjectExplorer::Task task = Task(Task::Warning, message, Utils::FileName(), -1, Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task, 1); // TODO correct? - emit addOutput(message, ErrorMessageOutput); + emit addOutput(message, OutputFormat::ErrorMessage); } void AbstractRemoteLinuxDeployStep::handleFinished() { if (d->hasError) - emit addOutput(tr("Deploy step failed."), ErrorMessageOutput); + emit addOutput(tr("Deploy step failed."), OutputFormat::ErrorMessage); else - emit addOutput(tr("Deploy step finished."), MessageOutput); + emit addOutput(tr("Deploy step finished."), OutputFormat::NormalMessage); disconnect(deployService(), 0, this, 0); reportRunResult(d->future, !d->hasError); } void AbstractRemoteLinuxDeployStep::handleStdOutData(const QString &data) { - emit addOutput(data, NormalOutput, DontAppendNewline); + emit addOutput(data, OutputFormat::Stdout, DontAppendNewline); } void AbstractRemoteLinuxDeployStep::handleStdErrData(const QString &data) { - emit addOutput(data, ErrorOutput, DontAppendNewline); + emit addOutput(data, OutputFormat::Stderr, DontAppendNewline); } } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/tarpackagecreationstep.cpp b/src/plugins/remotelinux/tarpackagecreationstep.cpp index 6226c6f81e..327cbf02d6 100644 --- a/src/plugins/remotelinux/tarpackagecreationstep.cpp +++ b/src/plugins/remotelinux/tarpackagecreationstep.cpp @@ -175,9 +175,9 @@ void TarPackageCreationStep::run(QFutureInterface<bool> &fi) setPackagingFinished(success); if (success) - emit addOutput(tr("Packaging finished successfully."), MessageOutput); + emit addOutput(tr("Packaging finished successfully."), OutputFormat::NormalMessage); else - emit addOutput(tr("Packaging failed."), ErrorMessageOutput); + emit addOutput(tr("Packaging failed."), OutputFormat::ErrorMessage); connect(BuildManager::instance(), &BuildManager::buildQueueFinished, this, &TarPackageCreationStep::deployFinished); @@ -236,9 +236,9 @@ void TarPackageCreationStep::addNeededDeploymentFiles( bool TarPackageCreationStep::doPackage(QFutureInterface<bool> &fi) { - emit addOutput(tr("Creating tarball..."), MessageOutput); + emit addOutput(tr("Creating tarball..."), OutputFormat::NormalMessage); if (!m_packagingNeeded) { - emit addOutput(tr("Tarball up to date, skipping packaging."), MessageOutput); + emit addOutput(tr("Tarball up to date, skipping packaging."), OutputFormat::NormalMessage); return true; } @@ -254,7 +254,7 @@ bool TarPackageCreationStep::doPackage(QFutureInterface<bool> &fi) foreach (const DeployableFile &d, m_files) { if (d.remoteDirectory().isEmpty()) { emit addOutput(tr("No remote path specified for file \"%1\", skipping.") - .arg(d.localFilePath().toUserOutput()), ErrorMessageOutput); + .arg(d.localFilePath().toUserOutput()), OutputFormat::ErrorMessage); continue; } QFileInfo fileInfo = d.localFilePath().toFileInfo(); @@ -307,7 +307,8 @@ bool TarPackageCreationStep::appendFile(QFile &tarFile, const QFileInfo &fileInf const int chunkSize = 1024*1024; - emit addOutput(tr("Adding file \"%1\" to tarball...").arg(nativePath), MessageOutput); + emit addOutput(tr("Adding file \"%1\" to tarball...").arg(nativePath), + OutputFormat::NormalMessage); // TODO: Wasteful. Work with fixed-size buffer. while (!file.atEnd() && file.error() == QFile::NoError && tarFile.error() == QFile::NoError) { diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.cpp b/src/plugins/winrt/winrtpackagedeploymentstep.cpp index e7020ec42b..2725a3cf38 100644 --- a/src/plugins/winrt/winrtpackagedeploymentstep.cpp +++ b/src/plugins/winrt/winrtpackagedeploymentstep.cpp @@ -241,7 +241,7 @@ void WinRtPackageDeploymentStep::raiseError(const QString &errorMessage) ProjectExplorer::Task task = Task(Task::Error, errorMessage, Utils::FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task, 1); - emit addOutput(errorMessage, BuildStep::ErrorMessageOutput); + emit addOutput(errorMessage, BuildStep::OutputFormat::ErrorMessage); } void WinRtPackageDeploymentStep::raiseWarning(const QString &warningMessage) @@ -249,7 +249,7 @@ void WinRtPackageDeploymentStep::raiseWarning(const QString &warningMessage) ProjectExplorer::Task task = Task(Task::Warning, warningMessage, Utils::FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task, 1); - emit addOutput(warningMessage, BuildStep::MessageOutput); + emit addOutput(warningMessage, BuildStep::OutputFormat::NormalMessage); } bool WinRtPackageDeploymentStep::fromMap(const QVariantMap &map) |