From e0b27ef72ee0aa31aa3d5570c6e7497fdedd3bdc Mon Sep 17 00:00:00 2001
From: Tobias Hunger <qt-info@nokia.com>
Date: Mon, 9 Nov 2009 14:57:45 +0100
Subject: [PATCH] Add build parsers for S60.

This is a initial version including
 * ABLD error parsing
 * RVCT compiler output parsing.

Reviewed-By: con
---
 src/plugins/projectexplorer/gccparser.cpp     |   3 +-
 .../projectexplorerconstants.h                |   8 +-
 src/plugins/qt4projectmanager/makestep.cpp    |   7 +
 .../qt4projectmanager/qt-s60/abldparser.cpp   | 129 ++++++++++++++++++
 .../qt4projectmanager/qt-s60/abldparser.h     |  57 ++++++++
 .../qt4projectmanager/qt-s60/qt-s60.pri       |  14 +-
 .../qt4projectmanager/qt-s60/rvctparser.cpp   | 115 ++++++++++++++++
 .../qt4projectmanager/qt-s60/rvctparser.h     |  61 +++++++++
 .../qt-s60/s60buildparserfactory.cpp          |  59 ++++++++
 .../qt-s60/s60buildparserfactory.h            |  51 +++++++
 .../qt4projectmanager/qt-s60/s60manager.cpp   |   4 +
 11 files changed, 500 insertions(+), 8 deletions(-)
 create mode 100644 src/plugins/qt4projectmanager/qt-s60/abldparser.cpp
 create mode 100644 src/plugins/qt4projectmanager/qt-s60/abldparser.h
 create mode 100644 src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp
 create mode 100644 src/plugins/qt4projectmanager/qt-s60/rvctparser.h
 create mode 100644 src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.cpp
 create mode 100644 src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.h

diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp
index c47b25521d7..378b6b15f22 100644
--- a/src/plugins/projectexplorer/gccparser.cpp
+++ b/src/plugins/projectexplorer/gccparser.cpp
@@ -106,4 +106,5 @@ void GccParser::stdError(const QString & line)
         //qDebug()<<"m_regExpInclude"<<m_regExpIncluded.cap(1)<<m_regExpIncluded.cap(2);
     } else if (lne.startsWith(QLatin1String("collect2:"))) {
         emit addToTaskWindow("", ProjectExplorer::BuildParserInterface::Error, -1, lne);
-    }}
+    }
+}
diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h
index 222f8305362..84d9c32e14a 100644
--- a/src/plugins/projectexplorer/projectexplorerconstants.h
+++ b/src/plugins/projectexplorer/projectexplorerconstants.h
@@ -177,8 +177,12 @@ const char * const FORM_MIMETYPE = "application/x-designer";
 const char * const RESOURCE_MIMETYPE = "application/vnd.nokia.xml.qt.resource";
 
 // build parsers
-const char * const BUILD_PARSER_MSVC    = "BuildParser.MSVC";
-const char * const BUILD_PARSER_GCC     = "BuildParser.Gcc";
+const char * const BUILD_PARSER_MSVC        = "BuildParser.MSVC";
+const char * const BUILD_PARSER_GCC         = "BuildParser.Gcc";
+const char * const BUILD_PARSER_RVCT        = "BuildParser.Rvct";
+const char * const BUILD_PARSER_ABLD_GCCE   = "BuildParser.ABLD.Gcce";
+const char * const BUILD_PARSER_ABLD_WINSCW = "BuildParser.ABLD.Winscw";
+const char * const BUILD_PARSER_ABLD_RVCT   = "BuildParser.ABLD.Rvct";
 
 // settings page
 const char * const PROJECTEXPLORER_CATEGORY            = "ProjectExplorer";
diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp
index fdfdf64057e..65b5f4a2785 100644
--- a/src/plugins/qt4projectmanager/makestep.cpp
+++ b/src/plugins/qt4projectmanager/makestep.cpp
@@ -115,6 +115,13 @@ bool MakeStep::init(const QString &name)
 
     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);
 
diff --git a/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp b/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp
new file mode 100644
index 00000000000..4e1d96b2b2a
--- /dev/null
+++ b/src/plugins/qt4projectmanager/qt-s60/abldparser.cpp
@@ -0,0 +1,129 @@
+/**************************************************************************
+**
+** 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 "abldparser.h"
+#include <utils/qtcassert.h>
+
+#include <projectexplorer/projectexplorerconstants.h>
+#include <projectexplorer/buildparserinterface.h>
+
+#include <extensionsystem/pluginmanager.h>
+
+#include <QDebug>
+
+using namespace Qt4ProjectManager;
+using namespace ProjectExplorer;
+
+AbldParser::AbldParser(const QString &name) :
+    m_name(name)
+{
+    // 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)) ||
+        (m_name == QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_ABLD_WINSCW)))
+    {
+        subparser_name = QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_GCC);
+    }
+    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(const QString &)),
+            this, SIGNAL(enterDirectory(const QString &)));
+    connect(m_subparser, SIGNAL(leaveDirectory(const QString &)),
+            this, SIGNAL(leaveDirectory(const QString &)));
+    connect(m_subparser, SIGNAL(addToOutputWindow(const QString &)),
+            this, SIGNAL(addToOutputWindow(const QString &)));
+    connect(m_subparser, SIGNAL(addToTaskWindow(const QString &, int, int, const QString &)),
+            this, SIGNAL(addToTaskWindow(const QString &, int, int, const QString &)));
+}
+
+AbldParser::~AbldParser()
+{
+    delete m_subparser;
+}
+
+QString AbldParser::name() const
+{
+    return m_name;
+}
+
+void AbldParser::stdOutput(const QString &line)
+{
+    QString lne = line.trimmed();
+    // possible ABLD.bat errors:
+    if (lne.startsWith("Is Perl, version ")) {
+        emit addToTaskWindow(
+                QString(), //filename
+                ProjectExplorer::BuildParserInterface::Error,
+                -1, //linenumber
+                lne);
+        return;
+    }
+
+    QTC_ASSERT(0 != m_subparser, return);
+    // pass on to compiler output parser:
+    m_subparser->stdOutput(lne);
+}
+
+void AbldParser::stdError(const QString &line)
+{
+    QString lne = line.trimmed();
+
+    // possible abld.pl errors:
+    if (lne.startsWith("ABLD ERROR:") ||
+        lne.startsWith("This project does not support ") ||
+        lne.startsWith("Platform ")) {
+        emit addToTaskWindow(
+                QString(), // filename,
+                ProjectExplorer::BuildParserInterface::Error,
+                -1, // linenumber
+                lne);
+        return;
+    }
+
+    QTC_ASSERT(0 != m_subparser, return);
+    // pass on to compiler output parser:
+    m_subparser->stdError(lne);
+}
diff --git a/src/plugins/qt4projectmanager/qt-s60/abldparser.h b/src/plugins/qt4projectmanager/qt-s60/abldparser.h
new file mode 100644
index 00000000000..ff162305014
--- /dev/null
+++ b/src/plugins/qt4projectmanager/qt-s60/abldparser.h
@@ -0,0 +1,57 @@
+/**************************************************************************
+**
+** 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 ABLDPARSER_H
+#define ABLDPARSER_H
+
+#include <projectexplorer/buildparserinterface.h>
+
+#include <QtCore/QRegExp>
+
+namespace Qt4ProjectManager {
+
+class AbldParser : public ProjectExplorer::BuildParserInterface
+{
+    Q_OBJECT
+
+public:
+    AbldParser(const QString & name);
+    ~AbldParser();
+
+    QString name() const;
+    virtual void stdOutput(const QString & line);
+    virtual void stdError(const QString & line);
+private:
+    ProjectExplorer::BuildParserInterface * m_subparser;
+    const QString m_name;
+};
+
+} // namespace Qt4ProjectExplorer
+
+#endif // ABLDPARSER_H
diff --git a/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri b/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri
index c1f2e857652..4c72bf4aead 100644
--- a/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri
+++ b/src/plugins/qt4projectmanager/qt-s60/qt-s60.pri
@@ -1,4 +1,4 @@
-!isEmpty(SUPPORT_QT_S60) {
+!isEmpty(SUPPORT_QT_S60) { 
     message("Adding experimental support for Qt/S60 applications.")
     DEFINES += QTCREATOR_WITH_S60
     SOURCES += $$PWD/s60devices.cpp \
@@ -11,8 +11,10 @@
         $$PWD/s60devicerunconfigurationwidget.cpp \
         $$PWD/serialdevicelister.cpp \
         $$PWD/rvcttoolchain.cpp \
-        $$PWD/s60runconfigbluetoothstarter.cpp
-
+        $$PWD/s60runconfigbluetoothstarter.cpp \
+        $$PWD/s60buildparserfactory.cpp \
+        $$PWD/abldparser.cpp \
+        $$PWD/rvctparser.cpp
     HEADERS += $$PWD/s60devices.h \
         $$PWD/s60devicespreferencepane.h \
         $$PWD/s60manager.h \
@@ -23,8 +25,10 @@
         $$PWD/s60devicerunconfigurationwidget.h \
         $$PWD/serialdevicelister.h \
         $$PWD/rvcttoolchain.h \
-        $$PWD/s60runconfigbluetoothstarter.h
-
+        $$PWD/s60runconfigbluetoothstarter.h \
+        $$PWD/s60buildparserfactory.h \
+        $$PWD/abldparser.h \
+        $$PWD/rvctparser.h
     FORMS += $$PWD/s60devicespreferencepane.ui
     OTHER_FILES += $$PWD/qt-s60-todo.txt
     include(../../../shared/trk/trk.pri)||error("could not include trk.pri")
diff --git a/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp b/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp
new file mode 100644
index 00000000000..b17c954fbac
--- /dev/null
+++ b/src/plugins/qt4projectmanager/qt-s60/rvctparser.cpp
@@ -0,0 +1,115 @@
+/**************************************************************************
+**
+** 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 "rvctparser.h"
+#include <projectexplorer/projectexplorerconstants.h>
+
+using namespace Qt4ProjectManager;
+
+RvctParser::RvctParser() :
+    m_additionalInfo(false)
+{
+    // Start of a error or warning:
+    m_warningOrError.setPattern("^\"([^\\(\\)]+[^\\d])\", line (\\d+):(\\s(Warning|Error):)\\s(.+)$");
+    m_warningOrError.setMinimal(true);
+
+    // Last message for any file with warnings/errors.
+    m_doneWithFile.setPattern("^([^\\(\\)]+[^\\d]):\\s(\\d+) warnings?,\\s(\\d+) errors?$");
+    m_doneWithFile.setMinimal(true);
+
+    // 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) {
+       QString description = m_linkerProblem.cap(2);
+       emit addToTaskWindow(
+           m_linkerProblem.cap(1), //filename
+           ProjectExplorer::BuildParserInterface::Error,
+           -1, //linenumber
+           description);
+   } else if (m_warningOrError.indexIn(lne) > -1) {
+       ProjectExplorer::BuildParserInterface::PatternType type;
+       if (m_warningOrError.cap(4) == "Warning")
+           type = ProjectExplorer::BuildParserInterface::Warning;
+       else if (m_warningOrError.cap(4) == "Error")
+           type = ProjectExplorer::BuildParserInterface::Error;
+       else
+           type = ProjectExplorer::BuildParserInterface::Unknown;
+
+       QString description =  m_warningOrError.cap(5);
+
+       m_additionalInfo = true;
+       m_lastFile = m_warningOrError.cap(1);
+       m_lastLine = m_warningOrError.cap(2).toInt();
+
+       emit addToTaskWindow(
+           m_lastFile, //filename
+           type,
+           m_lastLine, //line number
+           description);
+   } else if (m_doneWithFile.indexIn(lne) > -1) {
+       m_additionalInfo = false;
+   } else if (m_additionalInfo) {
+       // Report any lines after a error/warning message as these contain
+       // additional information on the problem.
+       emit addToTaskWindow(
+           m_lastFile, //filesname
+           ProjectExplorer::BuildParserInterface::Unknown,
+           m_lastLine, //linenumber
+           lne //description
+       );
+   }
+}
diff --git a/src/plugins/qt4projectmanager/qt-s60/rvctparser.h b/src/plugins/qt4projectmanager/qt-s60/rvctparser.h
new file mode 100644
index 00000000000..9f71c19e016
--- /dev/null
+++ b/src/plugins/qt4projectmanager/qt-s60/rvctparser.h
@@ -0,0 +1,61 @@
+/**************************************************************************
+**
+** 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 RVCTPARSER_H
+#define RVCTPARSER_H
+
+#include <projectexplorer/buildparserinterface.h>
+
+#include <QtCore/QRegExp>
+
+namespace Qt4ProjectManager {
+
+class RvctParser : public ProjectExplorer::BuildParserInterface
+{
+    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;
+    int m_lastLine;
+};
+
+} // namespace Qt4ProjectManager
+
+#endif // RVCTPARSER_H
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.cpp b/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.cpp
new file mode 100644
index 00000000000..86657a4a04a
--- /dev/null
+++ b/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.cpp
@@ -0,0 +1,59 @@
+/**************************************************************************
+**
+** 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 <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)));
+}
+
+ProjectExplorer::BuildParserInterface * S60ParserFactory::create(const QString & name) const
+{
+    if (name ==  QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_RVCT))
+    {
+        return new RvctParser();
+    }
+
+    return new AbldParser(name);
+}
+
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.h b/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.h
new file mode 100644
index 00000000000..b3ea2e66067
--- /dev/null
+++ b/src/plugins/qt4projectmanager/qt-s60/s60buildparserfactory.h
@@ -0,0 +1,51 @@
+/**************************************************************************
+**
+** 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/buildparserinterface.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::BuildParserInterface * 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 74e9ceb0b61..fece8f8237c 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp
+++ b/src/plugins/qt4projectmanager/qt-s60/s60manager.cpp
@@ -36,6 +36,7 @@
 #include "rvcttoolchain.h"
 #include "s60emulatorrunconfiguration.h"
 #include "s60devicerunconfiguration.h"
+#include "s60buildparserfactory.h"
 
 #include <coreplugin/icore.h>
 #include <extensionsystem/pluginmanager.h>
@@ -117,6 +118,9 @@ 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>
-- 
GitLab