forked from qt-creator/qt-creator
Rework Build Parser handling
* Rework IBuildParser: * Remove name() method. * Remove enterDirectory and leaveDirectory signals. * Allow chaining of parsers. * Rename IBuildParser to IOutputParser. * Implement GnuMakeParser. * Remove entering/leaving directory related code from all other parsers * Move filename fixup heuristic based on entering/leaving directory massages from gnumake here from AbstractMakeStep. * Add outputParser method to ToolChain: This removes the need to map toolchains to BuildParser names in the BuildSteps. * Enhance AbstractProcessStep to accept a IOutputParser to parse its output. * Remove AbstractMakeStep. * Set the appropriate Parsers in all classes deriving from AbstractProcessStep and append the ToolChain's parser to the parser chain. * Remove BuildParserFactories: There is no more need for them. * Remove constants used to identify the BuildParsers. * Clean up some names: * Replace stdOut with stdOutput. * Replace addToTaskWindow with addTask and addToOutputWindow with addOutput. Do this wherever it is not yet clear that this will end up in the Task/Output window. Reviewed-by: dt
This commit is contained in:
@@ -136,21 +136,6 @@ QString CMakeBuildConfiguration::buildDirectory() const
|
||||
return buildDirectory;
|
||||
}
|
||||
|
||||
QString CMakeBuildConfiguration::buildParser() const
|
||||
{
|
||||
if (!m_toolChain)
|
||||
return QString::null;
|
||||
if (m_toolChain->type() == ProjectExplorer::ToolChain::GCC
|
||||
//|| m_toolChain->type() == ProjectExplorer::ToolChain::LinuxICC
|
||||
|| m_toolChain->type() == ProjectExplorer::ToolChain::MinGW) {
|
||||
return ProjectExplorer::Constants::BUILD_PARSER_GCC;
|
||||
} else if (m_toolChain->type() == ProjectExplorer::ToolChain::MSVC
|
||||
|| m_toolChain->type() == ProjectExplorer::ToolChain::WINCE) {
|
||||
return ProjectExplorer::Constants::BUILD_PARSER_MSVC;
|
||||
}
|
||||
return QString::null;
|
||||
}
|
||||
|
||||
ProjectExplorer::ToolChain::ToolChainType CMakeBuildConfiguration::toolChainType() const
|
||||
{
|
||||
if (m_toolChain)
|
||||
|
@@ -57,7 +57,6 @@ public:
|
||||
void setUseSystemEnvironment(bool b);
|
||||
|
||||
virtual QString buildDirectory() const;
|
||||
QString buildParser() const;
|
||||
|
||||
ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
|
||||
ProjectExplorer::ToolChain *toolChain() const;
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "cmakebuildconfiguration.h"
|
||||
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/gnumakeparser.h>
|
||||
|
||||
#include <QtGui/QFormLayout>
|
||||
#include <QtGui/QGroupBox>
|
||||
@@ -43,14 +44,14 @@ using namespace CMakeProjectManager;
|
||||
using namespace CMakeProjectManager::Internal;
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
MakeStep::MakeStep(BuildConfiguration *bc)
|
||||
: AbstractMakeStep(bc), m_clean(false), m_futureInterface(0)
|
||||
MakeStep::MakeStep(BuildConfiguration *bc) :
|
||||
AbstractProcessStep(bc), m_clean(false), m_futureInterface(0)
|
||||
{
|
||||
m_percentProgress = QRegExp("^\\[\\s*(\\d*)%\\]");
|
||||
}
|
||||
|
||||
MakeStep::MakeStep(MakeStep *bs, BuildConfiguration *bc)
|
||||
: AbstractMakeStep(bs, bc),
|
||||
MakeStep::MakeStep(MakeStep *bs, BuildConfiguration *bc) :
|
||||
AbstractProcessStep(bs, bc),
|
||||
m_clean(bs->m_clean),
|
||||
m_futureInterface(0),
|
||||
m_buildTargets(bs->m_buildTargets),
|
||||
@@ -78,7 +79,7 @@ void MakeStep::restoreFromGlobalMap(const QMap<QString, QVariant> &map)
|
||||
{
|
||||
if (map.value("clean").isValid() && map.value("clean").toBool())
|
||||
m_clean = true;
|
||||
AbstractMakeStep::restoreFromGlobalMap(map);
|
||||
AbstractProcessStep::restoreFromGlobalMap(map);
|
||||
}
|
||||
|
||||
void MakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &map)
|
||||
@@ -87,7 +88,7 @@ void MakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &map)
|
||||
m_additionalArguments = map["additionalArguments"].toStringList();
|
||||
if (map.value("clean").isValid() && map.value("clean").toBool())
|
||||
m_clean = true;
|
||||
AbstractMakeStep::restoreFromLocalMap(map);
|
||||
AbstractProcessStep::restoreFromLocalMap(map);
|
||||
}
|
||||
|
||||
void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
||||
@@ -96,13 +97,12 @@ void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
||||
map["additionalArguments"] = m_additionalArguments;
|
||||
if (m_clean)
|
||||
map["clean"] = true;
|
||||
AbstractMakeStep::storeIntoLocalMap(map);
|
||||
AbstractProcessStep::storeIntoLocalMap(map);
|
||||
}
|
||||
|
||||
bool MakeStep::init()
|
||||
{
|
||||
CMakeBuildConfiguration *bc = cmakeBuildConfiguration();
|
||||
setBuildParser(bc->buildParser());
|
||||
|
||||
setEnabled(true);
|
||||
setWorkingDirectory(bc->buildDirectory());
|
||||
@@ -115,14 +115,18 @@ bool MakeStep::init()
|
||||
setEnvironment(bc->environment());
|
||||
setIgnoreReturnValue(m_clean);
|
||||
|
||||
return AbstractMakeStep::init();
|
||||
setOutputParser(new ProjectExplorer::GnuMakeParser(workingDirectory()));
|
||||
if (bc->toolChain())
|
||||
appendOutputParser(bc->toolChain()->outputParser());
|
||||
|
||||
return AbstractProcessStep::init();
|
||||
}
|
||||
|
||||
void MakeStep::run(QFutureInterface<bool> &fi)
|
||||
{
|
||||
m_futureInterface = &fi;
|
||||
m_futureInterface->setProgressRange(0, 100);
|
||||
AbstractMakeStep::run(fi);
|
||||
AbstractProcessStep::run(fi);
|
||||
m_futureInterface->setProgressValue(100);
|
||||
m_futureInterface->reportFinished();
|
||||
m_futureInterface = 0;
|
||||
@@ -135,7 +139,7 @@ QString MakeStep::name()
|
||||
|
||||
QString MakeStep::displayName()
|
||||
{
|
||||
return "Make";
|
||||
return QLatin1String("Make");
|
||||
}
|
||||
|
||||
BuildStepConfigWidget *MakeStep::createConfigWidget()
|
||||
@@ -156,7 +160,7 @@ void MakeStep::stdOut(const QString &line)
|
||||
if (ok)
|
||||
m_futureInterface->setProgressValue(percent);
|
||||
}
|
||||
AbstractMakeStep::stdOut(line);
|
||||
AbstractProcessStep::stdOutput(line);
|
||||
}
|
||||
|
||||
bool MakeStep::buildsTarget(const QString &target) const
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#ifndef MAKESTEP_H
|
||||
#define MAKESTEP_H
|
||||
|
||||
#include <projectexplorer/abstractmakestep.h>
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QLineEdit;
|
||||
@@ -43,7 +43,7 @@ namespace Internal {
|
||||
|
||||
class CMakeBuildConfiguration;
|
||||
|
||||
class MakeStep : public ProjectExplorer::AbstractMakeStep
|
||||
class MakeStep : public ProjectExplorer::AbstractProcessStep
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class MakeStepConfigWidget; // TODO remove
|
||||
|
@@ -36,7 +36,7 @@
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <projectexplorer/gnumakeparser.h>
|
||||
#include <coreplugin/variablemanager.h>
|
||||
|
||||
#include <QtGui/QFormLayout>
|
||||
@@ -48,13 +48,13 @@
|
||||
using namespace GenericProjectManager;
|
||||
using namespace GenericProjectManager::Internal;
|
||||
|
||||
GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildConfiguration *bc)
|
||||
: AbstractMakeStep(bc)
|
||||
GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildConfiguration *bc) :
|
||||
AbstractProcessStep(bc)
|
||||
{
|
||||
}
|
||||
|
||||
GenericMakeStep::GenericMakeStep(GenericMakeStep *bs, ProjectExplorer::BuildConfiguration *bc)
|
||||
: AbstractMakeStep(bs, bc)
|
||||
GenericMakeStep::GenericMakeStep(GenericMakeStep *bs, ProjectExplorer::BuildConfiguration *bc) :
|
||||
AbstractProcessStep(bs, bc)
|
||||
{
|
||||
m_buildTargets = bs->m_buildTargets;
|
||||
m_makeArguments = bs->m_makeArguments;
|
||||
@@ -73,9 +73,6 @@ GenericBuildConfiguration *GenericMakeStep::genericBuildConfiguration() const
|
||||
bool GenericMakeStep::init()
|
||||
{
|
||||
GenericBuildConfiguration *bc = genericBuildConfiguration();
|
||||
//TODO
|
||||
const QString buildParser = genericBuildConfiguration()->genericProject()->buildParser(bc);
|
||||
setBuildParser(buildParser);
|
||||
|
||||
setEnabled(true);
|
||||
Core::VariableManager *vm = Core::VariableManager::instance();
|
||||
@@ -87,7 +84,12 @@ bool GenericMakeStep::init()
|
||||
setArguments(replacedArguments());
|
||||
|
||||
setEnvironment(bc->environment());
|
||||
return AbstractMakeStep::init();
|
||||
|
||||
setOutputParser(new ProjectExplorer::GnuMakeParser(buildDir));
|
||||
if (bc->genericProject()->toolChain())
|
||||
appendOutputParser(bc->genericProject()->toolChain()->outputParser());
|
||||
|
||||
return AbstractProcessStep::init();
|
||||
}
|
||||
|
||||
void GenericMakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &map)
|
||||
@@ -95,7 +97,7 @@ void GenericMakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &map)
|
||||
m_buildTargets = map.value("buildTargets").toStringList();
|
||||
m_makeArguments = map.value("makeArguments").toStringList();
|
||||
m_makeCommand = map.value("makeCommand").toString();
|
||||
ProjectExplorer::AbstractMakeStep::restoreFromLocalMap(map);
|
||||
ProjectExplorer::AbstractProcessStep::restoreFromLocalMap(map);
|
||||
}
|
||||
|
||||
void GenericMakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
||||
@@ -103,7 +105,7 @@ void GenericMakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
||||
map["buildTargets"] = m_buildTargets;
|
||||
map["makeArguments"] = m_makeArguments;
|
||||
map["makeCommand"] = m_makeCommand;
|
||||
ProjectExplorer::AbstractMakeStep::storeIntoLocalMap(map);
|
||||
ProjectExplorer::AbstractProcessStep::storeIntoLocalMap(map);
|
||||
}
|
||||
|
||||
QStringList GenericMakeStep::replacedArguments() const
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#ifndef GENERICMAKESTEP_H
|
||||
#define GENERICMAKESTEP_H
|
||||
|
||||
#include <projectexplorer/abstractmakestep.h>
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QListWidgetItem;
|
||||
@@ -51,7 +51,7 @@ struct GenericMakeStepSettings
|
||||
|
||||
};
|
||||
|
||||
class GenericMakeStep : public ProjectExplorer::AbstractMakeStep
|
||||
class GenericMakeStep : public ProjectExplorer::AbstractProcessStep
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class GenericMakeStepConfigWidget; // TODO remove again?
|
||||
|
@@ -424,28 +424,6 @@ void GenericProject::setToolChainType(ProjectExplorer::ToolChain::ToolChainType
|
||||
}
|
||||
}
|
||||
|
||||
QString GenericProject::buildParser(BuildConfiguration *configuration) const
|
||||
{
|
||||
Q_UNUSED(configuration)
|
||||
if (m_toolChain) {
|
||||
switch (m_toolChain->type()) {
|
||||
case ProjectExplorer::ToolChain::GCC:
|
||||
//case ProjectExplorer::ToolChain::LinuxICC:
|
||||
case ProjectExplorer::ToolChain::MinGW:
|
||||
return QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_GCC);
|
||||
|
||||
case ProjectExplorer::ToolChain::MSVC:
|
||||
case ProjectExplorer::ToolChain::WINCE:
|
||||
return ProjectExplorer::Constants::BUILD_PARSER_MSVC;
|
||||
|
||||
default:
|
||||
break;
|
||||
} // switch
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
ProjectExplorer::ToolChain *GenericProject::toolChain() const
|
||||
{
|
||||
return m_toolChain;
|
||||
|
@@ -103,7 +103,6 @@ public:
|
||||
virtual QStringList files(FilesMode fileMode) const;
|
||||
|
||||
QStringList targets() const;
|
||||
QString buildParser(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||
ProjectExplorer::ToolChain *toolChain() const;
|
||||
|
||||
bool setFiles(const QStringList &filePaths);
|
||||
|
@@ -1,210 +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 "abstractmakestep.h"
|
||||
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "project.h"
|
||||
#include "buildconfiguration.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
|
||||
using ExtensionSystem::PluginManager;
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace {
|
||||
bool debug = false;
|
||||
}
|
||||
|
||||
AbstractMakeStep::AbstractMakeStep(BuildConfiguration *bc)
|
||||
: AbstractProcessStep(bc),
|
||||
m_buildParser(0)
|
||||
{
|
||||
}
|
||||
|
||||
AbstractMakeStep::AbstractMakeStep(AbstractMakeStep *bs, BuildConfiguration *bc)
|
||||
: AbstractProcessStep(bs, bc),
|
||||
m_buildParser(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AbstractMakeStep::~AbstractMakeStep()
|
||||
{
|
||||
delete m_buildParser;
|
||||
m_buildParser = 0;
|
||||
}
|
||||
|
||||
bool AbstractMakeStep::init()
|
||||
{
|
||||
m_openDirectories.clear();
|
||||
addDirectory(workingDirectory());
|
||||
|
||||
return AbstractProcessStep::init();
|
||||
}
|
||||
|
||||
QString AbstractMakeStep::buildParser() const
|
||||
{
|
||||
return m_buildParserName;
|
||||
}
|
||||
|
||||
void AbstractMakeStep::setBuildParser(const QString &parser)
|
||||
{
|
||||
// Nothing to do?
|
||||
if (m_buildParserName == parser)
|
||||
return;
|
||||
|
||||
// Clean up
|
||||
delete m_buildParser;
|
||||
m_buildParser = 0;
|
||||
m_buildParserName = QString::null;
|
||||
|
||||
// Now look for new parser
|
||||
QList<IBuildParserFactory *> buildParserFactories =
|
||||
ExtensionSystem::PluginManager::instance()->getObjects<ProjectExplorer::IBuildParserFactory>();
|
||||
|
||||
foreach (IBuildParserFactory * factory, buildParserFactories)
|
||||
if (factory->canCreate(parser)) {
|
||||
m_buildParser = factory->create(parser);
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_buildParser) {
|
||||
m_buildParserName = parser;
|
||||
connect(m_buildParser, SIGNAL(addToOutputWindow(QString)),
|
||||
this, SIGNAL(addToOutputWindow(QString)),
|
||||
Qt::DirectConnection);
|
||||
connect(m_buildParser, SIGNAL(addToTaskWindow(ProjectExplorer::TaskWindow::Task)),
|
||||
this, SLOT(slotAddToTaskWindow(ProjectExplorer::TaskWindow::Task)),
|
||||
Qt::DirectConnection);
|
||||
connect(m_buildParser, SIGNAL(enterDirectory(QString)),
|
||||
this, SLOT(addDirectory(QString)),
|
||||
Qt::DirectConnection);
|
||||
connect(m_buildParser, SIGNAL(leaveDirectory(QString)),
|
||||
this, SLOT(removeDirectory(QString)),
|
||||
Qt::DirectConnection);
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractMakeStep::slotAddToTaskWindow(const TaskWindow::Task &task)
|
||||
{
|
||||
TaskWindow::Task editable(task);
|
||||
QString filePath = QDir::cleanPath(task.file.trimmed());
|
||||
if (!filePath.isEmpty() && !QDir::isAbsolutePath(filePath)) {
|
||||
// We have no save way to decide which file in which subfolder
|
||||
// is meant. Therefore we apply following heuristics:
|
||||
// 1. Search for unique file in directories currently indicated as open by GNU make
|
||||
// (Enter directory xxx, Leave directory xxx...) + current directory
|
||||
// 3. Check if file is unique in whole project
|
||||
// 4. Otherwise give up
|
||||
|
||||
QList<QFileInfo> possibleFiles;
|
||||
foreach (const QString &dir, m_openDirectories) {
|
||||
QFileInfo candidate(dir + QLatin1Char('/') + filePath);
|
||||
if (debug)
|
||||
qDebug() << "Checking path " << candidate.filePath();
|
||||
if (candidate.exists()
|
||||
&& !possibleFiles.contains(candidate)) {
|
||||
if (debug)
|
||||
qDebug() << candidate.filePath() << "exists!";
|
||||
possibleFiles << candidate;
|
||||
}
|
||||
}
|
||||
if (possibleFiles.count() == 0) {
|
||||
if (debug)
|
||||
qDebug() << "No success. Trying all files in project ...";
|
||||
QString fileName = QFileInfo(filePath).fileName();
|
||||
foreach (const QString &file, buildConfiguration()->project()->files(ProjectExplorer::Project::AllFiles)) {
|
||||
QFileInfo candidate(file);
|
||||
if (candidate.fileName() == fileName) {
|
||||
if (debug)
|
||||
qDebug() << "Found " << file;
|
||||
possibleFiles << candidate;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (possibleFiles.count() == 1) {
|
||||
editable.file = possibleFiles.first().filePath();
|
||||
} else {
|
||||
// More then one filename, so do a better compare
|
||||
// Chop of any "../"
|
||||
while (filePath.startsWith("../"))
|
||||
filePath = filePath.mid(3);
|
||||
int count = 0;
|
||||
QString possibleFilePath;
|
||||
foreach(const QFileInfo & fi, possibleFiles) {
|
||||
if (fi.filePath().endsWith(filePath)) {
|
||||
possibleFilePath = fi.filePath();
|
||||
++count;
|
||||
}
|
||||
}
|
||||
if (count == 1)
|
||||
editable.file = possibleFilePath;
|
||||
else
|
||||
qWarning() << "Could not find absolute location of file " << filePath;
|
||||
}
|
||||
}
|
||||
emit addToTaskWindow(editable);
|
||||
}
|
||||
|
||||
void AbstractMakeStep::addDirectory(const QString &dir)
|
||||
{
|
||||
if (!m_openDirectories.contains(dir))
|
||||
m_openDirectories.insert(dir);
|
||||
}
|
||||
|
||||
void AbstractMakeStep::removeDirectory(const QString &dir)
|
||||
{
|
||||
if (m_openDirectories.contains(dir))
|
||||
m_openDirectories.remove(dir);
|
||||
}
|
||||
|
||||
void AbstractMakeStep::run(QFutureInterface<bool> & fi)
|
||||
{
|
||||
AbstractProcessStep::run(fi);
|
||||
}
|
||||
|
||||
void AbstractMakeStep::stdOut(const QString &line)
|
||||
{
|
||||
if (m_buildParser)
|
||||
m_buildParser->stdOutput(line);
|
||||
AbstractProcessStep::stdOut(line);
|
||||
}
|
||||
|
||||
void AbstractMakeStep::stdError(const QString &line)
|
||||
{
|
||||
if (m_buildParser)
|
||||
m_buildParser->stdError(line);
|
||||
AbstractProcessStep::stdError(line);
|
||||
}
|
@@ -28,29 +28,45 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "abstractprocessstep.h"
|
||||
#include "buildconfiguration.h"
|
||||
#include "buildstep.h"
|
||||
#include "ioutputparser.h"
|
||||
#include "project.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QEventLoop>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtGui/QTextDocument>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
AbstractProcessStep::AbstractProcessStep(BuildConfiguration *bc)
|
||||
: BuildStep(bc), m_timer(0), m_futureInterface(0), m_process(0), m_eventLoop(0)
|
||||
AbstractProcessStep::AbstractProcessStep(BuildConfiguration *bc) :
|
||||
BuildStep(bc), m_timer(0), m_futureInterface(0),
|
||||
m_enabled(true), m_ignoreReturnValue(false),
|
||||
m_process(0), m_eventLoop(0), m_outputParserChain(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AbstractProcessStep::AbstractProcessStep(AbstractProcessStep *bs, BuildConfiguration *bc)
|
||||
: BuildStep(bs, bc), m_timer(0), m_futureInterface(0), m_process(0), m_eventLoop(0)
|
||||
AbstractProcessStep::AbstractProcessStep(AbstractProcessStep *bs,
|
||||
BuildConfiguration *bc) :
|
||||
BuildStep(bs, bc), m_timer(0), m_futureInterface(0),
|
||||
m_enabled(bs->m_enabled), m_ignoreReturnValue(bs->m_ignoreReturnValue),
|
||||
m_process(0), m_eventLoop(0), m_outputParserChain(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AbstractProcessStep::~AbstractProcessStep()
|
||||
{
|
||||
delete m_process;
|
||||
delete m_timer;
|
||||
// do not delete m_futureInterface, we do not own it.
|
||||
delete m_outputParserChain;
|
||||
}
|
||||
|
||||
void AbstractProcessStep::setCommand(const QString &cmd)
|
||||
{
|
||||
m_command = cmd;
|
||||
@@ -61,6 +77,34 @@ QString AbstractProcessStep::workingDirectory() const
|
||||
return m_workingDirectory;
|
||||
}
|
||||
|
||||
void AbstractProcessStep::setOutputParser(ProjectExplorer::IOutputParser *parser)
|
||||
{
|
||||
delete m_outputParserChain;
|
||||
m_outputParserChain = parser;
|
||||
|
||||
if (m_outputParserChain) {
|
||||
connect(parser, SIGNAL(addOutput(QString)),
|
||||
this, SLOT(outputAdded(QString)));
|
||||
connect(parser, SIGNAL(addTask(ProjectExplorer::TaskWindow::Task)),
|
||||
this, SLOT(taskAdded(ProjectExplorer::TaskWindow::Task)));
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractProcessStep::appendOutputParser(ProjectExplorer::IOutputParser *parser)
|
||||
{
|
||||
if (!parser)
|
||||
return;
|
||||
|
||||
QTC_ASSERT(m_outputParserChain, return);
|
||||
m_outputParserChain->appendOutputParser(parser);
|
||||
return;
|
||||
}
|
||||
|
||||
ProjectExplorer::IOutputParser *AbstractProcessStep::outputParser() const
|
||||
{
|
||||
return m_outputParserChain;
|
||||
}
|
||||
|
||||
void AbstractProcessStep::setWorkingDirectory(const QString &workingDirectory)
|
||||
{
|
||||
m_workingDirectory = workingDirectory;
|
||||
@@ -96,7 +140,7 @@ bool AbstractProcessStep::init()
|
||||
return true;
|
||||
}
|
||||
|
||||
void AbstractProcessStep::run(QFutureInterface<bool> & fi)
|
||||
void AbstractProcessStep::run(QFutureInterface<bool> &fi)
|
||||
{
|
||||
m_futureInterface = &fi;
|
||||
if (!m_enabled) {
|
||||
@@ -155,23 +199,22 @@ void AbstractProcessStep::run(QFutureInterface<bool> & fi)
|
||||
|
||||
void AbstractProcessStep::processStarted()
|
||||
{
|
||||
emit addToOutputWindow(tr("<font color=\"#0000ff\">Starting: %1 %2</font>\n").arg(m_command, Qt::escape(m_arguments.join(" "))));
|
||||
emit addOutput(tr("<font color=\"#0000ff\">Starting: %1 %2</font>\n").arg(m_command, Qt::escape(m_arguments.join(" "))));
|
||||
}
|
||||
|
||||
bool AbstractProcessStep::processFinished(int exitCode, QProcess::ExitStatus status)
|
||||
{
|
||||
const bool ok = status == QProcess::NormalExit && (exitCode == 0 || m_ignoreReturnValue);
|
||||
if (ok) {
|
||||
emit addToOutputWindow(tr("<font color=\"#0000ff\">Exited with code %1.</font>").arg(m_process->exitCode()));
|
||||
} else {
|
||||
emit addToOutputWindow(tr("<font color=\"#ff0000\"><b>Exited with code %1.</b></font>").arg(m_process->exitCode()));
|
||||
}
|
||||
if (ok)
|
||||
emit addOutput(tr("<font color=\"#0000ff\">Exited with code %1.</font>").arg(m_process->exitCode()));
|
||||
else
|
||||
emit addOutput(tr("<font color=\"#ff0000\"><b>Exited with code %1.</b></font>").arg(m_process->exitCode()));
|
||||
return ok;
|
||||
}
|
||||
|
||||
void AbstractProcessStep::processStartupFailed()
|
||||
{
|
||||
emit addToOutputWindow(tr("<font color=\"#ff0000\">Could not start process %1 </b></font>").arg(m_command));
|
||||
emit addOutput(tr("<font color=\"#ff0000\">Could not start process %1 </b></font>").arg(m_command));
|
||||
}
|
||||
|
||||
void AbstractProcessStep::processReadyReadStdOutput()
|
||||
@@ -179,13 +222,15 @@ void AbstractProcessStep::processReadyReadStdOutput()
|
||||
m_process->setReadChannel(QProcess::StandardOutput);
|
||||
while (m_process->canReadLine()) {
|
||||
QString line = QString::fromLocal8Bit(m_process->readLine()).trimmed();
|
||||
stdOut(line);
|
||||
stdOutput(line);
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractProcessStep::stdOut(const QString &line)
|
||||
void AbstractProcessStep::stdOutput(const QString &line)
|
||||
{
|
||||
emit addToOutputWindow(Qt::escape(line));
|
||||
if (m_outputParserChain)
|
||||
m_outputParserChain->stdOutput(line);
|
||||
emit addOutput(Qt::escape(line));
|
||||
}
|
||||
|
||||
void AbstractProcessStep::processReadyReadStdError()
|
||||
@@ -199,7 +244,10 @@ void AbstractProcessStep::processReadyReadStdError()
|
||||
|
||||
void AbstractProcessStep::stdError(const QString &line)
|
||||
{
|
||||
emit addToOutputWindow(QLatin1String("<font color=\"#ff0000\">") + Qt::escape(line) + QLatin1String("</font>"));
|
||||
if (m_outputParserChain)
|
||||
m_outputParserChain->stdError(line);
|
||||
else
|
||||
emit addOutput(QLatin1String("<font color=\"#ff0000\">") + Qt::escape(line) + QLatin1String("</font>"));
|
||||
}
|
||||
|
||||
void AbstractProcessStep::checkForCancel()
|
||||
@@ -212,6 +260,54 @@ void AbstractProcessStep::checkForCancel()
|
||||
}
|
||||
}
|
||||
|
||||
void AbstractProcessStep::taskAdded(const ProjectExplorer::TaskWindow::Task &task)
|
||||
{
|
||||
TaskWindow::Task editable(task);
|
||||
QString filePath = QDir::cleanPath(task.file.trimmed());
|
||||
if (!filePath.isEmpty() && !QDir::isAbsolutePath(filePath)) {
|
||||
// We have no save way to decide which file in which subfolder
|
||||
// is meant. Therefore we apply following heuristics:
|
||||
// 1. Check if file is unique in whole project
|
||||
// 2. Otherwise try again without any ../
|
||||
// 3. give up.
|
||||
|
||||
QList<QFileInfo> possibleFiles;
|
||||
QString fileName = QFileInfo(filePath).fileName();
|
||||
foreach (const QString &file, buildConfiguration()->project()->files(ProjectExplorer::Project::AllFiles)) {
|
||||
QFileInfo candidate(file);
|
||||
if (candidate.fileName() == fileName)
|
||||
possibleFiles << candidate;
|
||||
}
|
||||
|
||||
if (possibleFiles.count() == 1) {
|
||||
editable.file = possibleFiles.first().filePath();
|
||||
} else {
|
||||
// More then one filename, so do a better compare
|
||||
// Chop of any "../"
|
||||
while (filePath.startsWith("../"))
|
||||
filePath = filePath.mid(3);
|
||||
int count = 0;
|
||||
QString possibleFilePath;
|
||||
foreach(const QFileInfo &fi, possibleFiles) {
|
||||
if (fi.filePath().endsWith(filePath)) {
|
||||
possibleFilePath = fi.filePath();
|
||||
++count;
|
||||
}
|
||||
}
|
||||
if (count == 1)
|
||||
editable.file = possibleFilePath;
|
||||
else
|
||||
qWarning() << "Could not find absolute location of file " << filePath;
|
||||
}
|
||||
}
|
||||
emit addTask(editable);
|
||||
}
|
||||
|
||||
void AbstractProcessStep::outputAdded(const QString &string)
|
||||
{
|
||||
emit addOutput(string);
|
||||
}
|
||||
|
||||
void AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus)
|
||||
{
|
||||
QString line = QString::fromLocal8Bit(m_process->readAllStandardError()).trimmed();
|
||||
@@ -220,7 +316,7 @@ void AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus)
|
||||
|
||||
line = QString::fromLocal8Bit(m_process->readAllStandardOutput()).trimmed();
|
||||
if (!line.isEmpty())
|
||||
stdOut(line);
|
||||
stdOutput(line);
|
||||
|
||||
m_eventLoop->exit(0);
|
||||
}
|
||||
|
@@ -38,10 +38,13 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QEventLoop;
|
||||
class QTimer;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class IOutputParser;
|
||||
|
||||
/*!
|
||||
AbstractProcessStep is a convenience class, which can be used as a base class instead of BuildStep.
|
||||
It should be used as a base class if your buildstep just needs to run a process.
|
||||
@@ -67,6 +70,8 @@ class PROJECTEXPLORER_EXPORT AbstractProcessStep : public BuildStep
|
||||
public:
|
||||
AbstractProcessStep(BuildConfiguration *bc);
|
||||
AbstractProcessStep(AbstractProcessStep *bs, BuildConfiguration *bc);
|
||||
virtual ~AbstractProcessStep();
|
||||
|
||||
/// reimplemented from BuildStep::init()
|
||||
/// You need to call this from YourBuildStep::init()
|
||||
virtual bool init();
|
||||
@@ -105,10 +110,17 @@ public:
|
||||
/// should be called from init()
|
||||
void setEnvironment(Environment env);
|
||||
|
||||
// TODO can I remove this?
|
||||
QString workingDirectory() const;
|
||||
protected:
|
||||
|
||||
// derived classes needs to call this function
|
||||
/// Delete all existing output parsers and start a new chain with the
|
||||
/// given parser.
|
||||
void setOutputParser(ProjectExplorer::IOutputParser *parser);
|
||||
/// Append the given output parser to the existing chain of parsers.
|
||||
void appendOutputParser(ProjectExplorer::IOutputParser *parser);
|
||||
ProjectExplorer::IOutputParser *outputParser() const;
|
||||
|
||||
protected:
|
||||
/// Called after the process is started
|
||||
/// the default implementation adds a process started message to the output message
|
||||
virtual void processStarted();
|
||||
@@ -121,18 +133,22 @@ protected:
|
||||
/// Called for each line of output on stdOut()
|
||||
/// the default implementation adds the line to the
|
||||
/// application output window
|
||||
virtual void stdOut(const QString &line);
|
||||
virtual void stdOutput(const QString &line);
|
||||
/// Called for each line of output on StdErrror()
|
||||
/// the default implementation adds the line to the
|
||||
/// application output window
|
||||
virtual void stdError(const QString &line);
|
||||
|
||||
private slots:
|
||||
void processReadyReadStdOutput();
|
||||
void processReadyReadStdError();
|
||||
void slotProcessFinished(int, QProcess::ExitStatus);
|
||||
void checkForCancel();
|
||||
private:
|
||||
|
||||
void taskAdded(const ProjectExplorer::TaskWindow::Task &task);
|
||||
void outputAdded(const QString &string);
|
||||
|
||||
private:
|
||||
QTimer *m_timer;
|
||||
QFutureInterface<bool> *m_futureInterface;
|
||||
QString m_workingDirectory;
|
||||
@@ -143,6 +159,7 @@ private:
|
||||
QProcess *m_process;
|
||||
QEventLoop *m_eventLoop;
|
||||
ProjectExplorer::Environment m_environment;
|
||||
ProjectExplorer::IOutputParser *m_outputParserChain;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
@@ -132,9 +132,9 @@ void BuildManager::cancel()
|
||||
// (And we want those to be before the cancel message.)
|
||||
QTimer::singleShot(0, this, SLOT(emitCancelMessage()));
|
||||
|
||||
disconnect(m_currentBuildStep, SIGNAL(addToTaskWindow(ProjectExplorer::TaskWindow::Task)),
|
||||
disconnect(m_currentBuildStep, SIGNAL(addTask(ProjectExplorer::TaskWindow::Task)),
|
||||
this, SLOT(addToTaskWindow(ProjectExplorer::TaskWindow::Task)));
|
||||
disconnect(m_currentBuildStep, SIGNAL(addToOutputWindow(QString)),
|
||||
disconnect(m_currentBuildStep, SIGNAL(addOutput(QString)),
|
||||
this, SLOT(addToOutputWindow(QString)));
|
||||
decrementActiveBuildSteps(m_currentBuildStep->buildConfiguration()->project());
|
||||
|
||||
@@ -269,9 +269,9 @@ void BuildManager::nextBuildQueue()
|
||||
if (m_canceling)
|
||||
return;
|
||||
|
||||
disconnect(m_currentBuildStep, SIGNAL(addToTaskWindow(ProjectExplorer::TaskWindow::Task)),
|
||||
disconnect(m_currentBuildStep, SIGNAL(addTask(ProjectExplorer::TaskWindow::Task)),
|
||||
this, SLOT(addToTaskWindow(ProjectExplorer::TaskWindow::Task)));
|
||||
disconnect(m_currentBuildStep, SIGNAL(addToOutputWindow(QString)),
|
||||
disconnect(m_currentBuildStep, SIGNAL(addOutput(QString)),
|
||||
this, SLOT(addToOutputWindow(QString)));
|
||||
|
||||
++m_progress;
|
||||
@@ -311,9 +311,9 @@ void BuildManager::nextStep()
|
||||
m_currentBuildStep = m_buildQueue.front();
|
||||
m_buildQueue.pop_front();
|
||||
|
||||
connect(m_currentBuildStep, SIGNAL(addToTaskWindow(ProjectExplorer::TaskWindow::Task)),
|
||||
connect(m_currentBuildStep, SIGNAL(addTask(ProjectExplorer::TaskWindow::Task)),
|
||||
this, SLOT(addToTaskWindow(ProjectExplorer::TaskWindow::Task)));
|
||||
connect(m_currentBuildStep, SIGNAL(addToOutputWindow(QString)),
|
||||
connect(m_currentBuildStep, SIGNAL(addOutput(QString)),
|
||||
this, SLOT(addToOutputWindow(QString)));
|
||||
|
||||
bool init = m_currentBuildStep->init();
|
||||
|
@@ -1,66 +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 "buildparserfactory.h"
|
||||
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "gccparser.h"
|
||||
#include "msvcparser.h"
|
||||
|
||||
using namespace ProjectExplorer::Internal;
|
||||
|
||||
GccParserFactory::~GccParserFactory()
|
||||
{
|
||||
}
|
||||
|
||||
bool GccParserFactory::canCreate(const QString & name) const
|
||||
{
|
||||
return (name == Constants::BUILD_PARSER_GCC);
|
||||
}
|
||||
|
||||
ProjectExplorer::IBuildParser * GccParserFactory::create(const QString & name) const
|
||||
{
|
||||
Q_UNUSED(name)
|
||||
return new GccParser();
|
||||
}
|
||||
|
||||
MsvcParserFactory::~MsvcParserFactory()
|
||||
{
|
||||
}
|
||||
|
||||
bool MsvcParserFactory::canCreate(const QString & name) const
|
||||
{
|
||||
return (name == Constants::BUILD_PARSER_MSVC);
|
||||
}
|
||||
|
||||
ProjectExplorer::IBuildParser * MsvcParserFactory::create(const QString & name) const
|
||||
{
|
||||
Q_UNUSED(name)
|
||||
return new MsvcParser();
|
||||
}
|
@@ -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.
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef BUILDPARSERFACTORY_H
|
||||
#define BUILDPARSERFACTORY_H
|
||||
|
||||
#include <projectexplorer/ibuildparser.h>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
class GccParserFactory : public ProjectExplorer::IBuildParserFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GccParserFactory() {}
|
||||
virtual ~GccParserFactory();
|
||||
virtual bool canCreate(const QString & name) const;
|
||||
virtual ProjectExplorer::IBuildParser * create(const QString & name) const;
|
||||
};
|
||||
|
||||
class MsvcParserFactory : public ProjectExplorer::IBuildParserFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MsvcParserFactory() {}
|
||||
virtual ~MsvcParserFactory();
|
||||
virtual bool canCreate(const QString & name) const;
|
||||
virtual ProjectExplorer::IBuildParser * create(const QString & name) const;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // BUILDPARSERFACTORY_H
|
@@ -30,11 +30,11 @@
|
||||
#ifndef BUILDSTEP_H
|
||||
#define BUILDSTEP_H
|
||||
|
||||
#include "ibuildparser.h"
|
||||
#include "projectexplorer_export.h"
|
||||
#include "taskwindow.h"
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtCore/QFutureInterface>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class BuildConfiguration;
|
||||
@@ -109,11 +109,13 @@ public:
|
||||
|
||||
BuildConfiguration *buildConfiguration() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void addToTaskWindow(const ProjectExplorer::TaskWindow::Task &task);
|
||||
// The string is added to the output window
|
||||
signals:
|
||||
// Add a task.
|
||||
void addTask(const ProjectExplorer::TaskWindow::Task &task);
|
||||
// The string is added to the generated output, usually in the output
|
||||
// window.
|
||||
// It should be in html format, that is properly escaped
|
||||
void addToOutputWindow(const QString &string);
|
||||
void addOutput(const QString &string);
|
||||
|
||||
private:
|
||||
BuildConfiguration *m_buildConfiguration;
|
||||
|
@@ -43,39 +43,19 @@ GccParser::GccParser()
|
||||
|
||||
m_regExpLinker.setPattern("^(\\S*)\\(\\S+\\):\\s(.+)$");
|
||||
m_regExpLinker.setMinimal(true);
|
||||
|
||||
//make[4]: Entering directory `/home/kkoehne/dev/ide-explorer/src/plugins/qtscripteditor'
|
||||
m_makeDir.setPattern("^(?:mingw32-)?make.*: (\\w+) directory .(.+).$");
|
||||
m_makeDir.setMinimal(true);
|
||||
}
|
||||
|
||||
QString GccParser::name() const
|
||||
{
|
||||
return QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_GCC);
|
||||
}
|
||||
|
||||
void GccParser::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 GccParser::stdError(const QString & line)
|
||||
void GccParser::stdError(const QString &line)
|
||||
{
|
||||
QString lne = line.trimmed();
|
||||
if (m_regExpLinker.indexIn(lne) > -1) {
|
||||
QString description = m_regExpLinker.cap(2);
|
||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||
description,
|
||||
m_regExpLinker.cap(1) /* filename */,
|
||||
-1 /* linenumber */,
|
||||
Constants::TASK_CATEGORY_COMPILE));
|
||||
return;
|
||||
} else if (m_regExp.indexIn(lne) > -1) {
|
||||
TaskWindow::Task task(TaskWindow::Unknown,
|
||||
m_regExp.cap(6) /* description */,
|
||||
@@ -87,20 +67,24 @@ void GccParser::stdError(const QString & line)
|
||||
else if (m_regExp.cap(5) == "error")
|
||||
task.type = TaskWindow::Error;
|
||||
|
||||
emit addToTaskWindow(task);
|
||||
emit addTask(task);
|
||||
return;
|
||||
} else if (m_regExpIncluded.indexIn(lne) > -1) {
|
||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Unknown,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Unknown,
|
||||
lne /* description */,
|
||||
m_regExpIncluded.cap(1) /* filename */,
|
||||
m_regExpIncluded.cap(2).toInt() /* linenumber */,
|
||||
Constants::TASK_CATEGORY_COMPILE));
|
||||
return;
|
||||
} else if (lne.startsWith(QLatin1String("collect2:")) ||
|
||||
lne.startsWith(QLatin1String("ERROR:")) ||
|
||||
lne == QLatin1String("* cpp failed")) {
|
||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||
lne /* description */,
|
||||
QString() /* filename */,
|
||||
-1 /* linenumber */,
|
||||
Constants::TASK_CATEGORY_COMPILE));
|
||||
return;
|
||||
}
|
||||
IOutputParser::stdError(line);
|
||||
}
|
||||
|
@@ -30,26 +30,24 @@
|
||||
#ifndef GCCPARSER_H
|
||||
#define GCCPARSER_H
|
||||
|
||||
#include "ibuildparser.h"
|
||||
#include "ioutputparser.h"
|
||||
|
||||
#include <QtCore/QRegExp>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class GccParser : public ProjectExplorer::IBuildParser
|
||||
class GccParser : public ProjectExplorer::IOutputParser
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GccParser();
|
||||
QString name() const;
|
||||
virtual void stdOutput(const QString & line);
|
||||
virtual void stdError(const QString & line);
|
||||
virtual void stdError(const QString &line);
|
||||
|
||||
private:
|
||||
QRegExp m_regExp;
|
||||
QRegExp m_regExpIncluded;
|
||||
QRegExp m_regExpLinker;
|
||||
QRegExp m_makeDir;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
95
src/plugins/projectexplorer/gnumakeparser.cpp
Normal file
95
src/plugins/projectexplorer/gnumakeparser.cpp
Normal file
@@ -0,0 +1,95 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** 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 "gnumakeparser.h"
|
||||
#include "taskwindow.h"
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFile>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
GnuMakeParser::GnuMakeParser(const QString &dir)
|
||||
{
|
||||
//make[4]: Entering directory `/some/dir'
|
||||
m_makeDir.setPattern("^(?:mingw32-)?make.*: (\\w+) directory .(.+).$");
|
||||
m_makeDir.setMinimal(true);
|
||||
addDirectory(dir);
|
||||
}
|
||||
|
||||
void GnuMakeParser::stdOutput(const QString &line)
|
||||
{
|
||||
QString lne = line.trimmed();
|
||||
|
||||
if (m_makeDir.indexIn(lne) > -1) {
|
||||
if (m_makeDir.cap(1) == "Leaving")
|
||||
removeDirectory(m_makeDir.cap(2));
|
||||
else
|
||||
addDirectory(m_makeDir.cap(2));
|
||||
return;
|
||||
}
|
||||
|
||||
IOutputParser::stdOutput(line);
|
||||
}
|
||||
|
||||
void GnuMakeParser::addDirectory(const QString &dir)
|
||||
{
|
||||
if (dir.isEmpty() || m_directories.contains(dir))
|
||||
return;
|
||||
m_directories.append(dir);
|
||||
}
|
||||
|
||||
void GnuMakeParser::removeDirectory(const QString &dir)
|
||||
{
|
||||
m_directories.removeAll(dir);
|
||||
}
|
||||
|
||||
void GnuMakeParser::taskAdded(const ProjectExplorer::TaskWindow::Task &task)
|
||||
{
|
||||
ProjectExplorer::TaskWindow::Task editable(task);
|
||||
QString filePath(QDir::cleanPath(task.file.trimmed()));
|
||||
|
||||
if (!filePath.isEmpty() && !QDir::isAbsolutePath(filePath)) {
|
||||
QList<QFileInfo> possibleFiles;
|
||||
foreach (const QString &dir, m_directories) {
|
||||
QFileInfo candidate(dir + QLatin1Char('/') + filePath);
|
||||
if (candidate.exists()
|
||||
&& !possibleFiles.contains(candidate)) {
|
||||
possibleFiles << candidate;
|
||||
}
|
||||
}
|
||||
if (possibleFiles.size() == 1)
|
||||
editable.file = possibleFiles.first().filePath();
|
||||
// Let the Makestep apply additional heuristics (based on
|
||||
// files in ther project) if we can not uniquely
|
||||
// identify the file!
|
||||
}
|
||||
|
||||
IOutputParser::taskAdded(editable);
|
||||
}
|
@@ -27,25 +27,36 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef S60BUILDPARSERFACTORY_H
|
||||
#define S60BUILDPARSERFACTORY_H
|
||||
#ifndef GNUMAKEPARSER_H
|
||||
#define GNUMAKEPARSER_H
|
||||
|
||||
#include <projectexplorer/ibuildparser.h>
|
||||
#include "ioutputparser.h"
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
class S60ParserFactory : public ProjectExplorer::IBuildParserFactory
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class PROJECTEXPLORER_EXPORT GnuMakeParser : public ProjectExplorer::IOutputParser
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
S60ParserFactory() {}
|
||||
virtual ~S60ParserFactory();
|
||||
virtual bool canCreate(const QString & name) const;
|
||||
virtual ProjectExplorer::IBuildParser * create(const QString & name) const;
|
||||
explicit GnuMakeParser(const QString &dir = QString());
|
||||
|
||||
virtual void stdOutput(const QString &line);
|
||||
|
||||
public slots:
|
||||
virtual void taskAdded(const ProjectExplorer::TaskWindow::Task &task);
|
||||
|
||||
private:
|
||||
void addDirectory(const QString &dir);
|
||||
void removeDirectory(const QString &dir);
|
||||
|
||||
QRegExp m_makeDir;
|
||||
QStringList m_directories;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // S60BUILDPARSERFACTORY_H
|
||||
#endif // GNUMAKEPARSER_H
|
@@ -1,38 +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 "ibuildparser.h"
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
IBuildParserFactory::~IBuildParserFactory()
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -27,46 +27,56 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef IBUILDPARSER_H
|
||||
#define IBUILDPARSER_H
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
#include "taskwindow.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
#include "ioutputparser.h"
|
||||
#include "utils/qtcassert.h"
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class PROJECTEXPLORER_EXPORT IBuildParser : public QObject
|
||||
IOutputParser::IOutputParser() : m_parser(0)
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
virtual ~IBuildParser() {}
|
||||
virtual QString name() const = 0;
|
||||
|
||||
virtual void stdOutput(const QString & line) = 0;
|
||||
virtual void stdError(const QString & line) = 0;
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void enterDirectory(const QString &dir);
|
||||
void leaveDirectory(const QString &dir);
|
||||
void addToOutputWindow(const QString & string);
|
||||
void addToTaskWindow(const ProjectExplorer::TaskWindow::Task &task);
|
||||
};
|
||||
|
||||
class PROJECTEXPLORER_EXPORT IBuildParserFactory
|
||||
: public QObject
|
||||
IOutputParser::~IOutputParser()
|
||||
{
|
||||
Q_OBJECT
|
||||
delete m_parser;
|
||||
}
|
||||
|
||||
public:
|
||||
IBuildParserFactory() {}
|
||||
virtual ~IBuildParserFactory();
|
||||
virtual bool canCreate(const QString & name) const = 0;
|
||||
virtual IBuildParser * create(const QString & name) const = 0;
|
||||
};
|
||||
void IOutputParser::appendOutputParser(IOutputParser *parser)
|
||||
{
|
||||
QTC_ASSERT(parser, return);
|
||||
if (m_parser) {
|
||||
m_parser->appendOutputParser(parser);
|
||||
return;
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
m_parser = parser;
|
||||
connect(parser, SIGNAL(addOutput(QString)),
|
||||
this, SLOT(outputAdded(QString)));
|
||||
connect(parser, SIGNAL(addTask(ProjectExplorer::TaskWindow::Task)),
|
||||
this, SLOT(taskAdded(ProjectExplorer::TaskWindow::Task)));
|
||||
}
|
||||
|
||||
#endif // IBUILDPARSER_H
|
||||
void IOutputParser::stdOutput(const QString &line)
|
||||
{
|
||||
if (m_parser)
|
||||
m_parser->stdOutput(line);
|
||||
}
|
||||
|
||||
void IOutputParser::stdError(const QString &line)
|
||||
{
|
||||
if (m_parser)
|
||||
m_parser->stdError(line);
|
||||
}
|
||||
|
||||
void IOutputParser::outputAdded(const QString &string)
|
||||
{
|
||||
emit addOutput(string);
|
||||
}
|
||||
|
||||
void IOutputParser::taskAdded(const ProjectExplorer::TaskWindow::Task &task)
|
||||
{
|
||||
emit addTask(task);
|
||||
}
|
||||
|
||||
}
|
@@ -27,50 +27,54 @@
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef ABSTRACTMAKESTEP_H
|
||||
#define ABSTRACTMAKESTEP_H
|
||||
#ifndef IOUTPUTPARSER_H
|
||||
#define IOUTPUTPARSER_H
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
#include "abstractprocessstep.h"
|
||||
#include "taskwindow.h"
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class BuildStep;
|
||||
class IBuildStepFactory;
|
||||
class Project;
|
||||
}
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class PROJECTEXPLORER_EXPORT AbstractMakeStep : public ProjectExplorer::AbstractProcessStep
|
||||
class PROJECTEXPLORER_EXPORT IOutputParser : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AbstractMakeStep(BuildConfiguration *bc);
|
||||
AbstractMakeStep(AbstractMakeStep *bs, BuildConfiguration *bc);
|
||||
~AbstractMakeStep();
|
||||
virtual bool init();
|
||||
virtual void run(QFutureInterface<bool> &);
|
||||
IOutputParser();
|
||||
virtual ~IOutputParser();
|
||||
|
||||
protected:
|
||||
// derived classes needs to call these functions
|
||||
virtual void stdOut(const QString &line);
|
||||
/// Append a subparser to this parser.
|
||||
/// IOutputParser will take ownership.
|
||||
void appendOutputParser(IOutputParser *parser);
|
||||
|
||||
/// Called once for each line if standard output to parse.
|
||||
virtual void stdOutput(const QString &line);
|
||||
/// Called once for each line if standard error to parse.
|
||||
virtual void stdError(const QString &line);
|
||||
|
||||
// derived classes needs to call this function
|
||||
void setBuildParser(const QString &parser);
|
||||
QString buildParser() const;
|
||||
private slots:
|
||||
void slotAddToTaskWindow(const ProjectExplorer::TaskWindow::Task &task);
|
||||
void addDirectory(const QString &dir);
|
||||
void removeDirectory(const QString &dir);
|
||||
signals:
|
||||
/// Should be emitted whenever some additional information should be
|
||||
/// added to the output.
|
||||
/// Note: This is additional information. There is no need to add each
|
||||
/// line!
|
||||
void addOutput(const QString &string);
|
||||
/// Should be emitted for each task seen in the output.
|
||||
void addTask(const ProjectExplorer::TaskWindow::Task &task);
|
||||
|
||||
public slots:
|
||||
/// Subparsers have their addOutput signal connected to this slot.
|
||||
/// This method can be overwritten to change the string.
|
||||
virtual void outputAdded(const QString &string);
|
||||
/// Subparsers have their addTask signal connected to this slot.
|
||||
/// This method can be overwritten to change the task.
|
||||
virtual void taskAdded(const ProjectExplorer::TaskWindow::Task &task);
|
||||
|
||||
private:
|
||||
QString m_buildParserName;
|
||||
ProjectExplorer::IBuildParser *m_buildParser;
|
||||
QString m_buildConfiguration;
|
||||
QSet<QString> m_openDirectories;
|
||||
IOutputParser *m_parser;
|
||||
};
|
||||
|
||||
} // ProjectExplorer
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
#endif // ABSTRACTMAKESTEP_H
|
||||
#endif // IOUTPUTPARSER_H
|
@@ -38,7 +38,7 @@ class ProjectInterface;
|
||||
class IProjectManager;
|
||||
class SessionManager;
|
||||
class IApplicationOutput;
|
||||
class IBuildParser;
|
||||
class IOutputParser;
|
||||
class GlobalConfigManagerInterface;
|
||||
|
||||
namespace Internal {
|
||||
@@ -53,7 +53,7 @@ Q_DECLARE_METATYPE(ProjectExplorer::IProjectManager*)
|
||||
Q_DECLARE_METATYPE(ProjectExplorer::IApplicationOutput*)
|
||||
Q_DECLARE_METATYPE(ProjectExplorer::Internal::CommandQObject*)
|
||||
Q_DECLARE_METATYPE(QList<ProjectExplorer::Internal::CommandQObject*>)
|
||||
Q_DECLARE_METATYPE(ProjectExplorer::IBuildParser*)
|
||||
Q_DECLARE_METATYPE(ProjectExplorer::IOutputParser*)
|
||||
|
||||
Q_DECLARE_METATYPE(ProjectExplorer::GlobalConfigManagerInterface*)
|
||||
Q_DECLARE_METATYPE(ProjectExplorer::TaskWindow::Task)
|
||||
|
@@ -30,9 +30,6 @@
|
||||
#include "msvcparser.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QDir>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
MsvcParser::MsvcParser()
|
||||
@@ -43,22 +40,11 @@ MsvcParser::MsvcParser()
|
||||
m_linkRegExp.setMinimal(true);
|
||||
}
|
||||
|
||||
QString MsvcParser::name() const
|
||||
{
|
||||
return QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_MSVC);
|
||||
}
|
||||
|
||||
void MsvcParser::stdError(const QString & line)
|
||||
{
|
||||
Q_UNUSED(line)
|
||||
//do nothing
|
||||
}
|
||||
|
||||
void MsvcParser::stdOutput(const QString & line)
|
||||
void MsvcParser::stdOutput(const QString &line)
|
||||
{
|
||||
QString lne = line.trimmed();
|
||||
if (m_compileRegExp.indexIn(lne) > -1 && m_compileRegExp.numCaptures() == 4) {
|
||||
emit addToTaskWindow(TaskWindow::Task(toType(m_compileRegExp.cap(3).toInt()) /* task type */,
|
||||
emit addTask(TaskWindow::Task(toType(m_compileRegExp.cap(3).toInt()) /* task type */,
|
||||
m_compileRegExp.cap(4) /* description */,
|
||||
m_compileRegExp.cap(1) /* filename */,
|
||||
m_compileRegExp.cap(2).toInt() /* linenumber */,
|
||||
@@ -70,13 +56,14 @@ void MsvcParser::stdOutput(const QString & line)
|
||||
if (fileName.contains(QLatin1String("LINK"), Qt::CaseSensitive))
|
||||
fileName.clear();
|
||||
|
||||
emit addToTaskWindow(TaskWindow::Task(toType(m_linkRegExp.cap(2).toInt()) /* task type */,
|
||||
emit addTask(TaskWindow::Task(toType(m_linkRegExp.cap(2).toInt()) /* task type */,
|
||||
m_linkRegExp.cap(3) /* description */,
|
||||
fileName /* filename */,
|
||||
-1 /* line number */,
|
||||
Constants::TASK_CATEGORY_COMPILE));
|
||||
return;
|
||||
}
|
||||
IOutputParser::stdError(line);
|
||||
}
|
||||
|
||||
TaskWindow::TaskType MsvcParser::toType(int number)
|
||||
|
@@ -30,23 +30,23 @@
|
||||
#ifndef MSVCPARSER_H
|
||||
#define MSVCPARSER_H
|
||||
|
||||
#include "ibuildparser.h"
|
||||
#include "ioutputparser.h"
|
||||
#include "taskwindow.h"
|
||||
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QString>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class MsvcParser : public ProjectExplorer::IBuildParser
|
||||
class MsvcParser : public ProjectExplorer::IOutputParser
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MsvcParser();
|
||||
QString name() const;
|
||||
|
||||
virtual void stdOutput(const QString & line);
|
||||
virtual void stdError(const QString & line);
|
||||
virtual void stdOutput(const QString &line);
|
||||
|
||||
private:
|
||||
TaskWindow::TaskType toType(int number);
|
||||
QRegExp m_compileRegExp;
|
||||
|
@@ -74,6 +74,7 @@ bool ProcessStep::init()
|
||||
AbstractProcessStep::setCommand(m_command);
|
||||
AbstractProcessStep::setEnabled(m_enabled);
|
||||
AbstractProcessStep::setArguments(m_arguments);
|
||||
setOutputParser(0);
|
||||
return AbstractProcessStep::init();
|
||||
}
|
||||
|
||||
|
@@ -57,7 +57,6 @@
|
||||
#include "scriptwrappers.h"
|
||||
#include "session.h"
|
||||
#include "sessiondialog.h"
|
||||
#include "buildparserfactory.h"
|
||||
#include "projectexplorersettingspage.h"
|
||||
#include "projectwelcomepage.h"
|
||||
#include "projectwelcomepagewidget.h"
|
||||
@@ -304,10 +303,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
|
||||
addAutoReleasedObject(new ProjectFileWizardExtension);
|
||||
|
||||
// Build parsers
|
||||
addAutoReleasedObject(new GccParserFactory);
|
||||
addAutoReleasedObject(new MsvcParserFactory);
|
||||
|
||||
// Settings page
|
||||
addAutoReleasedObject(new ProjectExplorerSettingsPage);
|
||||
|
||||
|
@@ -19,7 +19,8 @@ HEADERS += projectexplorer.h \
|
||||
session.h \
|
||||
dependenciespanel.h \
|
||||
allprojectsfilter.h \
|
||||
ibuildparser.h \
|
||||
ioutputparser.h \
|
||||
gnumakeparser.h \
|
||||
projectexplorerconstants.h \
|
||||
projectexplorersettings.h \
|
||||
corelistenercheckingforrunningbuild.h \
|
||||
@@ -57,12 +58,10 @@ HEADERS += projectexplorer.h \
|
||||
currentprojectfind.h \
|
||||
toolchain.h \
|
||||
cesdkhandler.h \
|
||||
buildparserfactory.h \
|
||||
gccparser.h \
|
||||
msvcparser.h \
|
||||
filewatcher.h \
|
||||
debugginghelper.h \
|
||||
abstractmakestep.h \
|
||||
projectexplorersettingspage.h \
|
||||
projectwelcomepage.h \
|
||||
projectwelcomepagewidget.h \
|
||||
@@ -71,6 +70,8 @@ SOURCES += projectexplorer.cpp \
|
||||
projectwindow.cpp \
|
||||
buildmanager.cpp \
|
||||
compileoutputwindow.cpp \
|
||||
ioutputparser.cpp \
|
||||
gnumakeparser.cpp \
|
||||
taskwindow.cpp \
|
||||
outputwindow.cpp \
|
||||
persistentsettings.cpp \
|
||||
@@ -85,7 +86,6 @@ SOURCES += projectexplorer.cpp \
|
||||
pluginfilefactory.cpp \
|
||||
buildstep.cpp \
|
||||
buildconfiguration.cpp \
|
||||
ibuildparser.cpp \
|
||||
environment.cpp \
|
||||
buildsettingspropertiespage.cpp \
|
||||
environmenteditmodel.cpp \
|
||||
@@ -110,12 +110,10 @@ SOURCES += projectexplorer.cpp \
|
||||
currentprojectfind.cpp \
|
||||
toolchain.cpp \
|
||||
cesdkhandler.cpp \
|
||||
buildparserfactory.cpp \
|
||||
gccparser.cpp \
|
||||
msvcparser.cpp \
|
||||
filewatcher.cpp \
|
||||
debugginghelper.cpp \
|
||||
abstractmakestep.cpp \
|
||||
projectexplorersettingspage.cpp \
|
||||
projectwelcomepage.cpp \
|
||||
projectwelcomepagewidget.cpp \
|
||||
|
@@ -178,15 +178,6 @@ const char * const CPP_HEADER_MIMETYPE = "text/x-c++hdr";
|
||||
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_RVCT = "BuildParser.Rvct";
|
||||
const char * const BUILD_PARSER_WINSCW = "BuildParser.Winscw";
|
||||
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_SETTINGS_CATEGORY = "K.ProjectExplorer";
|
||||
const char * const PROJECTEXPLORER_SETTINGS_ID = "ProjectExplorer.ProjectExplorer";
|
||||
|
@@ -151,7 +151,6 @@ protected:
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
||||
|
||||
private:
|
||||
// These correspond to ProjectExplorer::BuildParserInterface::PatternType.
|
||||
bool m_includeUnknowns;
|
||||
bool m_includeWarnings;
|
||||
bool m_includeErrors;
|
||||
|
@@ -31,10 +31,12 @@
|
||||
#include "project.h"
|
||||
#include "cesdkhandler.h"
|
||||
#include "projectexplorersettings.h"
|
||||
#include "gccparser.h"
|
||||
#include "msvcparser.h"
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QTemporaryFile>
|
||||
@@ -93,7 +95,6 @@ QStringList ToolChain::availableMSVCVersions()
|
||||
{
|
||||
QSettings registry(MSVC_RegKey, QSettings::NativeFormat);
|
||||
QStringList versions = registry.allKeys();
|
||||
// qDebug() << "AVAILABLE MSVC VERSIONS:" << versions << "at" << MSVC_RegKey;
|
||||
return versions;
|
||||
}
|
||||
|
||||
@@ -241,7 +242,12 @@ void GccToolChain::addToEnvironment(ProjectExplorer::Environment &env)
|
||||
|
||||
QString GccToolChain::makeCommand() const
|
||||
{
|
||||
return "make";
|
||||
return QLatin1String("make");
|
||||
}
|
||||
|
||||
IOutputParser *GccToolChain::outputParser() const
|
||||
{
|
||||
return new GccParser;
|
||||
}
|
||||
|
||||
bool GccToolChain::equals(ToolChain *other) const
|
||||
@@ -268,21 +274,22 @@ bool MinGWToolChain::equals(ToolChain *other) const
|
||||
|
||||
void MinGWToolChain::addToEnvironment(ProjectExplorer::Environment &env)
|
||||
{
|
||||
//qDebug()<<"MinGWToolChain::addToEnvironment";
|
||||
if (m_mingwPath.isEmpty())
|
||||
return;
|
||||
QString binDir = m_mingwPath + "/bin";
|
||||
if (QFileInfo(binDir).exists())
|
||||
env.prependOrSetPath(binDir);
|
||||
// if (QFileInfo(binDir).exists())
|
||||
// qDebug()<<"Adding "<<binDir<<" to the PATH";
|
||||
}
|
||||
|
||||
QString MinGWToolChain::makeCommand() const
|
||||
{
|
||||
return "mingw32-make.exe";
|
||||
return QLatin1String("mingw32-make.exe");
|
||||
}
|
||||
|
||||
IOutputParser *MinGWToolChain::outputParser() const
|
||||
{
|
||||
return new GccParser;
|
||||
}
|
||||
|
||||
MSVCToolChain::MSVCToolChain(const QString &name, bool amd64)
|
||||
: m_name(name), m_valuesSet(false), m_amd64(amd64)
|
||||
@@ -382,7 +389,6 @@ QByteArray MSVCToolChain::predefinedMacros()
|
||||
}
|
||||
QFile::remove(tmpFilePath);
|
||||
}
|
||||
//qDebug() << m_predefinedMacros;
|
||||
return m_predefinedMacros;
|
||||
}
|
||||
|
||||
@@ -412,7 +418,6 @@ void MSVCToolChain::addToEnvironment(ProjectExplorer::Environment &env)
|
||||
varsbat = path + "bin\\amd64\\vcvarsamd64.bat";
|
||||
else
|
||||
varsbat = path + "bin\\vcvars32.bat";
|
||||
// qDebug() << varsbat;
|
||||
if (QFileInfo(varsbat).exists()) {
|
||||
QTemporaryFile tf(QDir::tempPath() + "\\XXXXXX.bat");
|
||||
if (!tf.open())
|
||||
@@ -465,9 +470,14 @@ QString MSVCToolChain::makeCommand() const
|
||||
if (QFileInfo(jom).exists())
|
||||
return jom;
|
||||
else
|
||||
return "jom.exe";
|
||||
return QLatin1String("jom.exe");
|
||||
}
|
||||
return "nmake.exe";
|
||||
return QLatin1String("nmake.exe");
|
||||
}
|
||||
|
||||
IOutputParser *MSVCToolChain::outputParser() const
|
||||
{
|
||||
return new MsvcParser;
|
||||
}
|
||||
|
||||
WinCEToolChain::WinCEToolChain(const QString &name, const QString &platform)
|
||||
@@ -521,14 +531,8 @@ void WinCEToolChain::addToEnvironment(ProjectExplorer::Environment &env)
|
||||
|
||||
path += "/";
|
||||
|
||||
// qDebug()<<"MSVC path"<<path;
|
||||
// qDebug()<<"looking for platform name in"<< path() + "/mkspecs/" + mkspec() +"/qmake.conf";
|
||||
// Find Platform name
|
||||
// qDebug()<<"Platform Name"<<m_platform;
|
||||
|
||||
CeSdkHandler cesdkhandler;
|
||||
cesdkhandler.parse(path);
|
||||
cesdkhandler.find(m_platform).addToEnvironment(env);
|
||||
//qDebug()<<"WinCE Final Environment:";
|
||||
//qDebug()<<env.toStringList();
|
||||
}
|
||||
|
@@ -40,6 +40,7 @@
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class Environment;
|
||||
class IOutputParser;
|
||||
class Project;
|
||||
|
||||
class PROJECTEXPLORER_EXPORT HeaderPath
|
||||
@@ -97,6 +98,7 @@ public:
|
||||
virtual void addToEnvironment(ProjectExplorer::Environment &env) = 0;
|
||||
virtual ToolChainType type() const = 0;
|
||||
virtual QString makeCommand() const = 0;
|
||||
virtual IOutputParser *outputParser() const = 0;
|
||||
|
||||
ToolChain();
|
||||
virtual ~ToolChain();
|
||||
@@ -125,11 +127,13 @@ public:
|
||||
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
||||
virtual ToolChainType type() const;
|
||||
virtual QString makeCommand() const;
|
||||
virtual IOutputParser *outputParser() const;
|
||||
|
||||
protected:
|
||||
virtual bool equals(ToolChain *other) const;
|
||||
QByteArray m_predefinedMacros;
|
||||
QList<HeaderPath> m_systemHeaderPaths;
|
||||
|
||||
private:
|
||||
QString m_gcc;
|
||||
};
|
||||
@@ -142,8 +146,11 @@ public:
|
||||
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
||||
virtual ToolChainType type() const;
|
||||
virtual QString makeCommand() const;
|
||||
virtual IOutputParser *outputParser() const;
|
||||
|
||||
protected:
|
||||
virtual bool equals(ToolChain *other) const;
|
||||
|
||||
private:
|
||||
QString m_mingwPath;
|
||||
};
|
||||
@@ -158,10 +165,13 @@ public:
|
||||
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
||||
virtual ToolChainType type() const;
|
||||
virtual QString makeCommand() const;
|
||||
virtual IOutputParser *outputParser() const;
|
||||
|
||||
protected:
|
||||
virtual bool equals(ToolChain *other) const;
|
||||
QByteArray m_predefinedMacros;
|
||||
QString m_name;
|
||||
|
||||
private:
|
||||
mutable QList<QPair<QString, QString> > m_values;
|
||||
mutable bool m_valuesSet;
|
||||
@@ -178,8 +188,10 @@ public:
|
||||
virtual QList<HeaderPath> systemHeaderPaths();
|
||||
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
||||
virtual ToolChainType type() const;
|
||||
|
||||
protected:
|
||||
virtual bool equals(ToolChain *other) const;
|
||||
|
||||
private:
|
||||
QString m_platform;
|
||||
};
|
||||
|
@@ -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,7 +114,7 @@ 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 "\
|
||||
emit addOutput(tr("<font color=\"#ff0000\">Could not find make command: %1 "\
|
||||
"in the build environment</font>").arg(makeCmd));
|
||||
return false;
|
||||
}
|
||||
@@ -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 (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
|
||||
|
@@ -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
|
||||
|
@@ -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 */,
|
||||
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);
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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)
|
||||
|
@@ -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:
|
||||
|
@@ -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,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||
lne /* description */,
|
||||
QString() /* filename */,
|
||||
-1 /* linenumber */,
|
||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
TASK_CATEGORY_BUILDSYSTEM));
|
||||
return;
|
||||
}
|
||||
if (lne.startsWith("FATAL ERROR:")) {
|
||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||
lne /* description */,
|
||||
QString() /* filename */,
|
||||
-1 /* linenumber */,
|
||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
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,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Unknown,
|
||||
lne /* description */,
|
||||
m_currentFile, m_currentLine,
|
||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
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,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||
lne /* description */,
|
||||
QString() /* filename */,
|
||||
-1 /* linenumber */,
|
||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
TASK_CATEGORY_BUILDSYSTEM));
|
||||
return;
|
||||
}
|
||||
|
||||
if (lne.startsWith("Died at ")) {
|
||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||
lne /* description */,
|
||||
QString() /* filename */,
|
||||
-1 /* linenumber */,
|
||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
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,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Warning, description,
|
||||
m_currentFile,
|
||||
-1 /* linenumber */,
|
||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
TASK_CATEGORY_BUILDSYSTEM));
|
||||
m_waitingForStdErrContinuation = true;
|
||||
return;
|
||||
}
|
||||
if (lne.startsWith("ERROR: ")) {
|
||||
QString description = lne.mid(7);
|
||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error, description,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Error, description,
|
||||
m_currentFile,
|
||||
-1 /* linenumber */,
|
||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
TASK_CATEGORY_BUILDSYSTEM));
|
||||
m_waitingForStdErrContinuation = true;
|
||||
return;
|
||||
}
|
||||
if (m_waitingForStdErrContinuation)
|
||||
{
|
||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Unknown,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Unknown,
|
||||
lne /* description */,
|
||||
m_currentFile,
|
||||
-1 /* linenumber */,
|
||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||
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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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,
|
||||
emit addTask(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) {
|
||||
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,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Unknown, lne,
|
||||
m_lastFile, m_lastLine,
|
||||
Constants::TASK_CATEGORY_COMPILE));
|
||||
TASK_CATEGORY_COMPILE));
|
||||
return;
|
||||
}
|
||||
IOutputParser::stdError(line);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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())
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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>
|
||||
|
@@ -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,
|
||||
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||
m_linkerProblem.cap(2) /* description */,
|
||||
m_linkerProblem.cap(1) /* filename */,
|
||||
-1 /* linenumber */,
|
||||
Constants::TASK_CATEGORY_COMPILE));
|
||||
TASK_CATEGORY_COMPILE));
|
||||
return;
|
||||
}
|
||||
IOutputParser::stdError(line);
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -46,8 +46,6 @@ class GuiAppWizard;
|
||||
class EmptyProjectWizard;
|
||||
class QMakeStepFactory;
|
||||
class MakeStepFactory;
|
||||
class GccParserFactory;
|
||||
class MsvcParserFactory;
|
||||
class EmbeddedPropertiesPage;
|
||||
class GettingStartedWelcomePage;
|
||||
|
||||
|
Reference in New Issue
Block a user