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

Add build parsers for S60.

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

Reviewed-By: con
parent 01473fec
......@@ -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);
}}
}
}
......@@ -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";
......
......@@ -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);
......
/**************************************************************************
**
** 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);
}
/**************************************************************************
**
** 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
!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")
......
/**************************************************************************
**
** 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
);
}
}
/**************************************************************************
**
** 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
/**************************************************************************
**
** 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);
}
/**************************************************************************
**
** 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
......@@ -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>
......
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