summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTobias Hunger <qt-info@nokia.com>2009-11-11 17:06:58 +0100
committerTobias Hunger <qt-info@nokia.com>2009-11-12 09:04:18 +0100
commitd151493acca99cae5a1a583ca0f8b6d9d5d7e5b9 (patch)
treefaa500b8ff19c6a7a800bb31ae771b68e7844f86 /src
parent074b111c66133ce137fd883e435f4429ebc4a09f (diff)
downloadqt-creator-d151493acca99cae5a1a583ca0f8b6d9d5d7e5b9.tar.gz
Add buildparser for the QMake step
Add an option to have a buildparser for the qmake step and implement a pretty simple parser. Reviewed-By: dt
Diffstat (limited to 'src')
-rw-r--r--src/plugins/projectexplorer/buildparserfactory.cpp16
-rw-r--r--src/plugins/projectexplorer/buildparserfactory.h10
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp1
-rw-r--r--src/plugins/projectexplorer/projectexplorer.pro7
-rw-r--r--src/plugins/projectexplorer/projectexplorerconstants.h1
-rw-r--r--src/plugins/projectexplorer/qmakeparser.cpp58
-rw-r--r--src/plugins/projectexplorer/qmakeparser.h53
-rw-r--r--src/plugins/qt4projectmanager/qmakestep.cpp6
-rw-r--r--src/plugins/qt4projectmanager/qmakestep.h4
9 files changed, 150 insertions, 6 deletions
diff --git a/src/plugins/projectexplorer/buildparserfactory.cpp b/src/plugins/projectexplorer/buildparserfactory.cpp
index e4b8895eae..cb9326d68b 100644
--- a/src/plugins/projectexplorer/buildparserfactory.cpp
+++ b/src/plugins/projectexplorer/buildparserfactory.cpp
@@ -32,6 +32,7 @@
#include "projectexplorerconstants.h"
#include "gccparser.h"
#include "msvcparser.h"
+#include "qmakeparser.h"
using namespace ProjectExplorer::Internal;
@@ -64,3 +65,18 @@ ProjectExplorer::IBuildParser * MsvcParserFactory::create(const QString & name)
Q_UNUSED(name)
return new MsvcParser();
}
+
+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();
+}
diff --git a/src/plugins/projectexplorer/buildparserfactory.h b/src/plugins/projectexplorer/buildparserfactory.h
index e29570f2ba..f953d63ebf 100644
--- a/src/plugins/projectexplorer/buildparserfactory.h
+++ b/src/plugins/projectexplorer/buildparserfactory.h
@@ -55,6 +55,16 @@ public:
virtual ProjectExplorer::IBuildParser * create(const QString & name) const;
};
+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;
+};
+
} // namespace Internal
} // namespace ProjectExplorer
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 9821118e87..e0c5b18449 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -308,6 +308,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// Build parsers
addAutoReleasedObject(new GccParserFactory);
addAutoReleasedObject(new MsvcParserFactory);
+ addAutoReleasedObject(new QMakeParserFactory);
// Settings page
addAutoReleasedObject(new ProjectExplorerSettingsPage);
diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro
index e0cf043e2b..54a631e837 100644
--- a/src/plugins/projectexplorer/projectexplorer.pro
+++ b/src/plugins/projectexplorer/projectexplorer.pro
@@ -65,7 +65,8 @@ HEADERS += projectexplorer.h \
abstractmakestep.h \
projectexplorersettingspage.h \
projectwelcomepage.h \
- projectwelcomepagewidget.h
+ projectwelcomepagewidget.h \
+ qmakeparser.h
SOURCES += projectexplorer.cpp \
projectwindow.cpp \
buildmanager.cpp \
@@ -118,8 +119,8 @@ SOURCES += projectexplorer.cpp \
projectexplorersettingspage.cpp \
projectwelcomepage.cpp \
projectwelcomepagewidget.cpp \
- corelistenercheckingforrunningbuild.cpp
-
+ corelistenercheckingforrunningbuild.cpp \
+ qmakeparser.cpp
FORMS += processstep.ui \
editorsettingspropertiespage.ui \
runsettingspropertiespage.ui \
diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h
index 5f01e40482..2e2b62be88 100644
--- a/src/plugins/projectexplorer/projectexplorerconstants.h
+++ b/src/plugins/projectexplorer/projectexplorerconstants.h
@@ -177,6 +177,7 @@ 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_QMAKE = "BuildParser.QMake";
const char * const BUILD_PARSER_MSVC = "BuildParser.MSVC";
const char * const BUILD_PARSER_GCC = "BuildParser.Gcc";
const char * const BUILD_PARSER_RVCT = "BuildParser.Rvct";
diff --git a/src/plugins/projectexplorer/qmakeparser.cpp b/src/plugins/projectexplorer/qmakeparser.cpp
new file mode 100644
index 0000000000..4350615a0c
--- /dev/null
+++ b/src/plugins/projectexplorer/qmakeparser.cpp
@@ -0,0 +1,58 @@
+/**************************************************************************
+**
+** 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 "qmakeparser.h"
+#include "projectexplorerconstants.h"
+#include "taskwindow.h"
+
+using namespace ProjectExplorer;
+
+QMakeParser::QMakeParser()
+{
+}
+
+QString QMakeParser::name() const
+{
+ return QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_QMAKE);
+}
+
+void QMakeParser::stdOutput(const QString & line)
+{
+}
+
+void QMakeParser::stdError(const QString & line)
+{
+ QString lne(line.trimmed());
+ if (lne.startsWith("Project ERROR:"))
+ {
+ lne = lne.mid(15);
+ emit addToTaskWindow(QString(), TaskWindow::Error, -1, lne);
+ return;
+ }
+}
diff --git a/src/plugins/projectexplorer/qmakeparser.h b/src/plugins/projectexplorer/qmakeparser.h
new file mode 100644
index 0000000000..5d5a1b02bb
--- /dev/null
+++ b/src/plugins/projectexplorer/qmakeparser.h
@@ -0,0 +1,53 @@
+/**************************************************************************
+**
+** 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 QMAKEPARSER_H
+#define QMAKEPARSER_H
+
+#include "ibuildparser.h"
+
+#include <QtCore/QRegExp>
+
+namespace ProjectExplorer {
+
+class QMakeParser : public ProjectExplorer::IBuildParser
+{
+ Q_OBJECT
+
+public:
+ QMakeParser();
+ QString name() const;
+ virtual void stdOutput(const QString & line);
+ virtual void stdError(const QString & line);
+private:
+};
+
+} // namespace ProjectExplorer
+
+#endif // QMAKEPARSER_H
diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp
index ba8b57f75d..2dd68e7edc 100644
--- a/src/plugins/qt4projectmanager/qmakestep.cpp
+++ b/src/plugins/qt4projectmanager/qmakestep.cpp
@@ -38,6 +38,8 @@
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
+#include <projectexplorer/projectexplorerconstants.h>
+
#include <QFileDialog>
#include <QDir>
#include <QFile>
@@ -48,7 +50,7 @@ using namespace Qt4ProjectManager::Internal;
using namespace ProjectExplorer;
QMakeStep::QMakeStep(Qt4Project *project)
- : AbstractProcessStep(project), m_pro(project), m_forced(false)
+ : AbstractMakeStep(project), m_pro(project), m_forced(false)
{
}
@@ -137,6 +139,8 @@ bool QMakeStep::init(const QString &name)
setCommand(name, program);
setArguments(name, args);
setEnvironment(name, m_pro->environment(bc));
+
+ setBuildParser(ProjectExplorer::Constants::BUILD_PARSER_QMAKE);
return AbstractProcessStep::init(name);
}
diff --git a/src/plugins/qt4projectmanager/qmakestep.h b/src/plugins/qt4projectmanager/qmakestep.h
index d23d471636..f629c66638 100644
--- a/src/plugins/qt4projectmanager/qmakestep.h
+++ b/src/plugins/qt4projectmanager/qmakestep.h
@@ -32,7 +32,7 @@
#include "ui_qmakestep.h"
-#include <projectexplorer/abstractprocessstep.h>
+#include <projectexplorer/abstractmakestep.h>
#include <QStringList>
@@ -60,7 +60,7 @@ public:
class Qt4Project;
-class QMakeStep : public ProjectExplorer::AbstractProcessStep
+class QMakeStep : public ProjectExplorer::AbstractMakeStep
{
Q_OBJECT