diff --git a/src/plugins/cmakeprojectmanager/makestep.cpp b/src/plugins/cmakeprojectmanager/makestep.cpp index ab93540b83c32a251a53d1e2c60c98fc59149613..6f6f9f522a73267f3d312bfe637195c8507ec667 100644 --- a/src/plugins/cmakeprojectmanager/makestep.cpp +++ b/src/plugins/cmakeprojectmanager/makestep.cpp @@ -142,9 +142,10 @@ bool MakeStep::init() pp->setCommand(bc->toolChain()->makeCommand()); pp->setArguments(arguments); - setOutputParser(new ProjectExplorer::GnuMakeParser(pp->effectiveWorkingDirectory())); + setOutputParser(new ProjectExplorer::GnuMakeParser()); if (bc->toolChain()) appendOutputParser(bc->toolChain()->outputParser()); + outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory()); return AbstractProcessStep::init(); } diff --git a/src/plugins/genericprojectmanager/genericmakestep.cpp b/src/plugins/genericprojectmanager/genericmakestep.cpp index e974ddcfb9c07de4cb278e6102fe2f316c83a752..e4dd6d964d84dfa93da31df9d83b861857272c5a 100644 --- a/src/plugins/genericprojectmanager/genericmakestep.cpp +++ b/src/plugins/genericprojectmanager/genericmakestep.cpp @@ -111,9 +111,10 @@ bool GenericMakeStep::init() pp->setCommand(makeCommand()); pp->setArguments(allArguments()); - setOutputParser(new ProjectExplorer::GnuMakeParser(pp->effectiveWorkingDirectory())); + setOutputParser(new ProjectExplorer::GnuMakeParser()); if (bc->genericTarget()->genericProject()->toolChain()) appendOutputParser(bc->genericTarget()->genericProject()->toolChain()->outputParser()); + outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory()); return AbstractProcessStep::init(); } diff --git a/src/plugins/projectexplorer/gnumakeparser.cpp b/src/plugins/projectexplorer/gnumakeparser.cpp index 1cefce09cd0da0cb6ed853be4c20671041e9bf8e..affb370d4804cad2d52c728acc0649f67be7e3ce 100644 --- a/src/plugins/projectexplorer/gnumakeparser.cpp +++ b/src/plugins/projectexplorer/gnumakeparser.cpp @@ -42,7 +42,7 @@ namespace { const char * const MAKE_PATTERN("^(([A-Za-z]:)?[/\\\\][^:]*[/\\\\])?(mingw(32|64)-|g)?make(.exe)?(\\[\\d+\\])?:\\s"); } -GnuMakeParser::GnuMakeParser(const QString &dir) : +GnuMakeParser::GnuMakeParser() : m_suppressIssues(false), m_fatalErrorCount(0) { @@ -54,12 +54,17 @@ GnuMakeParser::GnuMakeParser(const QString &dir) : m_makeLine.setMinimal(true); m_makefileError.setPattern(QLatin1String("^(.*):(\\d+):\\s\\*\\*\\*\\s(.*)$")); m_makefileError.setMinimal(true); - addDirectory(dir); } -int GnuMakeParser::fatalErrors() const +void GnuMakeParser::setWorkingDirectory(const QString &workingDirectory) { - return m_fatalErrorCount; + addDirectory(workingDirectory); + IOutputParser::setWorkingDirectory(workingDirectory); +} + +bool GnuMakeParser::hasFatalErrors() const +{ + return (m_fatalErrorCount > 0) || IOutputParser::hasFatalErrors(); } void GnuMakeParser::stdOutput(const QString &line) diff --git a/src/plugins/projectexplorer/gnumakeparser.h b/src/plugins/projectexplorer/gnumakeparser.h index ae24798f09a99efd2abbc0f162154c4849897e41..7f389dd14ee8bc073880467e5df3ec93643e43b8 100644 --- a/src/plugins/projectexplorer/gnumakeparser.h +++ b/src/plugins/projectexplorer/gnumakeparser.h @@ -42,14 +42,16 @@ class PROJECTEXPLORER_EXPORT GnuMakeParser : public ProjectExplorer::IOutputPars Q_OBJECT public: - explicit GnuMakeParser(const QString &dir = QString()); + explicit GnuMakeParser(); virtual void stdOutput(const QString &line); virtual void stdError(const QString &line); + virtual void setWorkingDirectory(const QString &workingDirectory); + QStringList searchDirectories() const; - int fatalErrors() const; + bool hasFatalErrors() const; public slots: virtual void taskAdded(const ProjectExplorer::Task &task); diff --git a/src/plugins/projectexplorer/ioutputparser.cpp b/src/plugins/projectexplorer/ioutputparser.cpp index 9bc7ef60fb50241851c9f56b74def7958cc10b8e..214b1a901e827f993b4c7805b2a350a03cf2ca5e 100644 --- a/src/plugins/projectexplorer/ioutputparser.cpp +++ b/src/plugins/projectexplorer/ioutputparser.cpp @@ -103,4 +103,15 @@ void IOutputParser::taskAdded(const ProjectExplorer::Task &task) emit addTask(task); } +bool IOutputParser::hasFatalErrors() const +{ + return false || (m_parser && m_parser->hasFatalErrors()); +} + +void IOutputParser::setWorkingDirectory(const QString &workingDirectory) +{ + if (m_parser) + m_parser->setWorkingDirectory(workingDirectory); +} + } diff --git a/src/plugins/projectexplorer/ioutputparser.h b/src/plugins/projectexplorer/ioutputparser.h index b733aa5a12fdfeb97cf3ec7af046f8e37fe82d1c..9f227eb520e0c7c1233433d0bd829ce06a6453a4 100644 --- a/src/plugins/projectexplorer/ioutputparser.h +++ b/src/plugins/projectexplorer/ioutputparser.h @@ -63,6 +63,11 @@ public: /// Called once for each line if standard error to parse. virtual void stdError(const QString &line); + // This is mainly a symbian specific quirk + virtual bool hasFatalErrors() const; + // For GnuMakeParser + virtual void setWorkingDirectory(const QString &workingDirectory); + signals: /// Should be emitted whenever some additional information should be /// added to the output. diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp index 1172899f16a03929d7998605d7d7f293cfda65cb..3eb4f8be151554dbfec7068f2e13f2b680448cdd 100644 --- a/src/plugins/qt4projectmanager/makestep.cpp +++ b/src/plugins/qt4projectmanager/makestep.cpp @@ -183,24 +183,14 @@ bool MakeStep::init() setEnabled(true); pp->setArguments(args); - m_gnuMakeParser = 0; - - if (bc->qtVersion()->supportsTargetId(Qt4ProjectManager::Constants::S60_DEVICE_TARGET_ID) || - bc->qtVersion()->supportsTargetId(Qt4ProjectManager::Constants::S60_EMULATOR_TARGET_ID)) { - if (bc->qtVersion()->isBuildWithSymbianSbsV2()) { - setOutputParser(new SbsV2Parser); - } else { - setOutputParser(new AbldParser); - m_gnuMakeParser = new ProjectExplorer::GnuMakeParser(workingDirectory); - appendOutputParser(m_gnuMakeParser); - } - } else { - setOutputParser(new ProjectExplorer::GnuMakeParser(workingDirectory)); - } - appendOutputParser(new QtParser); - + m_makeParser = bc->qtVersion()->createOutputParser(); + m_makeParser->appendOutputParser(new QtParser); if (toolchain) - appendOutputParser(toolchain->outputParser()); + m_makeParser->appendOutputParser(toolchain->outputParser()); + + m_makeParser->setWorkingDirectory(workingDirectory); + + setOutputParser(m_makeParser); return AbstractProcessStep::init(); } @@ -218,8 +208,8 @@ void MakeStep::run(QFutureInterface<bool> & fi) bool MakeStep::processSucceeded(int exitCode, QProcess::ExitStatus status) { // Symbian does retun 0, even on failed makes! So we check for fatal make errors here. - if (m_gnuMakeParser) - return m_gnuMakeParser->fatalErrors() == 0; + if (m_makeParser && m_makeParser->hasFatalErrors()) + return false; return AbstractProcessStep::processSucceeded(exitCode, status); } diff --git a/src/plugins/qt4projectmanager/makestep.h b/src/plugins/qt4projectmanager/makestep.h index 0858e55fd9a72902d6fc72ee890ca51c2b91d071..ac0b35ede073f226c718f038fc9c0db6b8b9195e 100644 --- a/src/plugins/qt4projectmanager/makestep.h +++ b/src/plugins/qt4projectmanager/makestep.h @@ -110,7 +110,7 @@ private: bool m_clean; QString m_userArgs; QString m_makeCmd; - ProjectExplorer::GnuMakeParser * m_gnuMakeParser; + ProjectExplorer::IOutputParser *m_makeParser; }; class MakeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget diff --git a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp index 20b114d32d776c7463266bdec333774513357af9..b5adbd040afa04146820e11c0d01b5a887fddf9a 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60createpackagestep.cpp @@ -409,11 +409,12 @@ bool S60CreatePackageStep::createOnePackage() m_outputParserChain = new Qt4ProjectManager::AbldParser; m_outputParserChain->appendOutputParser(new ProjectExplorer::GnuMakeParser); } else { - m_outputParserChain = new ProjectExplorer::GnuMakeParser(wd.absolutePath()); + m_outputParserChain = new ProjectExplorer::GnuMakeParser(); } Q_ASSERT(!m_parser); m_parser = new S60CreatePackageParser(wd.absolutePath()); m_outputParserChain->appendOutputParser(m_parser); + m_outputParserChain->setWorkingDirectory(wd.absolutePath()); connect(m_outputParserChain, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)), this, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat))); diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp index b1dc399c11d8611d4ae244c752c5fae7bc52969d..b31f254a04e1e1152f88512a84d3f081398e2c77 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.cpp +++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp @@ -36,10 +36,13 @@ #include "qt-maemo/maemomanager.h" #include "qt-s60/s60manager.h" #include "qt-s60/s60projectchecker.h" +#include "qt-s60/abldparser.h" +#include "qt-s60/sbsv2parser.h" #include "qmlobservertool.h" #include "qmldumptool.h" #include <projectexplorer/debugginghelper.h> +#include <projectexplorer/gnumakeparser.h> #include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/cesdkhandler.h> @@ -669,6 +672,21 @@ bool QtVersion::supportsShadowBuilds() const return true; } +ProjectExplorer::IOutputParser *QtVersion::createOutputParser() const +{ + if (supportsTargetId(Qt4ProjectManager::Constants::S60_DEVICE_TARGET_ID) || + supportsTargetId(Qt4ProjectManager::Constants::S60_EMULATOR_TARGET_ID)) { + if (isBuildWithSymbianSbsV2()) { + return new SbsV2Parser; + } else { + ProjectExplorer::IOutputParser *parser = new AbldParser; + parser->appendOutputParser(new ProjectExplorer::GnuMakeParser); + return parser; + } + } + return new ProjectExplorer::GnuMakeParser; +} + QList<ProjectExplorer::Task> QtVersion::reportIssues(const QString &proFile, const QString &buildDir) { diff --git a/src/plugins/qt4projectmanager/qtversionmanager.h b/src/plugins/qt4projectmanager/qtversionmanager.h index f810aa0868a087a7139914f7bd59fa8930acfcab..7159ea1a11baba6b073d56badc0ef123f5aaaf8d 100644 --- a/src/plugins/qt4projectmanager/qtversionmanager.h +++ b/src/plugins/qt4projectmanager/qtversionmanager.h @@ -31,6 +31,8 @@ #define QTVERSIONMANAGER_H #include "qt4projectmanager_global.h" + +#include <projectexplorer/ioutputparser.h> #include <projectexplorer/taskwindow.h> #include <projectexplorer/toolchain.h> #include <projectexplorer/task.h> @@ -173,6 +175,8 @@ public: /// warnings and finally info items. QList<ProjectExplorer::Task> reportIssues(const QString &proFile, const QString &buildDir); + ProjectExplorer::IOutputParser *createOutputParser() const; + private: QList<QSharedPointer<ProjectExplorer::ToolChain> > toolChains() const; static int getUniqueId();