Commit d151493a authored by Tobias Hunger's avatar Tobias Hunger
Browse files

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
parent 074b111c
......@@ -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();
}
......@@ -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
......
......@@ -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);
......
......@@ -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 \
......
......@@ -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";
......
/**************************************************************************
**
** 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;
}
}
/**************************************************************************
**
** 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
......@@ -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);
}
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment