diff options
Diffstat (limited to 'src/plugins/qt4projectmanager')
23 files changed, 175 insertions, 422 deletions
diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp index fb942baa84..2ff62bb025 100644 --- a/src/plugins/qt4projectmanager/makestep.cpp +++ b/src/plugins/qt4projectmanager/makestep.cpp @@ -33,26 +33,24 @@ #include "qt4buildconfiguration.h" #include "qt4projectmanagerconstants.h" -#include <projectexplorer/projectexplorerconstants.h> +#include <projectexplorer/gnumakeparser.h> #include <QtCore/QDir> #include <QtCore/QFileInfo> -using ProjectExplorer::IBuildParserFactory; -using ProjectExplorer::IBuildParser; using ProjectExplorer::Environment; using ExtensionSystem::PluginManager; using namespace Qt4ProjectManager; using namespace Qt4ProjectManager::Internal; -MakeStep::MakeStep(ProjectExplorer::BuildConfiguration *bc) - : AbstractMakeStep(bc), m_clean(false) +MakeStep::MakeStep(ProjectExplorer::BuildConfiguration *bc) : + AbstractProcessStep(bc), m_clean(false) { } -MakeStep::MakeStep(MakeStep *bs, ProjectExplorer::BuildConfiguration *bc) - : AbstractMakeStep(bs, bc), +MakeStep::MakeStep(MakeStep *bs, ProjectExplorer::BuildConfiguration *bc) : + AbstractProcessStep(bs, bc), m_clean(bs->m_clean), m_userArgs(bs->m_userArgs), m_makeCmd(bs->m_makeCmd) @@ -79,7 +77,7 @@ void MakeStep::restoreFromGlobalMap(const QMap<QString, QVariant> &map) { if (map.value("clean").isValid() && map.value("clean").toBool()) m_clean = true; - ProjectExplorer::AbstractMakeStep::restoreFromGlobalMap(map); + ProjectExplorer::AbstractProcessStep::restoreFromGlobalMap(map); } void MakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &map) @@ -88,7 +86,7 @@ void MakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &map) m_makeCmd = map.value("makeCmd").toString(); if (map.value("clean").isValid() && map.value("clean").toBool()) m_clean = true; - ProjectExplorer::AbstractMakeStep::restoreFromLocalMap(map); + ProjectExplorer::AbstractProcessStep::restoreFromLocalMap(map); } void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map) @@ -97,7 +95,7 @@ void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map) map["makeCmd"] = m_makeCmd; if (m_clean) map["clean"] = true; - ProjectExplorer::AbstractMakeStep::storeIntoLocalMap(map); + ProjectExplorer::AbstractProcessStep::storeIntoLocalMap(map); } bool MakeStep::init() @@ -116,8 +114,8 @@ bool MakeStep::init() // Try to detect command in environment QString tmp = environment.searchInPath(makeCmd); if (tmp == QString::null) { - emit addToOutputWindow(tr("<font color=\"#ff0000\">Could not find make command: %1 "\ - "in the build environment</font>").arg(makeCmd)); + emit addOutput(tr("<font color=\"#ff0000\">Could not find make command: %1 "\ + "in the build environment</font>").arg(makeCmd)); return false; } makeCmd = tmp; @@ -140,30 +138,22 @@ bool MakeStep::init() // but for now this is the least invasive change ProjectExplorer::ToolChain *toolchain = bc->toolChain(); - ProjectExplorer::ToolChain::ToolChainType type = ProjectExplorer::ToolChain::UNKNOWN; - if (toolchain) - type = toolchain->type(); - if (type != ProjectExplorer::ToolChain::MSVC && type != ProjectExplorer::ToolChain::WINCE) { - if (m_makeCmd.isEmpty()) - args << "-w"; + if (toolchain) { + if (toolchain->type() != ProjectExplorer::ToolChain::MSVC && + toolchain->type() != ProjectExplorer::ToolChain::WINCE) { + if (m_makeCmd.isEmpty()) + args << "-w"; + } } setEnabled(true); setArguments(args); - if (type == ProjectExplorer::ToolChain::MSVC || type == ProjectExplorer::ToolChain::WINCE) - setBuildParser(ProjectExplorer::Constants::BUILD_PARSER_MSVC); - else if (ProjectExplorer::ToolChain::GCCE == type) - setBuildParser(ProjectExplorer::Constants::BUILD_PARSER_ABLD_GCCE); - else if (ProjectExplorer::ToolChain::WINSCW == type) - setBuildParser(ProjectExplorer::Constants::BUILD_PARSER_ABLD_WINSCW); - else if (ProjectExplorer::ToolChain::RVCT_ARMV5 == type || - ProjectExplorer::ToolChain::RVCT_ARMV6 == type) - setBuildParser(ProjectExplorer::Constants::BUILD_PARSER_ABLD_RVCT); - else - setBuildParser(ProjectExplorer::Constants::BUILD_PARSER_GCC); + setOutputParser(new ProjectExplorer::GnuMakeParser(workingDirectory)); + if (toolchain) + appendOutputParser(toolchain->outputParser()); - return AbstractMakeStep::init(); + return AbstractProcessStep::init(); } void MakeStep::run(QFutureInterface<bool> & fi) @@ -173,7 +163,7 @@ void MakeStep::run(QFutureInterface<bool> & fi) return; } - AbstractMakeStep::run(fi); + AbstractProcessStep::run(fi); } QString MakeStep::name() @@ -183,7 +173,7 @@ QString MakeStep::name() QString MakeStep::displayName() { - return "Make"; + return QLatin1String("Make"); } bool MakeStep::immutable() const diff --git a/src/plugins/qt4projectmanager/makestep.h b/src/plugins/qt4projectmanager/makestep.h index 5a9390a8cb..b18bca6ef2 100644 --- a/src/plugins/qt4projectmanager/makestep.h +++ b/src/plugins/qt4projectmanager/makestep.h @@ -33,7 +33,7 @@ #include "ui_makestep.h" #include "qtversionmanager.h" -#include <projectexplorer/abstractmakestep.h> +#include <projectexplorer/abstractprocessstep.h> #include <projectexplorer/projectexplorer.h> namespace ProjectExplorer { @@ -62,7 +62,7 @@ public: class Qt4Project; -class MakeStep : public ProjectExplorer::AbstractMakeStep +class MakeStep : public ProjectExplorer::AbstractProcessStep { Q_OBJECT friend class MakeStepConfigWidget; // TODO remove this diff --git a/src/plugins/qt4projectmanager/qmakeparser.cpp b/src/plugins/qt4projectmanager/qmakeparser.cpp index 767b86921a..804a567291 100644 --- a/src/plugins/qt4projectmanager/qmakeparser.cpp +++ b/src/plugins/qt4projectmanager/qmakeparser.cpp @@ -29,53 +29,30 @@ #include "qmakeparser.h" #include "qt4projectmanagerconstants.h" + #include <projectexplorer/taskwindow.h> #include <projectexplorer/projectexplorerconstants.h> +#include <utils/qtcassert.h> using namespace Qt4ProjectManager; using namespace Qt4ProjectManager::Internal; using ProjectExplorer::TaskWindow; -QMakeParserFactory::~QMakeParserFactory() -{ -} - -bool QMakeParserFactory::canCreate(const QString & name) const -{ - return (name == Constants::BUILD_PARSER_QMAKE); -} - -ProjectExplorer::IBuildParser * QMakeParserFactory::create(const QString & name) const -{ - Q_UNUSED(name) - return new QMakeParser(); -} - QMakeParser::QMakeParser() { } -QString QMakeParser::name() const -{ - return QLatin1String(Qt4ProjectManager::Constants::BUILD_PARSER_QMAKE); -} - -void QMakeParser::stdOutput(const QString & line) -{ - Q_UNUSED(line) -} - -void QMakeParser::stdError(const QString & line) +void QMakeParser::stdError(const QString &line) { QString lne(line.trimmed()); - if (lne.startsWith("Project ERROR:")) - { - lne = lne.mid(15); - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error, - lne /* description */, - QString() /* filename */, - -1 /* linenumber */, - ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + if (lne.startsWith("Project ERROR:")) { + const QString description = lne.mid(15); + emit addTask(TaskWindow::Task(TaskWindow::Error, + description, + QString() /* filename */, + -1 /* linenumber */, + ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); return; } + IOutputParser::stdError(line); } diff --git a/src/plugins/qt4projectmanager/qmakeparser.h b/src/plugins/qt4projectmanager/qmakeparser.h index e3bdf950a9..75b6684b1c 100644 --- a/src/plugins/qt4projectmanager/qmakeparser.h +++ b/src/plugins/qt4projectmanager/qmakeparser.h @@ -30,37 +30,23 @@ #ifndef QMAKEPARSER_H #define QMAKEPARSER_H -#include <projectexplorer/ibuildparser.h> +#include <projectexplorer/ioutputparser.h> #include <QtCore/QRegExp> namespace Qt4ProjectManager { namespace Internal { -class QMakeParserFactory : public ProjectExplorer::IBuildParserFactory -{ - Q_OBJECT -public: - QMakeParserFactory() {} - virtual ~QMakeParserFactory(); - virtual bool canCreate(const QString & name) const; - virtual ProjectExplorer::IBuildParser * create(const QString & name) const; -}; - - -class QMakeParser : public ProjectExplorer::IBuildParser +class QMakeParser : public ProjectExplorer::IOutputParser { Q_OBJECT public: QMakeParser(); - QString name() const; - virtual void stdOutput(const QString & line); - virtual void stdError(const QString & line); -private: + virtual void stdError(const QString &line); }; -} // namesapce Interanal +} // namesapce Internal } // namespace ProjectExplorer #endif // QMAKEPARSER_H diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp index f680642824..545ecd0a2e 100644 --- a/src/plugins/qt4projectmanager/qmakestep.cpp +++ b/src/plugins/qt4projectmanager/qmakestep.cpp @@ -29,36 +29,33 @@ #include "qmakestep.h" +#include "qmakeparser.h" +#include "qt4buildconfiguration.h" #include "qt4project.h" #include "qt4projectmanagerconstants.h" #include "qt4projectmanager.h" -#include "makestep.h" #include "qtversionmanager.h" -#include "qt4buildconfiguration.h" #include <coreplugin/icore.h> #include <utils/qtcassert.h> -#include <QFileDialog> -#include <QDir> -#include <QFile> -#include <QCoreApplication> +#include <QtCore/QDir> +#include <QtCore/QFile> using namespace Qt4ProjectManager; using namespace Qt4ProjectManager::Internal; using namespace ProjectExplorer; -QMakeStep::QMakeStep(ProjectExplorer::BuildConfiguration *bc) - : AbstractMakeStep(bc), m_forced(false) +QMakeStep::QMakeStep(ProjectExplorer::BuildConfiguration *bc) : + AbstractProcessStep(bc), m_forced(false) { } -QMakeStep::QMakeStep(QMakeStep *bs, ProjectExplorer::BuildConfiguration *bc) - : AbstractMakeStep(bs, bc), +QMakeStep::QMakeStep(QMakeStep *bs, ProjectExplorer::BuildConfiguration *bc) : + AbstractProcessStep(bs, bc), m_forced(false), m_userArgs(bs->m_userArgs) { - } QMakeStep::~QMakeStep() @@ -112,9 +109,9 @@ bool QMakeStep::init() if (!qtVersion->isValid()) { #if defined(Q_WS_MAC) - emit addToOutputWindow(tr("\n<font color=\"#ff0000\"><b>No valid Qt version set. Set one in Preferences </b></font>\n")); + emit addOutput(tr("\n<font color=\"#ff0000\"><b>No valid Qt version set. Set one in Preferences </b></font>\n")); #else - emit addToOutputWindow(tr("\n<font color=\"#ff0000\"><b>No valid Qt version set. Set one in Tools/Options </b></font>\n")); + emit addOutput(tr("\n<font color=\"#ff0000\"><b>No valid Qt version set. Set one in Tools/Options </b></font>\n")); #endif return false; } @@ -124,7 +121,7 @@ bool QMakeStep::init() QString program = qtVersion->qmakeCommand(); - // Check wheter we need to run qmake + // Check whether we need to run qmake m_needToRunQMake = true; if (QDir(workingDirectory).exists(QLatin1String("Makefile"))) { QString qmakePath = QtVersionManager::findQMakeBinaryFromMakefile(workingDirectory); @@ -144,8 +141,8 @@ bool QMakeStep::init() setArguments(args); setEnvironment(qt4bc->environment()); - setBuildParser(Qt4ProjectManager::Constants::BUILD_PARSER_QMAKE); - return AbstractMakeStep::init(); + setOutputParser(new QMakeParser); + return AbstractProcessStep::init(); } void QMakeStep::run(QFutureInterface<bool> &fi) @@ -157,21 +154,21 @@ void QMakeStep::run(QFutureInterface<bool> &fi) } if (!m_needToRunQMake) { - emit addToOutputWindow(tr("<font color=\"#0000ff\">Configuration unchanged, skipping QMake step.</font>")); + emit addOutput(tr("<font color=\"#0000ff\">Configuration unchanged, skipping QMake step.</font>")); fi.reportResult(true); return; } - AbstractMakeStep::run(fi); + AbstractProcessStep::run(fi); } QString QMakeStep::name() { - return Constants::QMAKESTEP; + return QLatin1String(Constants::QMAKESTEP); } QString QMakeStep::displayName() { - return "QMake"; + return QLatin1String("QMake"); } void QMakeStep::setForced(bool b) diff --git a/src/plugins/qt4projectmanager/qmakestep.h b/src/plugins/qt4projectmanager/qmakestep.h index f620c9b868..acee94ad52 100644 --- a/src/plugins/qt4projectmanager/qmakestep.h +++ b/src/plugins/qt4projectmanager/qmakestep.h @@ -32,7 +32,7 @@ #include "ui_qmakestep.h" -#include <projectexplorer/abstractmakestep.h> +#include <projectexplorer/abstractprocessstep.h> #include <QStringList> @@ -64,7 +64,7 @@ public: } // namespace Internal -class QMakeStep : public ProjectExplorer::AbstractMakeStep +class QMakeStep : public ProjectExplorer::AbstractProcessStep { Q_OBJECT public: diff --git a/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp b/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp index 93c8c53b8c..b2e6000f45 100644 --- a/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp @@ -28,18 +28,16 @@ **************************************************************************/ #include "abldparser.h" -#include <utils/qtcassert.h> +#include <projectexplorer/gnumakeparser.h> #include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/taskwindow.h> -#include <extensionsystem/pluginmanager.h> - using namespace Qt4ProjectManager; using namespace ProjectExplorer; +using namespace ProjectExplorer::Constants; -AbldParser::AbldParser(const QString &name) : - m_name(name), +AbldParser::AbldParser() : m_currentLine(-1), m_waitingForStdErrContinuation(false), m_waitingForStdOutContinuation(false) @@ -47,47 +45,7 @@ AbldParser::AbldParser(const QString &name) : m_perlIssue.setPattern("^(WARNING|ERROR):\\s([^\\(\\)]+[^\\d])\\((\\d+)\\) : (.+)$"); m_perlIssue.setMinimal(true); - // Now look for new parser - QList<IBuildParserFactory *> buildParserFactories = - ExtensionSystem::PluginManager::instance()->getObjects<ProjectExplorer::IBuildParserFactory>(); - - QString subparser_name; - - if ((m_name == QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_ABLD_GCCE))) - subparser_name = QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_GCC); - else if ((m_name == QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_ABLD_WINSCW))) - subparser_name = QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_WINSCW); - else if (m_name == QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_ABLD_RVCT)) - subparser_name = QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_RVCT); - - QTC_ASSERT(!subparser_name.isNull(), return); - - foreach (IBuildParserFactory * factory, buildParserFactories) { - if (factory->canCreate(subparser_name)) { - m_subparser = factory->create(subparser_name); - break; - } - } - QTC_ASSERT(0 != m_subparser, return); - - connect(m_subparser, SIGNAL(enterDirectory(QString)), - this, SIGNAL(enterDirectory(QString))); - connect(m_subparser, SIGNAL(leaveDirectory(QString)), - this, SIGNAL(leaveDirectory(QString))); - connect(m_subparser, SIGNAL(addToOutputWindow(QString)), - this, SIGNAL(addToOutputWindow(QString))); - connect(m_subparser, SIGNAL(addToTaskWindow(ProjectExplorer::TaskWindow::Task)), - this, SIGNAL(addToTaskWindow(ProjectExplorer::TaskWindow::Task))); -} - -AbldParser::~AbldParser() -{ - delete m_subparser; -} - -QString AbldParser::name() const -{ - return m_name; + appendOutputParser(new GnuMakeParser); } void AbldParser::stdOutput(const QString &line) @@ -97,19 +55,19 @@ void AbldParser::stdOutput(const QString &line) QString lne = line.trimmed(); // possible ABLD.bat errors: if (lne.startsWith("Is Perl, version ")) { - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error, - lne /* description */, - QString() /* filename */, - -1 /* linenumber */, - Constants::TASK_CATEGORY_BUILDSYSTEM)); + emit addTask(TaskWindow::Task(TaskWindow::Error, + lne /* description */, + QString() /* filename */, + -1 /* linenumber */, + TASK_CATEGORY_BUILDSYSTEM)); return; } if (lne.startsWith("FATAL ERROR:")) { - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error, - lne /* description */, - QString() /* filename */, - -1 /* linenumber */, - Constants::TASK_CATEGORY_BUILDSYSTEM)); + emit addTask(TaskWindow::Task(TaskWindow::Error, + lne /* description */, + QString() /* filename */, + -1 /* linenumber */, + TASK_CATEGORY_BUILDSYSTEM)); m_waitingForStdOutContinuation = false; return; } @@ -122,14 +80,14 @@ void AbldParser::stdOutput(const QString &line) TaskWindow::Task task(TaskWindow::Unknown, m_perlIssue.cap(4) /* description */, m_currentFile, m_currentLine, - Constants::TASK_CATEGORY_BUILDSYSTEM); + TASK_CATEGORY_BUILDSYSTEM); if (m_perlIssue.cap(1) == QLatin1String("WARNING")) task.type = TaskWindow::Warning; else if (m_perlIssue.cap(1) == QLatin1String("ERROR")) task.type = TaskWindow::Error; - emit addToTaskWindow(task); + emit addTask(task); return; } @@ -139,17 +97,14 @@ void AbldParser::stdOutput(const QString &line) } if (m_waitingForStdOutContinuation) { - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Unknown, - lne /* description */, - m_currentFile, m_currentLine, - Constants::TASK_CATEGORY_BUILDSYSTEM)); + emit addTask(TaskWindow::Task(TaskWindow::Unknown, + lne /* description */, + m_currentFile, m_currentLine, + TASK_CATEGORY_BUILDSYSTEM)); m_waitingForStdOutContinuation = true; return; } - - QTC_ASSERT(0 != m_subparser, return); - // pass on to compiler output parser: - m_subparser->stdOutput(lne); + IOutputParser::stdOutput(line); } void AbldParser::stdError(const QString &line) @@ -162,20 +117,20 @@ void AbldParser::stdError(const QString &line) if (lne.startsWith("ABLD ERROR:") || lne.startsWith("This project does not support ") || lne.startsWith("Platform ")) { - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error, - lne /* description */, - QString() /* filename */, - -1 /* linenumber */, - Constants::TASK_CATEGORY_BUILDSYSTEM)); + emit addTask(TaskWindow::Task(TaskWindow::Error, + lne /* description */, + QString() /* filename */, + -1 /* linenumber */, + TASK_CATEGORY_BUILDSYSTEM)); return; } if (lne.startsWith("Died at ")) { - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error, - lne /* description */, - QString() /* filename */, - -1 /* linenumber */, - Constants::TASK_CATEGORY_BUILDSYSTEM)); + emit addTask(TaskWindow::Task(TaskWindow::Error, + lne /* description */, + QString() /* filename */, + -1 /* linenumber */, + TASK_CATEGORY_BUILDSYSTEM)); m_waitingForStdErrContinuation = false; return; } @@ -191,34 +146,31 @@ void AbldParser::stdError(const QString &line) } if (lne.startsWith("WARNING: ")) { QString description = lne.mid(9); - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Warning, description, - m_currentFile, - -1 /* linenumber */, - Constants::TASK_CATEGORY_BUILDSYSTEM)); + emit addTask(TaskWindow::Task(TaskWindow::Warning, description, + m_currentFile, + -1 /* linenumber */, + TASK_CATEGORY_BUILDSYSTEM)); m_waitingForStdErrContinuation = true; return; } if (lne.startsWith("ERROR: ")) { QString description = lne.mid(7); - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error, description, - m_currentFile, - -1 /* linenumber */, - Constants::TASK_CATEGORY_BUILDSYSTEM)); + emit addTask(TaskWindow::Task(TaskWindow::Error, description, + m_currentFile, + -1 /* linenumber */, + TASK_CATEGORY_BUILDSYSTEM)); m_waitingForStdErrContinuation = true; return; } if (m_waitingForStdErrContinuation) { - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Unknown, - lne /* description */, - m_currentFile, - -1 /* linenumber */, - Constants::TASK_CATEGORY_BUILDSYSTEM)); + emit addTask(TaskWindow::Task(TaskWindow::Unknown, + lne /* description */, + m_currentFile, + -1 /* linenumber */, + TASK_CATEGORY_BUILDSYSTEM)); m_waitingForStdErrContinuation = true; return; } - - QTC_ASSERT(0 != m_subparser, return); - // pass on to compiler output parser: - m_subparser->stdError(lne); + IOutputParser::stdError(line); } diff --git a/src/plugins/qt4projectmanager/qt-s60/abldparser.h b/src/plugins/qt4projectmanager/qt-s60/abldparser.h index fad5511e4a..3ccacf7620 100644 --- a/src/plugins/qt4projectmanager/qt-s60/abldparser.h +++ b/src/plugins/qt4projectmanager/qt-s60/abldparser.h @@ -30,27 +30,23 @@ #ifndef ABLDPARSER_H #define ABLDPARSER_H -#include <projectexplorer/ibuildparser.h> +#include <projectexplorer/ioutputparser.h> #include <QtCore/QRegExp> namespace Qt4ProjectManager { -class AbldParser : public ProjectExplorer::IBuildParser +class AbldParser : public ProjectExplorer::IOutputParser { Q_OBJECT public: - AbldParser(const QString & name); - ~AbldParser(); + AbldParser(); - QString name() const; virtual void stdOutput(const QString & line); virtual void stdError(const QString & line); -private: - ProjectExplorer::IBuildParser * m_subparser; - const QString m_name; +private: QRegExp m_perlIssue; QString m_currentFile; diff --git a/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri b/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri index c0fd1d72f8..a489d95a06 100644 --- a/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri +++ b/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri @@ -12,7 +12,6 @@ $$PWD/serialdevicelister.cpp \ $$PWD/rvcttoolchain.cpp \ $$PWD/s60runconfigbluetoothstarter.cpp \ - $$PWD/s60buildparserfactory.cpp \ $$PWD/abldparser.cpp \ $$PWD/rvctparser.cpp \ $$PWD/winscwparser.cpp @@ -27,7 +26,6 @@ $$PWD/serialdevicelister.h \ $$PWD/rvcttoolchain.h \ $$PWD/s60runconfigbluetoothstarter.h \ - $$PWD/s60buildparserfactory.h \ $$PWD/abldparser.h \ $$PWD/rvctparser.h \ $$PWD/winscwparser.h diff --git a/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp b/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp index 0b671f8113..76824ad2c5 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp @@ -32,6 +32,7 @@ #include <projectexplorer/taskwindow.h> using namespace ProjectExplorer; +using namespace ProjectExplorer::Constants; using namespace Qt4ProjectManager; RvctParser::RvctParser() : @@ -48,46 +49,28 @@ RvctParser::RvctParser() : // linker problems: m_linkerProblem.setPattern("^(\\S*)\\(\\S+\\):\\s(.+)$"); m_linkerProblem.setMinimal(true); - - //make[4]: Entering directory `/home/kkoehne/dev/ide-explorer/src/plugins/qtscripteditor' - m_makeDir.setPattern("^make.*: (\\w+) directory .(.+).$"); - m_makeDir.setMinimal(true); -} - -QString RvctParser::name() const -{ - return QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_RVCT); -} - -void RvctParser::stdOutput(const QString &line) -{ - QString lne = line.trimmed(); - - if (m_makeDir.indexIn(lne) > -1) { - if (m_makeDir.cap(1) == "Leaving") - emit leaveDirectory(m_makeDir.cap(2)); - else - emit enterDirectory(m_makeDir.cap(2)); - } } void RvctParser::stdError(const QString &line) { QString lne = line.trimmed(); if (m_linkerProblem.indexIn(lne) > -1) { - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error, - m_linkerProblem.cap(2) /* description */, - m_linkerProblem.cap(1) /* filename */, - -1 /* linenumber */, - Constants::TASK_CATEGORY_COMPILE)); - } else if (m_warningOrError.indexIn(lne) > -1) { + emit addTask(TaskWindow::Task(TaskWindow::Error, + m_linkerProblem.cap(2) /* description */, + m_linkerProblem.cap(1) /* filename */, + -1 /* linenumber */, + TASK_CATEGORY_COMPILE)); + return; + } + + if (m_warningOrError.indexIn(lne) > -1) { m_lastFile = m_warningOrError.cap(1); m_lastLine = m_warningOrError.cap(2).toInt(); TaskWindow::Task task(TaskWindow::Unknown, m_warningOrError.cap(5) /* description */, m_lastFile, m_lastLine, - Constants::TASK_CATEGORY_COMPILE); + TASK_CATEGORY_COMPILE); if (m_warningOrError.cap(4) == "Warning") task.type = TaskWindow::Warning; else if (m_warningOrError.cap(4) == "Error") @@ -95,14 +78,21 @@ void RvctParser::stdError(const QString &line) m_additionalInfo = true; - emit addToTaskWindow(task); - } else if (m_doneWithFile.indexIn(lne) > -1) { + emit addTask(task); + return; + } + + if (m_doneWithFile.indexIn(lne) > -1) { m_additionalInfo = false; - } else if (m_additionalInfo) { + return; + } + if (m_additionalInfo) { // Report any lines after a error/warning message as these contain // additional information on the problem. - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Unknown, lne, - m_lastFile, m_lastLine, - Constants::TASK_CATEGORY_COMPILE)); + emit addTask(TaskWindow::Task(TaskWindow::Unknown, lne, + m_lastFile, m_lastLine, + TASK_CATEGORY_COMPILE)); + return; } + IOutputParser::stdError(line); } diff --git a/src/plugins/qt4projectmanager/qt-s60/rvctparser.h b/src/plugins/qt4projectmanager/qt-s60/rvctparser.h index b1d545a9c4..d1396c4581 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvctparser.h +++ b/src/plugins/qt4projectmanager/qt-s60/rvctparser.h @@ -30,26 +30,24 @@ #ifndef RVCTPARSER_H #define RVCTPARSER_H -#include <projectexplorer/ibuildparser.h> +#include <projectexplorer/ioutputparser.h> #include <QtCore/QRegExp> namespace Qt4ProjectManager { -class RvctParser : public ProjectExplorer::IBuildParser +class RvctParser : public ProjectExplorer::IOutputParser { Q_OBJECT public: RvctParser(); - QString name() const; - virtual void stdOutput(const QString & line); virtual void stdError(const QString & line); + private: QRegExp m_warningOrError; QRegExp m_doneWithFile; QRegExp m_linkerProblem; - QRegExp m_makeDir; bool m_additionalInfo; QString m_lastFile; diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp index efa54dfb85..852180677a 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.cpp @@ -28,6 +28,8 @@ **************************************************************************/ #include "rvcttoolchain.h" +#include "rvctparser.h" + #include <QtCore/QProcess> using namespace ProjectExplorer; @@ -139,6 +141,11 @@ QString RVCTToolChain::makeCommand() const return QLatin1String("make"); } +ProjectExplorer::IOutputParser *RVCTToolChain::outputParser() const +{ + return new RvctParser; +} + bool RVCTToolChain::equals(ToolChain *otherIn) const { if (otherIn->type() != type()) diff --git a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h index 93cf80235f..01ab0a444b 100644 --- a/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/rvcttoolchain.h @@ -47,6 +47,8 @@ public: void addToEnvironment(ProjectExplorer::Environment &env); ProjectExplorer::ToolChain::ToolChainType type() const; QString makeCommand() const; + ProjectExplorer::IOutputParser *outputParser() const; + protected: bool equals(ToolChain *other) const; diff --git a/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.cpp b/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.cpp deleted file mode 100644 index 70befb3a59..0000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#include "s60buildparserfactory.h" -#include "abldparser.h" -#include "rvctparser.h" -#include "winscwparser.h" - -#include <projectexplorer/projectexplorerconstants.h> - -using namespace Qt4ProjectManager::Internal; - -S60ParserFactory::~S60ParserFactory() -{ -} - -bool S60ParserFactory::canCreate(const QString & name) const -{ - return ((name == QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_ABLD_GCCE)) || - (name == QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_ABLD_WINSCW)) || - (name == QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_ABLD_RVCT)) || - (name == QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_RVCT)) || - (name == QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_WINSCW))); -} - -ProjectExplorer::IBuildParser * S60ParserFactory::create(const QString & name) const -{ - if (name == QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_RVCT)) - return new RvctParser(); - if (name == QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_WINSCW)) - return new WinscwParser(); - - return new AbldParser(name); -} - diff --git a/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.h b/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.h deleted file mode 100644 index fd162bfbfe..0000000000 --- a/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.h +++ /dev/null @@ -1,51 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at http://qt.nokia.com/contact. -** -**************************************************************************/ - -#ifndef S60BUILDPARSERFACTORY_H -#define S60BUILDPARSERFACTORY_H - -#include <projectexplorer/ibuildparser.h> - -namespace Qt4ProjectManager { -namespace Internal { - -class S60ParserFactory : public ProjectExplorer::IBuildParserFactory -{ - Q_OBJECT -public: - S60ParserFactory() {} - virtual ~S60ParserFactory(); - virtual bool canCreate(const QString & name) const; - virtual ProjectExplorer::IBuildParser * create(const QString & name) const; -}; - -} // namespace Internal -} // namespace ProjectExplorer - -#endif // S60BUILDPARSERFACTORY_H diff --git a/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp b/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp index d1a58755eb..72857cbfcf 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp @@ -36,7 +36,6 @@ #include "rvcttoolchain.h" #include "s60emulatorrunconfiguration.h" #include "s60devicerunconfiguration.h" -#include "s60buildparserfactory.h" #include <coreplugin/icore.h> #include <extensionsystem/pluginmanager.h> @@ -118,9 +117,6 @@ S60Manager::S60Manager(QObject *parent) (QLatin1String(ProjectExplorer::Constants::RUNMODE), tr("Run on Device"), parent)); - // Build parsers - addAutoReleasedObject(new S60ParserFactory); - if (Debugger::DebuggerManager::instance()) addAutoReleasedObject(new RunControlFactory<S60DeviceDebugRunControl, S60DeviceRunConfiguration> diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwparser.cpp b/src/plugins/qt4projectmanager/qt-s60/winscwparser.cpp index 6b8d4a0a72..ba01ac7b93 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwparser.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/winscwparser.cpp @@ -33,6 +33,7 @@ using namespace Qt4ProjectManager; using namespace ProjectExplorer; +using namespace ProjectExplorer::Constants; WinscwParser::WinscwParser() { @@ -43,41 +44,26 @@ WinscwParser::WinscwParser() // WINSCW issue: m_compilerProblem.setPattern("^([^\\(\\)]+[^\\d]):(\\d+):\\s(.+)$"); m_compilerProblem.setMinimal(true); - - //make[4]: Entering directory `/home/kkoehne/dev/ide-explorer/src/plugins/qtscripteditor' - m_makeDir.setPattern("^make.*: (\\w+) directory .(.+).$"); - m_makeDir.setMinimal(true); -} - -QString WinscwParser::name() const -{ - return QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_WINSCW); } void WinscwParser::stdOutput(const QString &line) { QString lne = line.trimmed(); - if (m_makeDir.indexIn(lne) > -1) { - if (m_makeDir.cap(1) == "Leaving") - emit leaveDirectory(m_makeDir.cap(2)); - else - emit enterDirectory(m_makeDir.cap(2)); - return; - } - if (m_compilerProblem.indexIn(lne) > -1) { TaskWindow::Task task(TaskWindow::Error, m_compilerProblem.cap(3) /* description */, m_compilerProblem.cap(1) /* filename */, m_compilerProblem.cap(2).toInt() /* linenumber */, - Constants::TASK_CATEGORY_COMPILE); + TASK_CATEGORY_COMPILE); if (task.description.startsWith("warning: ")) { task.type = TaskWindow::Warning; task.description = task.description.mid(9); } - emit addToTaskWindow(task); + emit addTask(task); + return; } + IOutputParser::stdOutput(line); } void WinscwParser::stdError(const QString &line) @@ -85,10 +71,12 @@ void WinscwParser::stdError(const QString &line) QString lne = line.trimmed(); if (m_linkerProblem.indexIn(lne) > -1) { - emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error, - m_linkerProblem.cap(2) /* description */, - m_linkerProblem.cap(1) /* filename */, - -1 /* linenumber */, - Constants::TASK_CATEGORY_COMPILE)); + emit addTask(TaskWindow::Task(TaskWindow::Error, + m_linkerProblem.cap(2) /* description */, + m_linkerProblem.cap(1) /* filename */, + -1 /* linenumber */, + TASK_CATEGORY_COMPILE)); + return; } + IOutputParser::stdError(line); } diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwparser.h b/src/plugins/qt4projectmanager/qt-s60/winscwparser.h index 5b41db1859..8c5b485aab 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwparser.h +++ b/src/plugins/qt4projectmanager/qt-s60/winscwparser.h @@ -30,25 +30,25 @@ #ifndef WINSCWPARSER_H #define WINSCWPARSER_H -#include <projectexplorer/ibuildparser.h> +#include <projectexplorer/ioutputparser.h> #include <QtCore/QRegExp> namespace Qt4ProjectManager { -class WinscwParser : public ProjectExplorer::IBuildParser +class WinscwParser : public ProjectExplorer::IOutputParser { Q_OBJECT public: WinscwParser(); - QString name() const; - virtual void stdOutput(const QString & line); - virtual void stdError(const QString & line); + + virtual void stdOutput(const QString &line); + virtual void stdError(const QString &line); + private: QRegExp m_compilerProblem; QRegExp m_linkerProblem; - QRegExp m_makeDir; }; } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp index 618623e1aa..46350c219d 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.cpp @@ -29,9 +29,10 @@ #include "winscwtoolchain.h" +#include "winscwparser.h" + #include <QtCore/QByteArray> #include <QtCore/QString> -#include <QtDebug> using namespace ProjectExplorer; using namespace Qt4ProjectManager::Internal; @@ -108,7 +109,12 @@ void WINSCWToolChain::addToEnvironment(ProjectExplorer::Environment &env) QString WINSCWToolChain::makeCommand() const { - return "make"; + return QLatin1String("make"); +} + +IOutputParser *WINSCWToolChain::outputParser() const +{ + return new WinscwParser; } bool WINSCWToolChain::equals(ToolChain *other) const diff --git a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h index c38870f6be..cb2bbda895 100644 --- a/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h +++ b/src/plugins/qt4projectmanager/qt-s60/winscwtoolchain.h @@ -47,6 +47,7 @@ public: void addToEnvironment(ProjectExplorer::Environment &env); ProjectExplorer::ToolChain::ToolChainType type() const; QString makeCommand() const; + ProjectExplorer::IOutputParser *outputParser() const; protected: bool equals(ToolChain *other) const; diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h b/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h index 6af9bbb0f6..3e940b9e74 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h +++ b/src/plugins/qt4projectmanager/qt4projectmanagerconstants.h @@ -78,8 +78,6 @@ const char * const QT_SETTINGS_TR_CATEGORY = QT_TRANSLATE_NOOP("Qt4ProjectMan const char * const QTVERSION_SETTINGS_PAGE_ID = "Qt Versions"; const char * const QTVERSION_SETTINGS_PAGE_NAME = QT_TRANSLATE_NOOP("Qt4ProjectManager", "Qt Versions"); -// BuildParser -const char * const BUILD_PARSER_QMAKE = "BuildParser.QMake"; } // namespace Constants } // namespace Qt4ProjectManager diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp index 5261ee74e0..e5b0e4e4e4 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp @@ -45,14 +45,13 @@ #include "externaleditors.h" #include "gettingstartedwelcomepage.h" #include "gettingstartedwelcomepagewidget.h" -#include "qmakeparser.h" #ifdef QTCREATOR_WITH_S60 -#include "qt-s60/s60manager.h" +# include "qt-s60/s60manager.h" #endif #ifdef QTCREATOR_WITH_MAEMO -#include "qt-maemo/maemomanager.h" +# include "qt-maemo/maemomanager.h" #endif #include <coreplugin/icore.h> @@ -68,14 +67,12 @@ #include <coreplugin/actionmanager/actionmanager.h> #include <texteditor/texteditoractionhandler.h> -#include <QtCore/QDebug> -#include <QtCore/QtPlugin> -#include <QtGui/QMenu> - #ifdef WITH_TESTS -#include <QTest> +# include <QTest> #endif +#include <QtCore/QtPlugin> + using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager; using ProjectExplorer::Project; @@ -92,17 +89,6 @@ Qt4ProjectManagerPlugin::~Qt4ProjectManagerPlugin() removeObject(m_welcomePage); delete m_welcomePage; } -/* -static Core::Command *createSeparator(Core::ActionManager *am, - QObject *parent, - const QString &name, - const QList<int> &context) -{ - QAction *tmpaction = new QAction(parent); - tmpaction->setSeparator(true); - return am->registerAction(tmpaction, name, context); -} -*/ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *errorMessage) { @@ -150,7 +136,6 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString * addAutoReleasedObject(new QMakeStepFactory); addAutoReleasedObject(new MakeStepFactory); - addAutoReleasedObject(new QMakeParserFactory); addAutoReleasedObject(new Qt4RunConfigurationFactory); diff --git a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h index 03c3d6e70a..3d1a265ff8 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h +++ b/src/plugins/qt4projectmanager/qt4projectmanagerplugin.h @@ -46,8 +46,6 @@ class GuiAppWizard; class EmptyProjectWizard; class QMakeStepFactory; class MakeStepFactory; -class GccParserFactory; -class MsvcParserFactory; class EmbeddedPropertiesPage; class GettingStartedWelcomePage; |