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;
|
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
|
ProjectExplorer::ToolChain::ToolChainType CMakeBuildConfiguration::toolChainType() const
|
||||||
{
|
{
|
||||||
if (m_toolChain)
|
if (m_toolChain)
|
||||||
|
@@ -57,7 +57,6 @@ public:
|
|||||||
void setUseSystemEnvironment(bool b);
|
void setUseSystemEnvironment(bool b);
|
||||||
|
|
||||||
virtual QString buildDirectory() const;
|
virtual QString buildDirectory() const;
|
||||||
QString buildParser() const;
|
|
||||||
|
|
||||||
ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
|
ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
|
||||||
ProjectExplorer::ToolChain *toolChain() const;
|
ProjectExplorer::ToolChain *toolChain() const;
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include "cmakebuildconfiguration.h"
|
#include "cmakebuildconfiguration.h"
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
#include <projectexplorer/gnumakeparser.h>
|
||||||
|
|
||||||
#include <QtGui/QFormLayout>
|
#include <QtGui/QFormLayout>
|
||||||
#include <QtGui/QGroupBox>
|
#include <QtGui/QGroupBox>
|
||||||
@@ -43,14 +44,14 @@ using namespace CMakeProjectManager;
|
|||||||
using namespace CMakeProjectManager::Internal;
|
using namespace CMakeProjectManager::Internal;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
MakeStep::MakeStep(BuildConfiguration *bc)
|
MakeStep::MakeStep(BuildConfiguration *bc) :
|
||||||
: AbstractMakeStep(bc), m_clean(false), m_futureInterface(0)
|
AbstractProcessStep(bc), m_clean(false), m_futureInterface(0)
|
||||||
{
|
{
|
||||||
m_percentProgress = QRegExp("^\\[\\s*(\\d*)%\\]");
|
m_percentProgress = QRegExp("^\\[\\s*(\\d*)%\\]");
|
||||||
}
|
}
|
||||||
|
|
||||||
MakeStep::MakeStep(MakeStep *bs, BuildConfiguration *bc)
|
MakeStep::MakeStep(MakeStep *bs, BuildConfiguration *bc) :
|
||||||
: AbstractMakeStep(bs, bc),
|
AbstractProcessStep(bs, bc),
|
||||||
m_clean(bs->m_clean),
|
m_clean(bs->m_clean),
|
||||||
m_futureInterface(0),
|
m_futureInterface(0),
|
||||||
m_buildTargets(bs->m_buildTargets),
|
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())
|
if (map.value("clean").isValid() && map.value("clean").toBool())
|
||||||
m_clean = true;
|
m_clean = true;
|
||||||
AbstractMakeStep::restoreFromGlobalMap(map);
|
AbstractProcessStep::restoreFromGlobalMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &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();
|
m_additionalArguments = map["additionalArguments"].toStringList();
|
||||||
if (map.value("clean").isValid() && map.value("clean").toBool())
|
if (map.value("clean").isValid() && map.value("clean").toBool())
|
||||||
m_clean = true;
|
m_clean = true;
|
||||||
AbstractMakeStep::restoreFromLocalMap(map);
|
AbstractProcessStep::restoreFromLocalMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
||||||
@@ -96,13 +97,12 @@ void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
|||||||
map["additionalArguments"] = m_additionalArguments;
|
map["additionalArguments"] = m_additionalArguments;
|
||||||
if (m_clean)
|
if (m_clean)
|
||||||
map["clean"] = true;
|
map["clean"] = true;
|
||||||
AbstractMakeStep::storeIntoLocalMap(map);
|
AbstractProcessStep::storeIntoLocalMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MakeStep::init()
|
bool MakeStep::init()
|
||||||
{
|
{
|
||||||
CMakeBuildConfiguration *bc = cmakeBuildConfiguration();
|
CMakeBuildConfiguration *bc = cmakeBuildConfiguration();
|
||||||
setBuildParser(bc->buildParser());
|
|
||||||
|
|
||||||
setEnabled(true);
|
setEnabled(true);
|
||||||
setWorkingDirectory(bc->buildDirectory());
|
setWorkingDirectory(bc->buildDirectory());
|
||||||
@@ -115,14 +115,18 @@ bool MakeStep::init()
|
|||||||
setEnvironment(bc->environment());
|
setEnvironment(bc->environment());
|
||||||
setIgnoreReturnValue(m_clean);
|
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)
|
void MakeStep::run(QFutureInterface<bool> &fi)
|
||||||
{
|
{
|
||||||
m_futureInterface = &fi;
|
m_futureInterface = &fi;
|
||||||
m_futureInterface->setProgressRange(0, 100);
|
m_futureInterface->setProgressRange(0, 100);
|
||||||
AbstractMakeStep::run(fi);
|
AbstractProcessStep::run(fi);
|
||||||
m_futureInterface->setProgressValue(100);
|
m_futureInterface->setProgressValue(100);
|
||||||
m_futureInterface->reportFinished();
|
m_futureInterface->reportFinished();
|
||||||
m_futureInterface = 0;
|
m_futureInterface = 0;
|
||||||
@@ -135,7 +139,7 @@ QString MakeStep::name()
|
|||||||
|
|
||||||
QString MakeStep::displayName()
|
QString MakeStep::displayName()
|
||||||
{
|
{
|
||||||
return "Make";
|
return QLatin1String("Make");
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStepConfigWidget *MakeStep::createConfigWidget()
|
BuildStepConfigWidget *MakeStep::createConfigWidget()
|
||||||
@@ -156,7 +160,7 @@ void MakeStep::stdOut(const QString &line)
|
|||||||
if (ok)
|
if (ok)
|
||||||
m_futureInterface->setProgressValue(percent);
|
m_futureInterface->setProgressValue(percent);
|
||||||
}
|
}
|
||||||
AbstractMakeStep::stdOut(line);
|
AbstractProcessStep::stdOutput(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MakeStep::buildsTarget(const QString &target) const
|
bool MakeStep::buildsTarget(const QString &target) const
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
#ifndef MAKESTEP_H
|
#ifndef MAKESTEP_H
|
||||||
#define MAKESTEP_H
|
#define MAKESTEP_H
|
||||||
|
|
||||||
#include <projectexplorer/abstractmakestep.h>
|
#include <projectexplorer/abstractprocessstep.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
@@ -43,7 +43,7 @@ namespace Internal {
|
|||||||
|
|
||||||
class CMakeBuildConfiguration;
|
class CMakeBuildConfiguration;
|
||||||
|
|
||||||
class MakeStep : public ProjectExplorer::AbstractMakeStep
|
class MakeStep : public ProjectExplorer::AbstractProcessStep
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
friend class MakeStepConfigWidget; // TODO remove
|
friend class MakeStepConfigWidget; // TODO remove
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <projectexplorer/gnumakeparser.h>
|
||||||
#include <coreplugin/variablemanager.h>
|
#include <coreplugin/variablemanager.h>
|
||||||
|
|
||||||
#include <QtGui/QFormLayout>
|
#include <QtGui/QFormLayout>
|
||||||
@@ -48,13 +48,13 @@
|
|||||||
using namespace GenericProjectManager;
|
using namespace GenericProjectManager;
|
||||||
using namespace GenericProjectManager::Internal;
|
using namespace GenericProjectManager::Internal;
|
||||||
|
|
||||||
GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildConfiguration *bc)
|
GenericMakeStep::GenericMakeStep(ProjectExplorer::BuildConfiguration *bc) :
|
||||||
: AbstractMakeStep(bc)
|
AbstractProcessStep(bc)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GenericMakeStep::GenericMakeStep(GenericMakeStep *bs, ProjectExplorer::BuildConfiguration *bc)
|
GenericMakeStep::GenericMakeStep(GenericMakeStep *bs, ProjectExplorer::BuildConfiguration *bc) :
|
||||||
: AbstractMakeStep(bs, bc)
|
AbstractProcessStep(bs, bc)
|
||||||
{
|
{
|
||||||
m_buildTargets = bs->m_buildTargets;
|
m_buildTargets = bs->m_buildTargets;
|
||||||
m_makeArguments = bs->m_makeArguments;
|
m_makeArguments = bs->m_makeArguments;
|
||||||
@@ -73,9 +73,6 @@ GenericBuildConfiguration *GenericMakeStep::genericBuildConfiguration() const
|
|||||||
bool GenericMakeStep::init()
|
bool GenericMakeStep::init()
|
||||||
{
|
{
|
||||||
GenericBuildConfiguration *bc = genericBuildConfiguration();
|
GenericBuildConfiguration *bc = genericBuildConfiguration();
|
||||||
//TODO
|
|
||||||
const QString buildParser = genericBuildConfiguration()->genericProject()->buildParser(bc);
|
|
||||||
setBuildParser(buildParser);
|
|
||||||
|
|
||||||
setEnabled(true);
|
setEnabled(true);
|
||||||
Core::VariableManager *vm = Core::VariableManager::instance();
|
Core::VariableManager *vm = Core::VariableManager::instance();
|
||||||
@@ -87,7 +84,12 @@ bool GenericMakeStep::init()
|
|||||||
setArguments(replacedArguments());
|
setArguments(replacedArguments());
|
||||||
|
|
||||||
setEnvironment(bc->environment());
|
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)
|
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_buildTargets = map.value("buildTargets").toStringList();
|
||||||
m_makeArguments = map.value("makeArguments").toStringList();
|
m_makeArguments = map.value("makeArguments").toStringList();
|
||||||
m_makeCommand = map.value("makeCommand").toString();
|
m_makeCommand = map.value("makeCommand").toString();
|
||||||
ProjectExplorer::AbstractMakeStep::restoreFromLocalMap(map);
|
ProjectExplorer::AbstractProcessStep::restoreFromLocalMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericMakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
void GenericMakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
||||||
@@ -103,7 +105,7 @@ void GenericMakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
|||||||
map["buildTargets"] = m_buildTargets;
|
map["buildTargets"] = m_buildTargets;
|
||||||
map["makeArguments"] = m_makeArguments;
|
map["makeArguments"] = m_makeArguments;
|
||||||
map["makeCommand"] = m_makeCommand;
|
map["makeCommand"] = m_makeCommand;
|
||||||
ProjectExplorer::AbstractMakeStep::storeIntoLocalMap(map);
|
ProjectExplorer::AbstractProcessStep::storeIntoLocalMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList GenericMakeStep::replacedArguments() const
|
QStringList GenericMakeStep::replacedArguments() const
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
#ifndef GENERICMAKESTEP_H
|
#ifndef GENERICMAKESTEP_H
|
||||||
#define GENERICMAKESTEP_H
|
#define GENERICMAKESTEP_H
|
||||||
|
|
||||||
#include <projectexplorer/abstractmakestep.h>
|
#include <projectexplorer/abstractprocessstep.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QListWidgetItem;
|
class QListWidgetItem;
|
||||||
@@ -51,7 +51,7 @@ struct GenericMakeStepSettings
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class GenericMakeStep : public ProjectExplorer::AbstractMakeStep
|
class GenericMakeStep : public ProjectExplorer::AbstractProcessStep
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
friend class GenericMakeStepConfigWidget; // TODO remove again?
|
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
|
ProjectExplorer::ToolChain *GenericProject::toolChain() const
|
||||||
{
|
{
|
||||||
return m_toolChain;
|
return m_toolChain;
|
||||||
|
@@ -103,7 +103,6 @@ public:
|
|||||||
virtual QStringList files(FilesMode fileMode) const;
|
virtual QStringList files(FilesMode fileMode) const;
|
||||||
|
|
||||||
QStringList targets() const;
|
QStringList targets() const;
|
||||||
QString buildParser(ProjectExplorer::BuildConfiguration *configuration) const;
|
|
||||||
ProjectExplorer::ToolChain *toolChain() const;
|
ProjectExplorer::ToolChain *toolChain() const;
|
||||||
|
|
||||||
bool setFiles(const QStringList &filePaths);
|
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 "abstractprocessstep.h"
|
||||||
|
#include "buildconfiguration.h"
|
||||||
#include "buildstep.h"
|
#include "buildstep.h"
|
||||||
|
#include "ioutputparser.h"
|
||||||
#include "project.h"
|
#include "project.h"
|
||||||
|
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
#include <QtCore/QEventLoop>
|
#include <QtCore/QEventLoop>
|
||||||
#include <QtCore/QDebug>
|
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
#include <QtGui/QTextDocument>
|
#include <QtGui/QTextDocument>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
AbstractProcessStep::AbstractProcessStep(BuildConfiguration *bc)
|
AbstractProcessStep::AbstractProcessStep(BuildConfiguration *bc) :
|
||||||
: BuildStep(bc), m_timer(0), m_futureInterface(0), m_process(0), m_eventLoop(0)
|
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)
|
AbstractProcessStep::AbstractProcessStep(AbstractProcessStep *bs,
|
||||||
: BuildStep(bs, bc), m_timer(0), m_futureInterface(0), m_process(0), m_eventLoop(0)
|
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)
|
void AbstractProcessStep::setCommand(const QString &cmd)
|
||||||
{
|
{
|
||||||
m_command = cmd;
|
m_command = cmd;
|
||||||
@@ -61,6 +77,34 @@ QString AbstractProcessStep::workingDirectory() const
|
|||||||
return m_workingDirectory;
|
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)
|
void AbstractProcessStep::setWorkingDirectory(const QString &workingDirectory)
|
||||||
{
|
{
|
||||||
m_workingDirectory = workingDirectory;
|
m_workingDirectory = workingDirectory;
|
||||||
@@ -96,7 +140,7 @@ bool AbstractProcessStep::init()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractProcessStep::run(QFutureInterface<bool> & fi)
|
void AbstractProcessStep::run(QFutureInterface<bool> &fi)
|
||||||
{
|
{
|
||||||
m_futureInterface = &fi;
|
m_futureInterface = &fi;
|
||||||
if (!m_enabled) {
|
if (!m_enabled) {
|
||||||
@@ -155,23 +199,22 @@ void AbstractProcessStep::run(QFutureInterface<bool> & fi)
|
|||||||
|
|
||||||
void AbstractProcessStep::processStarted()
|
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)
|
bool AbstractProcessStep::processFinished(int exitCode, QProcess::ExitStatus status)
|
||||||
{
|
{
|
||||||
const bool ok = status == QProcess::NormalExit && (exitCode == 0 || m_ignoreReturnValue);
|
const bool ok = status == QProcess::NormalExit && (exitCode == 0 || m_ignoreReturnValue);
|
||||||
if (ok) {
|
if (ok)
|
||||||
emit addToOutputWindow(tr("<font color=\"#0000ff\">Exited with code %1.</font>").arg(m_process->exitCode()));
|
emit addOutput(tr("<font color=\"#0000ff\">Exited with code %1.</font>").arg(m_process->exitCode()));
|
||||||
} else {
|
else
|
||||||
emit addToOutputWindow(tr("<font color=\"#ff0000\"><b>Exited with code %1.</b></font>").arg(m_process->exitCode()));
|
emit addOutput(tr("<font color=\"#ff0000\"><b>Exited with code %1.</b></font>").arg(m_process->exitCode()));
|
||||||
}
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractProcessStep::processStartupFailed()
|
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()
|
void AbstractProcessStep::processReadyReadStdOutput()
|
||||||
@@ -179,13 +222,15 @@ void AbstractProcessStep::processReadyReadStdOutput()
|
|||||||
m_process->setReadChannel(QProcess::StandardOutput);
|
m_process->setReadChannel(QProcess::StandardOutput);
|
||||||
while (m_process->canReadLine()) {
|
while (m_process->canReadLine()) {
|
||||||
QString line = QString::fromLocal8Bit(m_process->readLine()).trimmed();
|
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()
|
void AbstractProcessStep::processReadyReadStdError()
|
||||||
@@ -199,7 +244,10 @@ void AbstractProcessStep::processReadyReadStdError()
|
|||||||
|
|
||||||
void AbstractProcessStep::stdError(const QString &line)
|
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()
|
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)
|
void AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus)
|
||||||
{
|
{
|
||||||
QString line = QString::fromLocal8Bit(m_process->readAllStandardError()).trimmed();
|
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();
|
line = QString::fromLocal8Bit(m_process->readAllStandardOutput()).trimmed();
|
||||||
if (!line.isEmpty())
|
if (!line.isEmpty())
|
||||||
stdOut(line);
|
stdOutput(line);
|
||||||
|
|
||||||
m_eventLoop->exit(0);
|
m_eventLoop->exit(0);
|
||||||
}
|
}
|
||||||
|
@@ -38,10 +38,13 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QEventLoop;
|
class QEventLoop;
|
||||||
|
class QTimer;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
|
class IOutputParser;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
AbstractProcessStep is a convenience class, which can be used as a base class instead of BuildStep.
|
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.
|
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:
|
public:
|
||||||
AbstractProcessStep(BuildConfiguration *bc);
|
AbstractProcessStep(BuildConfiguration *bc);
|
||||||
AbstractProcessStep(AbstractProcessStep *bs, BuildConfiguration *bc);
|
AbstractProcessStep(AbstractProcessStep *bs, BuildConfiguration *bc);
|
||||||
|
virtual ~AbstractProcessStep();
|
||||||
|
|
||||||
/// reimplemented from BuildStep::init()
|
/// reimplemented from BuildStep::init()
|
||||||
/// You need to call this from YourBuildStep::init()
|
/// You need to call this from YourBuildStep::init()
|
||||||
virtual bool init();
|
virtual bool init();
|
||||||
@@ -105,10 +110,17 @@ public:
|
|||||||
/// should be called from init()
|
/// should be called from init()
|
||||||
void setEnvironment(Environment env);
|
void setEnvironment(Environment env);
|
||||||
|
|
||||||
// TODO can I remove this?
|
|
||||||
QString workingDirectory() const;
|
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
|
/// Called after the process is started
|
||||||
/// the default implementation adds a process started message to the output message
|
/// the default implementation adds a process started message to the output message
|
||||||
virtual void processStarted();
|
virtual void processStarted();
|
||||||
@@ -121,18 +133,22 @@ protected:
|
|||||||
/// Called for each line of output on stdOut()
|
/// Called for each line of output on stdOut()
|
||||||
/// the default implementation adds the line to the
|
/// the default implementation adds the line to the
|
||||||
/// application output window
|
/// application output window
|
||||||
virtual void stdOut(const QString &line);
|
virtual void stdOutput(const QString &line);
|
||||||
/// Called for each line of output on StdErrror()
|
/// Called for each line of output on StdErrror()
|
||||||
/// the default implementation adds the line to the
|
/// the default implementation adds the line to the
|
||||||
/// application output window
|
/// application output window
|
||||||
virtual void stdError(const QString &line);
|
virtual void stdError(const QString &line);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void processReadyReadStdOutput();
|
void processReadyReadStdOutput();
|
||||||
void processReadyReadStdError();
|
void processReadyReadStdError();
|
||||||
void slotProcessFinished(int, QProcess::ExitStatus);
|
void slotProcessFinished(int, QProcess::ExitStatus);
|
||||||
void checkForCancel();
|
void checkForCancel();
|
||||||
private:
|
|
||||||
|
|
||||||
|
void taskAdded(const ProjectExplorer::TaskWindow::Task &task);
|
||||||
|
void outputAdded(const QString &string);
|
||||||
|
|
||||||
|
private:
|
||||||
QTimer *m_timer;
|
QTimer *m_timer;
|
||||||
QFutureInterface<bool> *m_futureInterface;
|
QFutureInterface<bool> *m_futureInterface;
|
||||||
QString m_workingDirectory;
|
QString m_workingDirectory;
|
||||||
@@ -143,6 +159,7 @@ private:
|
|||||||
QProcess *m_process;
|
QProcess *m_process;
|
||||||
QEventLoop *m_eventLoop;
|
QEventLoop *m_eventLoop;
|
||||||
ProjectExplorer::Environment m_environment;
|
ProjectExplorer::Environment m_environment;
|
||||||
|
ProjectExplorer::IOutputParser *m_outputParserChain;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
@@ -132,9 +132,9 @@ void BuildManager::cancel()
|
|||||||
// (And we want those to be before the cancel message.)
|
// (And we want those to be before the cancel message.)
|
||||||
QTimer::singleShot(0, this, SLOT(emitCancelMessage()));
|
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)));
|
this, SLOT(addToTaskWindow(ProjectExplorer::TaskWindow::Task)));
|
||||||
disconnect(m_currentBuildStep, SIGNAL(addToOutputWindow(QString)),
|
disconnect(m_currentBuildStep, SIGNAL(addOutput(QString)),
|
||||||
this, SLOT(addToOutputWindow(QString)));
|
this, SLOT(addToOutputWindow(QString)));
|
||||||
decrementActiveBuildSteps(m_currentBuildStep->buildConfiguration()->project());
|
decrementActiveBuildSteps(m_currentBuildStep->buildConfiguration()->project());
|
||||||
|
|
||||||
@@ -269,9 +269,9 @@ void BuildManager::nextBuildQueue()
|
|||||||
if (m_canceling)
|
if (m_canceling)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
disconnect(m_currentBuildStep, SIGNAL(addToTaskWindow(ProjectExplorer::TaskWindow::Task)),
|
disconnect(m_currentBuildStep, SIGNAL(addTask(ProjectExplorer::TaskWindow::Task)),
|
||||||
this, SLOT(addToTaskWindow(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)));
|
this, SLOT(addToOutputWindow(QString)));
|
||||||
|
|
||||||
++m_progress;
|
++m_progress;
|
||||||
@@ -311,9 +311,9 @@ void BuildManager::nextStep()
|
|||||||
m_currentBuildStep = m_buildQueue.front();
|
m_currentBuildStep = m_buildQueue.front();
|
||||||
m_buildQueue.pop_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)));
|
this, SLOT(addToTaskWindow(ProjectExplorer::TaskWindow::Task)));
|
||||||
connect(m_currentBuildStep, SIGNAL(addToOutputWindow(QString)),
|
connect(m_currentBuildStep, SIGNAL(addOutput(QString)),
|
||||||
this, SLOT(addToOutputWindow(QString)));
|
this, SLOT(addToOutputWindow(QString)));
|
||||||
|
|
||||||
bool init = m_currentBuildStep->init();
|
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
|
#ifndef BUILDSTEP_H
|
||||||
#define BUILDSTEP_H
|
#define BUILDSTEP_H
|
||||||
|
|
||||||
#include "ibuildparser.h"
|
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
|
#include "taskwindow.h"
|
||||||
|
|
||||||
#include <QtGui/QWidget>
|
|
||||||
#include <QtCore/QFutureInterface>
|
#include <QtCore/QFutureInterface>
|
||||||
|
#include <QtGui/QWidget>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
class BuildConfiguration;
|
class BuildConfiguration;
|
||||||
@@ -109,11 +109,13 @@ public:
|
|||||||
|
|
||||||
BuildConfiguration *buildConfiguration() const;
|
BuildConfiguration *buildConfiguration() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
signals:
|
||||||
void addToTaskWindow(const ProjectExplorer::TaskWindow::Task &task);
|
// Add a task.
|
||||||
// The string is added to the output window
|
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
|
// It should be in html format, that is properly escaped
|
||||||
void addToOutputWindow(const QString &string);
|
void addOutput(const QString &string);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BuildConfiguration *m_buildConfiguration;
|
BuildConfiguration *m_buildConfiguration;
|
||||||
|
@@ -43,39 +43,19 @@ GccParser::GccParser()
|
|||||||
|
|
||||||
m_regExpLinker.setPattern("^(\\S*)\\(\\S+\\):\\s(.+)$");
|
m_regExpLinker.setPattern("^(\\S*)\\(\\S+\\):\\s(.+)$");
|
||||||
m_regExpLinker.setMinimal(true);
|
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
|
void GccParser::stdError(const QString &line)
|
||||||
{
|
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
QString lne = line.trimmed();
|
QString lne = line.trimmed();
|
||||||
if (m_regExpLinker.indexIn(lne) > -1) {
|
if (m_regExpLinker.indexIn(lne) > -1) {
|
||||||
QString description = m_regExpLinker.cap(2);
|
QString description = m_regExpLinker.cap(2);
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error,
|
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||||
description,
|
description,
|
||||||
m_regExpLinker.cap(1) /* filename */,
|
m_regExpLinker.cap(1) /* filename */,
|
||||||
-1 /* linenumber */,
|
-1 /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_COMPILE));
|
Constants::TASK_CATEGORY_COMPILE));
|
||||||
|
return;
|
||||||
} else if (m_regExp.indexIn(lne) > -1) {
|
} else if (m_regExp.indexIn(lne) > -1) {
|
||||||
TaskWindow::Task task(TaskWindow::Unknown,
|
TaskWindow::Task task(TaskWindow::Unknown,
|
||||||
m_regExp.cap(6) /* description */,
|
m_regExp.cap(6) /* description */,
|
||||||
@@ -87,20 +67,24 @@ void GccParser::stdError(const QString & line)
|
|||||||
else if (m_regExp.cap(5) == "error")
|
else if (m_regExp.cap(5) == "error")
|
||||||
task.type = TaskWindow::Error;
|
task.type = TaskWindow::Error;
|
||||||
|
|
||||||
emit addToTaskWindow(task);
|
emit addTask(task);
|
||||||
|
return;
|
||||||
} else if (m_regExpIncluded.indexIn(lne) > -1) {
|
} else if (m_regExpIncluded.indexIn(lne) > -1) {
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Unknown,
|
emit addTask(TaskWindow::Task(TaskWindow::Unknown,
|
||||||
lne /* description */,
|
lne /* description */,
|
||||||
m_regExpIncluded.cap(1) /* filename */,
|
m_regExpIncluded.cap(1) /* filename */,
|
||||||
m_regExpIncluded.cap(2).toInt() /* linenumber */,
|
m_regExpIncluded.cap(2).toInt() /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_COMPILE));
|
Constants::TASK_CATEGORY_COMPILE));
|
||||||
|
return;
|
||||||
} else if (lne.startsWith(QLatin1String("collect2:")) ||
|
} else if (lne.startsWith(QLatin1String("collect2:")) ||
|
||||||
lne.startsWith(QLatin1String("ERROR:")) ||
|
lne.startsWith(QLatin1String("ERROR:")) ||
|
||||||
lne == QLatin1String("* cpp failed")) {
|
lne == QLatin1String("* cpp failed")) {
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error,
|
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||||
lne /* description */,
|
lne /* description */,
|
||||||
QString() /* filename */,
|
QString() /* filename */,
|
||||||
-1 /* linenumber */,
|
-1 /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_COMPILE));
|
Constants::TASK_CATEGORY_COMPILE));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
IOutputParser::stdError(line);
|
||||||
}
|
}
|
||||||
|
@@ -30,26 +30,24 @@
|
|||||||
#ifndef GCCPARSER_H
|
#ifndef GCCPARSER_H
|
||||||
#define GCCPARSER_H
|
#define GCCPARSER_H
|
||||||
|
|
||||||
#include "ibuildparser.h"
|
#include "ioutputparser.h"
|
||||||
|
|
||||||
#include <QtCore/QRegExp>
|
#include <QtCore/QRegExp>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class GccParser : public ProjectExplorer::IBuildParser
|
class GccParser : public ProjectExplorer::IOutputParser
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GccParser();
|
GccParser();
|
||||||
QString name() const;
|
virtual void stdError(const QString &line);
|
||||||
virtual void stdOutput(const QString & line);
|
|
||||||
virtual void stdError(const QString & line);
|
|
||||||
private:
|
private:
|
||||||
QRegExp m_regExp;
|
QRegExp m_regExp;
|
||||||
QRegExp m_regExpIncluded;
|
QRegExp m_regExpIncluded;
|
||||||
QRegExp m_regExpLinker;
|
QRegExp m_regExpLinker;
|
||||||
QRegExp m_makeDir;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // 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
|
#ifndef GNUMAKEPARSER_H
|
||||||
#define S60BUILDPARSERFACTORY_H
|
#define GNUMAKEPARSER_H
|
||||||
|
|
||||||
#include <projectexplorer/ibuildparser.h>
|
#include "ioutputparser.h"
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
#include <QtCore/QRegExp>
|
||||||
namespace Internal {
|
#include <QtCore/QStringList>
|
||||||
|
|
||||||
class S60ParserFactory : public ProjectExplorer::IBuildParserFactory
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
|
class PROJECTEXPLORER_EXPORT GnuMakeParser : public ProjectExplorer::IOutputParser
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
S60ParserFactory() {}
|
explicit GnuMakeParser(const QString &dir = QString());
|
||||||
virtual ~S60ParserFactory();
|
|
||||||
virtual bool canCreate(const QString & name) const;
|
virtual void stdOutput(const QString &line);
|
||||||
virtual ProjectExplorer::IBuildParser * create(const QString & name) const;
|
|
||||||
|
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
|
} // 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
|
#include "ioutputparser.h"
|
||||||
#define IBUILDPARSER_H
|
#include "utils/qtcassert.h"
|
||||||
|
|
||||||
#include "projectexplorer_export.h"
|
|
||||||
#include "taskwindow.h"
|
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
|
||||||
#include <QtCore/QString>
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
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:
|
IOutputParser::~IOutputParser()
|
||||||
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
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
delete m_parser;
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
void IOutputParser::appendOutputParser(IOutputParser *parser)
|
||||||
IBuildParserFactory() {}
|
{
|
||||||
virtual ~IBuildParserFactory();
|
QTC_ASSERT(parser, return);
|
||||||
virtual bool canCreate(const QString & name) const = 0;
|
if (m_parser) {
|
||||||
virtual IBuildParser * create(const QString & name) const = 0;
|
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
|
#ifndef IOUTPUTPARSER_H
|
||||||
#define ABSTRACTMAKESTEP_H
|
#define IOUTPUTPARSER_H
|
||||||
|
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
#include "abstractprocessstep.h"
|
|
||||||
#include "taskwindow.h"
|
#include "taskwindow.h"
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
#include <QtCore/QObject>
|
||||||
class BuildStep;
|
#include <QtCore/QString>
|
||||||
class IBuildStepFactory;
|
|
||||||
class Project;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT AbstractMakeStep : public ProjectExplorer::AbstractProcessStep
|
class PROJECTEXPLORER_EXPORT IOutputParser : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
AbstractMakeStep(BuildConfiguration *bc);
|
IOutputParser();
|
||||||
AbstractMakeStep(AbstractMakeStep *bs, BuildConfiguration *bc);
|
virtual ~IOutputParser();
|
||||||
~AbstractMakeStep();
|
|
||||||
virtual bool init();
|
|
||||||
virtual void run(QFutureInterface<bool> &);
|
|
||||||
|
|
||||||
protected:
|
/// Append a subparser to this parser.
|
||||||
// derived classes needs to call these functions
|
/// IOutputParser will take ownership.
|
||||||
virtual void stdOut(const QString &line);
|
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);
|
virtual void stdError(const QString &line);
|
||||||
|
|
||||||
// derived classes needs to call this function
|
signals:
|
||||||
void setBuildParser(const QString &parser);
|
/// Should be emitted whenever some additional information should be
|
||||||
QString buildParser() const;
|
/// added to the output.
|
||||||
private slots:
|
/// Note: This is additional information. There is no need to add each
|
||||||
void slotAddToTaskWindow(const ProjectExplorer::TaskWindow::Task &task);
|
/// line!
|
||||||
void addDirectory(const QString &dir);
|
void addOutput(const QString &string);
|
||||||
void removeDirectory(const QString &dir);
|
/// 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:
|
private:
|
||||||
QString m_buildParserName;
|
IOutputParser *m_parser;
|
||||||
ProjectExplorer::IBuildParser *m_buildParser;
|
|
||||||
QString m_buildConfiguration;
|
|
||||||
QSet<QString> m_openDirectories;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
#endif // ABSTRACTMAKESTEP_H
|
#endif // IOUTPUTPARSER_H
|
@@ -38,7 +38,7 @@ class ProjectInterface;
|
|||||||
class IProjectManager;
|
class IProjectManager;
|
||||||
class SessionManager;
|
class SessionManager;
|
||||||
class IApplicationOutput;
|
class IApplicationOutput;
|
||||||
class IBuildParser;
|
class IOutputParser;
|
||||||
class GlobalConfigManagerInterface;
|
class GlobalConfigManagerInterface;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -53,7 +53,7 @@ Q_DECLARE_METATYPE(ProjectExplorer::IProjectManager*)
|
|||||||
Q_DECLARE_METATYPE(ProjectExplorer::IApplicationOutput*)
|
Q_DECLARE_METATYPE(ProjectExplorer::IApplicationOutput*)
|
||||||
Q_DECLARE_METATYPE(ProjectExplorer::Internal::CommandQObject*)
|
Q_DECLARE_METATYPE(ProjectExplorer::Internal::CommandQObject*)
|
||||||
Q_DECLARE_METATYPE(QList<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::GlobalConfigManagerInterface*)
|
||||||
Q_DECLARE_METATYPE(ProjectExplorer::TaskWindow::Task)
|
Q_DECLARE_METATYPE(ProjectExplorer::TaskWindow::Task)
|
||||||
|
@@ -30,9 +30,6 @@
|
|||||||
#include "msvcparser.h"
|
#include "msvcparser.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
|
|
||||||
#include <QtCore/QStringList>
|
|
||||||
#include <QtCore/QDir>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
MsvcParser::MsvcParser()
|
MsvcParser::MsvcParser()
|
||||||
@@ -43,26 +40,15 @@ MsvcParser::MsvcParser()
|
|||||||
m_linkRegExp.setMinimal(true);
|
m_linkRegExp.setMinimal(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MsvcParser::name() const
|
void MsvcParser::stdOutput(const QString &line)
|
||||||
{
|
|
||||||
return QLatin1String(ProjectExplorer::Constants::BUILD_PARSER_MSVC);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MsvcParser::stdError(const QString & line)
|
|
||||||
{
|
|
||||||
Q_UNUSED(line)
|
|
||||||
//do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
void MsvcParser::stdOutput(const QString & line)
|
|
||||||
{
|
{
|
||||||
QString lne = line.trimmed();
|
QString lne = line.trimmed();
|
||||||
if (m_compileRegExp.indexIn(lne) > -1 && m_compileRegExp.numCaptures() == 4) {
|
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(4) /* description */,
|
||||||
m_compileRegExp.cap(1) /* filename */,
|
m_compileRegExp.cap(1) /* filename */,
|
||||||
m_compileRegExp.cap(2).toInt() /* linenumber */,
|
m_compileRegExp.cap(2).toInt() /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_COMPILE));
|
Constants::TASK_CATEGORY_COMPILE));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_linkRegExp.indexIn(lne) > -1 && m_linkRegExp.numCaptures() == 3) {
|
if (m_linkRegExp.indexIn(lne) > -1 && m_linkRegExp.numCaptures() == 3) {
|
||||||
@@ -70,13 +56,14 @@ void MsvcParser::stdOutput(const QString & line)
|
|||||||
if (fileName.contains(QLatin1String("LINK"), Qt::CaseSensitive))
|
if (fileName.contains(QLatin1String("LINK"), Qt::CaseSensitive))
|
||||||
fileName.clear();
|
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 */,
|
m_linkRegExp.cap(3) /* description */,
|
||||||
fileName /* filename */,
|
fileName /* filename */,
|
||||||
-1 /* line number */,
|
-1 /* line number */,
|
||||||
Constants::TASK_CATEGORY_COMPILE));
|
Constants::TASK_CATEGORY_COMPILE));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
IOutputParser::stdError(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskWindow::TaskType MsvcParser::toType(int number)
|
TaskWindow::TaskType MsvcParser::toType(int number)
|
||||||
|
@@ -30,23 +30,23 @@
|
|||||||
#ifndef MSVCPARSER_H
|
#ifndef MSVCPARSER_H
|
||||||
#define MSVCPARSER_H
|
#define MSVCPARSER_H
|
||||||
|
|
||||||
#include "ibuildparser.h"
|
#include "ioutputparser.h"
|
||||||
#include "taskwindow.h"
|
#include "taskwindow.h"
|
||||||
|
|
||||||
#include <QtCore/QRegExp>
|
#include <QtCore/QRegExp>
|
||||||
|
#include <QtCore/QString>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class MsvcParser : public ProjectExplorer::IBuildParser
|
class MsvcParser : public ProjectExplorer::IOutputParser
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MsvcParser();
|
MsvcParser();
|
||||||
QString name() const;
|
|
||||||
|
|
||||||
virtual void stdOutput(const QString & line);
|
virtual void stdOutput(const QString &line);
|
||||||
virtual void stdError(const QString & line);
|
|
||||||
private:
|
private:
|
||||||
TaskWindow::TaskType toType(int number);
|
TaskWindow::TaskType toType(int number);
|
||||||
QRegExp m_compileRegExp;
|
QRegExp m_compileRegExp;
|
||||||
|
@@ -74,6 +74,7 @@ bool ProcessStep::init()
|
|||||||
AbstractProcessStep::setCommand(m_command);
|
AbstractProcessStep::setCommand(m_command);
|
||||||
AbstractProcessStep::setEnabled(m_enabled);
|
AbstractProcessStep::setEnabled(m_enabled);
|
||||||
AbstractProcessStep::setArguments(m_arguments);
|
AbstractProcessStep::setArguments(m_arguments);
|
||||||
|
setOutputParser(0);
|
||||||
return AbstractProcessStep::init();
|
return AbstractProcessStep::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -57,7 +57,6 @@
|
|||||||
#include "scriptwrappers.h"
|
#include "scriptwrappers.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
#include "sessiondialog.h"
|
#include "sessiondialog.h"
|
||||||
#include "buildparserfactory.h"
|
|
||||||
#include "projectexplorersettingspage.h"
|
#include "projectexplorersettingspage.h"
|
||||||
#include "projectwelcomepage.h"
|
#include "projectwelcomepage.h"
|
||||||
#include "projectwelcomepagewidget.h"
|
#include "projectwelcomepagewidget.h"
|
||||||
@@ -304,10 +303,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
|
|
||||||
addAutoReleasedObject(new ProjectFileWizardExtension);
|
addAutoReleasedObject(new ProjectFileWizardExtension);
|
||||||
|
|
||||||
// Build parsers
|
|
||||||
addAutoReleasedObject(new GccParserFactory);
|
|
||||||
addAutoReleasedObject(new MsvcParserFactory);
|
|
||||||
|
|
||||||
// Settings page
|
// Settings page
|
||||||
addAutoReleasedObject(new ProjectExplorerSettingsPage);
|
addAutoReleasedObject(new ProjectExplorerSettingsPage);
|
||||||
|
|
||||||
|
@@ -19,7 +19,8 @@ HEADERS += projectexplorer.h \
|
|||||||
session.h \
|
session.h \
|
||||||
dependenciespanel.h \
|
dependenciespanel.h \
|
||||||
allprojectsfilter.h \
|
allprojectsfilter.h \
|
||||||
ibuildparser.h \
|
ioutputparser.h \
|
||||||
|
gnumakeparser.h \
|
||||||
projectexplorerconstants.h \
|
projectexplorerconstants.h \
|
||||||
projectexplorersettings.h \
|
projectexplorersettings.h \
|
||||||
corelistenercheckingforrunningbuild.h \
|
corelistenercheckingforrunningbuild.h \
|
||||||
@@ -57,12 +58,10 @@ HEADERS += projectexplorer.h \
|
|||||||
currentprojectfind.h \
|
currentprojectfind.h \
|
||||||
toolchain.h \
|
toolchain.h \
|
||||||
cesdkhandler.h \
|
cesdkhandler.h \
|
||||||
buildparserfactory.h \
|
|
||||||
gccparser.h \
|
gccparser.h \
|
||||||
msvcparser.h \
|
msvcparser.h \
|
||||||
filewatcher.h \
|
filewatcher.h \
|
||||||
debugginghelper.h \
|
debugginghelper.h \
|
||||||
abstractmakestep.h \
|
|
||||||
projectexplorersettingspage.h \
|
projectexplorersettingspage.h \
|
||||||
projectwelcomepage.h \
|
projectwelcomepage.h \
|
||||||
projectwelcomepagewidget.h \
|
projectwelcomepagewidget.h \
|
||||||
@@ -71,6 +70,8 @@ SOURCES += projectexplorer.cpp \
|
|||||||
projectwindow.cpp \
|
projectwindow.cpp \
|
||||||
buildmanager.cpp \
|
buildmanager.cpp \
|
||||||
compileoutputwindow.cpp \
|
compileoutputwindow.cpp \
|
||||||
|
ioutputparser.cpp \
|
||||||
|
gnumakeparser.cpp \
|
||||||
taskwindow.cpp \
|
taskwindow.cpp \
|
||||||
outputwindow.cpp \
|
outputwindow.cpp \
|
||||||
persistentsettings.cpp \
|
persistentsettings.cpp \
|
||||||
@@ -85,7 +86,6 @@ SOURCES += projectexplorer.cpp \
|
|||||||
pluginfilefactory.cpp \
|
pluginfilefactory.cpp \
|
||||||
buildstep.cpp \
|
buildstep.cpp \
|
||||||
buildconfiguration.cpp \
|
buildconfiguration.cpp \
|
||||||
ibuildparser.cpp \
|
|
||||||
environment.cpp \
|
environment.cpp \
|
||||||
buildsettingspropertiespage.cpp \
|
buildsettingspropertiespage.cpp \
|
||||||
environmenteditmodel.cpp \
|
environmenteditmodel.cpp \
|
||||||
@@ -110,12 +110,10 @@ SOURCES += projectexplorer.cpp \
|
|||||||
currentprojectfind.cpp \
|
currentprojectfind.cpp \
|
||||||
toolchain.cpp \
|
toolchain.cpp \
|
||||||
cesdkhandler.cpp \
|
cesdkhandler.cpp \
|
||||||
buildparserfactory.cpp \
|
|
||||||
gccparser.cpp \
|
gccparser.cpp \
|
||||||
msvcparser.cpp \
|
msvcparser.cpp \
|
||||||
filewatcher.cpp \
|
filewatcher.cpp \
|
||||||
debugginghelper.cpp \
|
debugginghelper.cpp \
|
||||||
abstractmakestep.cpp \
|
|
||||||
projectexplorersettingspage.cpp \
|
projectexplorersettingspage.cpp \
|
||||||
projectwelcomepage.cpp \
|
projectwelcomepage.cpp \
|
||||||
projectwelcomepagewidget.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 FORM_MIMETYPE = "application/x-designer";
|
||||||
const char * const RESOURCE_MIMETYPE = "application/vnd.nokia.xml.qt.resource";
|
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
|
// settings page
|
||||||
const char * const PROJECTEXPLORER_SETTINGS_CATEGORY = "K.ProjectExplorer";
|
const char * const PROJECTEXPLORER_SETTINGS_CATEGORY = "K.ProjectExplorer";
|
||||||
const char * const PROJECTEXPLORER_SETTINGS_ID = "ProjectExplorer.ProjectExplorer";
|
const char * const PROJECTEXPLORER_SETTINGS_ID = "ProjectExplorer.ProjectExplorer";
|
||||||
|
@@ -151,7 +151,6 @@ protected:
|
|||||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// These correspond to ProjectExplorer::BuildParserInterface::PatternType.
|
|
||||||
bool m_includeUnknowns;
|
bool m_includeUnknowns;
|
||||||
bool m_includeWarnings;
|
bool m_includeWarnings;
|
||||||
bool m_includeErrors;
|
bool m_includeErrors;
|
||||||
|
@@ -31,10 +31,12 @@
|
|||||||
#include "project.h"
|
#include "project.h"
|
||||||
#include "cesdkhandler.h"
|
#include "cesdkhandler.h"
|
||||||
#include "projectexplorersettings.h"
|
#include "projectexplorersettings.h"
|
||||||
|
#include "gccparser.h"
|
||||||
|
#include "msvcparser.h"
|
||||||
|
|
||||||
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
#include <QtCore/QDebug>
|
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QTemporaryFile>
|
#include <QtCore/QTemporaryFile>
|
||||||
@@ -93,7 +95,6 @@ QStringList ToolChain::availableMSVCVersions()
|
|||||||
{
|
{
|
||||||
QSettings registry(MSVC_RegKey, QSettings::NativeFormat);
|
QSettings registry(MSVC_RegKey, QSettings::NativeFormat);
|
||||||
QStringList versions = registry.allKeys();
|
QStringList versions = registry.allKeys();
|
||||||
// qDebug() << "AVAILABLE MSVC VERSIONS:" << versions << "at" << MSVC_RegKey;
|
|
||||||
return versions;
|
return versions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,7 +242,12 @@ void GccToolChain::addToEnvironment(ProjectExplorer::Environment &env)
|
|||||||
|
|
||||||
QString GccToolChain::makeCommand() const
|
QString GccToolChain::makeCommand() const
|
||||||
{
|
{
|
||||||
return "make";
|
return QLatin1String("make");
|
||||||
|
}
|
||||||
|
|
||||||
|
IOutputParser *GccToolChain::outputParser() const
|
||||||
|
{
|
||||||
|
return new GccParser;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GccToolChain::equals(ToolChain *other) const
|
bool GccToolChain::equals(ToolChain *other) const
|
||||||
@@ -268,21 +274,22 @@ bool MinGWToolChain::equals(ToolChain *other) const
|
|||||||
|
|
||||||
void MinGWToolChain::addToEnvironment(ProjectExplorer::Environment &env)
|
void MinGWToolChain::addToEnvironment(ProjectExplorer::Environment &env)
|
||||||
{
|
{
|
||||||
//qDebug()<<"MinGWToolChain::addToEnvironment";
|
|
||||||
if (m_mingwPath.isEmpty())
|
if (m_mingwPath.isEmpty())
|
||||||
return;
|
return;
|
||||||
QString binDir = m_mingwPath + "/bin";
|
QString binDir = m_mingwPath + "/bin";
|
||||||
if (QFileInfo(binDir).exists())
|
if (QFileInfo(binDir).exists())
|
||||||
env.prependOrSetPath(binDir);
|
env.prependOrSetPath(binDir);
|
||||||
// if (QFileInfo(binDir).exists())
|
|
||||||
// qDebug()<<"Adding "<<binDir<<" to the PATH";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MinGWToolChain::makeCommand() const
|
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)
|
MSVCToolChain::MSVCToolChain(const QString &name, bool amd64)
|
||||||
: m_name(name), m_valuesSet(false), m_amd64(amd64)
|
: m_name(name), m_valuesSet(false), m_amd64(amd64)
|
||||||
@@ -382,7 +389,6 @@ QByteArray MSVCToolChain::predefinedMacros()
|
|||||||
}
|
}
|
||||||
QFile::remove(tmpFilePath);
|
QFile::remove(tmpFilePath);
|
||||||
}
|
}
|
||||||
//qDebug() << m_predefinedMacros;
|
|
||||||
return m_predefinedMacros;
|
return m_predefinedMacros;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -412,7 +418,6 @@ void MSVCToolChain::addToEnvironment(ProjectExplorer::Environment &env)
|
|||||||
varsbat = path + "bin\\amd64\\vcvarsamd64.bat";
|
varsbat = path + "bin\\amd64\\vcvarsamd64.bat";
|
||||||
else
|
else
|
||||||
varsbat = path + "bin\\vcvars32.bat";
|
varsbat = path + "bin\\vcvars32.bat";
|
||||||
// qDebug() << varsbat;
|
|
||||||
if (QFileInfo(varsbat).exists()) {
|
if (QFileInfo(varsbat).exists()) {
|
||||||
QTemporaryFile tf(QDir::tempPath() + "\\XXXXXX.bat");
|
QTemporaryFile tf(QDir::tempPath() + "\\XXXXXX.bat");
|
||||||
if (!tf.open())
|
if (!tf.open())
|
||||||
@@ -465,9 +470,14 @@ QString MSVCToolChain::makeCommand() const
|
|||||||
if (QFileInfo(jom).exists())
|
if (QFileInfo(jom).exists())
|
||||||
return jom;
|
return jom;
|
||||||
else
|
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)
|
WinCEToolChain::WinCEToolChain(const QString &name, const QString &platform)
|
||||||
@@ -521,14 +531,8 @@ void WinCEToolChain::addToEnvironment(ProjectExplorer::Environment &env)
|
|||||||
|
|
||||||
path += "/";
|
path += "/";
|
||||||
|
|
||||||
// qDebug()<<"MSVC path"<<path;
|
|
||||||
// qDebug()<<"looking for platform name in"<< path() + "/mkspecs/" + mkspec() +"/qmake.conf";
|
|
||||||
// Find Platform name
|
// Find Platform name
|
||||||
// qDebug()<<"Platform Name"<<m_platform;
|
|
||||||
|
|
||||||
CeSdkHandler cesdkhandler;
|
CeSdkHandler cesdkhandler;
|
||||||
cesdkhandler.parse(path);
|
cesdkhandler.parse(path);
|
||||||
cesdkhandler.find(m_platform).addToEnvironment(env);
|
cesdkhandler.find(m_platform).addToEnvironment(env);
|
||||||
//qDebug()<<"WinCE Final Environment:";
|
|
||||||
//qDebug()<<env.toStringList();
|
|
||||||
}
|
}
|
||||||
|
@@ -40,6 +40,7 @@
|
|||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class Environment;
|
class Environment;
|
||||||
|
class IOutputParser;
|
||||||
class Project;
|
class Project;
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT HeaderPath
|
class PROJECTEXPLORER_EXPORT HeaderPath
|
||||||
@@ -97,6 +98,7 @@ public:
|
|||||||
virtual void addToEnvironment(ProjectExplorer::Environment &env) = 0;
|
virtual void addToEnvironment(ProjectExplorer::Environment &env) = 0;
|
||||||
virtual ToolChainType type() const = 0;
|
virtual ToolChainType type() const = 0;
|
||||||
virtual QString makeCommand() const = 0;
|
virtual QString makeCommand() const = 0;
|
||||||
|
virtual IOutputParser *outputParser() const = 0;
|
||||||
|
|
||||||
ToolChain();
|
ToolChain();
|
||||||
virtual ~ToolChain();
|
virtual ~ToolChain();
|
||||||
@@ -125,11 +127,13 @@ public:
|
|||||||
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
||||||
virtual ToolChainType type() const;
|
virtual ToolChainType type() const;
|
||||||
virtual QString makeCommand() const;
|
virtual QString makeCommand() const;
|
||||||
|
virtual IOutputParser *outputParser() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool equals(ToolChain *other) const;
|
virtual bool equals(ToolChain *other) const;
|
||||||
QByteArray m_predefinedMacros;
|
QByteArray m_predefinedMacros;
|
||||||
QList<HeaderPath> m_systemHeaderPaths;
|
QList<HeaderPath> m_systemHeaderPaths;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_gcc;
|
QString m_gcc;
|
||||||
};
|
};
|
||||||
@@ -142,8 +146,11 @@ public:
|
|||||||
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
||||||
virtual ToolChainType type() const;
|
virtual ToolChainType type() const;
|
||||||
virtual QString makeCommand() const;
|
virtual QString makeCommand() const;
|
||||||
|
virtual IOutputParser *outputParser() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool equals(ToolChain *other) const;
|
virtual bool equals(ToolChain *other) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_mingwPath;
|
QString m_mingwPath;
|
||||||
};
|
};
|
||||||
@@ -158,10 +165,13 @@ public:
|
|||||||
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
||||||
virtual ToolChainType type() const;
|
virtual ToolChainType type() const;
|
||||||
virtual QString makeCommand() const;
|
virtual QString makeCommand() const;
|
||||||
|
virtual IOutputParser *outputParser() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool equals(ToolChain *other) const;
|
virtual bool equals(ToolChain *other) const;
|
||||||
QByteArray m_predefinedMacros;
|
QByteArray m_predefinedMacros;
|
||||||
QString m_name;
|
QString m_name;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable QList<QPair<QString, QString> > m_values;
|
mutable QList<QPair<QString, QString> > m_values;
|
||||||
mutable bool m_valuesSet;
|
mutable bool m_valuesSet;
|
||||||
@@ -178,8 +188,10 @@ public:
|
|||||||
virtual QList<HeaderPath> systemHeaderPaths();
|
virtual QList<HeaderPath> systemHeaderPaths();
|
||||||
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
virtual void addToEnvironment(ProjectExplorer::Environment &env);
|
||||||
virtual ToolChainType type() const;
|
virtual ToolChainType type() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool equals(ToolChain *other) const;
|
virtual bool equals(ToolChain *other) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_platform;
|
QString m_platform;
|
||||||
};
|
};
|
||||||
|
@@ -33,26 +33,24 @@
|
|||||||
#include "qt4buildconfiguration.h"
|
#include "qt4buildconfiguration.h"
|
||||||
#include "qt4projectmanagerconstants.h"
|
#include "qt4projectmanagerconstants.h"
|
||||||
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/gnumakeparser.h>
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
|
|
||||||
using ProjectExplorer::IBuildParserFactory;
|
|
||||||
using ProjectExplorer::IBuildParser;
|
|
||||||
using ProjectExplorer::Environment;
|
using ProjectExplorer::Environment;
|
||||||
using ExtensionSystem::PluginManager;
|
using ExtensionSystem::PluginManager;
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace Qt4ProjectManager::Internal;
|
using namespace Qt4ProjectManager::Internal;
|
||||||
|
|
||||||
MakeStep::MakeStep(ProjectExplorer::BuildConfiguration *bc)
|
MakeStep::MakeStep(ProjectExplorer::BuildConfiguration *bc) :
|
||||||
: AbstractMakeStep(bc), m_clean(false)
|
AbstractProcessStep(bc), m_clean(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MakeStep::MakeStep(MakeStep *bs, ProjectExplorer::BuildConfiguration *bc)
|
MakeStep::MakeStep(MakeStep *bs, ProjectExplorer::BuildConfiguration *bc) :
|
||||||
: AbstractMakeStep(bs, bc),
|
AbstractProcessStep(bs, bc),
|
||||||
m_clean(bs->m_clean),
|
m_clean(bs->m_clean),
|
||||||
m_userArgs(bs->m_userArgs),
|
m_userArgs(bs->m_userArgs),
|
||||||
m_makeCmd(bs->m_makeCmd)
|
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())
|
if (map.value("clean").isValid() && map.value("clean").toBool())
|
||||||
m_clean = true;
|
m_clean = true;
|
||||||
ProjectExplorer::AbstractMakeStep::restoreFromGlobalMap(map);
|
ProjectExplorer::AbstractProcessStep::restoreFromGlobalMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::restoreFromLocalMap(const QMap<QString, QVariant> &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();
|
m_makeCmd = map.value("makeCmd").toString();
|
||||||
if (map.value("clean").isValid() && map.value("clean").toBool())
|
if (map.value("clean").isValid() && map.value("clean").toBool())
|
||||||
m_clean = true;
|
m_clean = true;
|
||||||
ProjectExplorer::AbstractMakeStep::restoreFromLocalMap(map);
|
ProjectExplorer::AbstractProcessStep::restoreFromLocalMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
||||||
@@ -97,7 +95,7 @@ void MakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
|||||||
map["makeCmd"] = m_makeCmd;
|
map["makeCmd"] = m_makeCmd;
|
||||||
if (m_clean)
|
if (m_clean)
|
||||||
map["clean"] = true;
|
map["clean"] = true;
|
||||||
ProjectExplorer::AbstractMakeStep::storeIntoLocalMap(map);
|
ProjectExplorer::AbstractProcessStep::storeIntoLocalMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MakeStep::init()
|
bool MakeStep::init()
|
||||||
@@ -116,8 +114,8 @@ bool MakeStep::init()
|
|||||||
// Try to detect command in environment
|
// Try to detect command in environment
|
||||||
QString tmp = environment.searchInPath(makeCmd);
|
QString tmp = environment.searchInPath(makeCmd);
|
||||||
if (tmp == QString::null) {
|
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));
|
"in the build environment</font>").arg(makeCmd));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
makeCmd = tmp;
|
makeCmd = tmp;
|
||||||
@@ -140,30 +138,22 @@ bool MakeStep::init()
|
|||||||
// but for now this is the least invasive change
|
// but for now this is the least invasive change
|
||||||
ProjectExplorer::ToolChain *toolchain = bc->toolChain();
|
ProjectExplorer::ToolChain *toolchain = bc->toolChain();
|
||||||
|
|
||||||
ProjectExplorer::ToolChain::ToolChainType type = ProjectExplorer::ToolChain::UNKNOWN;
|
if (toolchain) {
|
||||||
if (toolchain)
|
if (toolchain->type() != ProjectExplorer::ToolChain::MSVC &&
|
||||||
type = toolchain->type();
|
toolchain->type() != ProjectExplorer::ToolChain::WINCE) {
|
||||||
if (type != ProjectExplorer::ToolChain::MSVC && type != ProjectExplorer::ToolChain::WINCE) {
|
if (m_makeCmd.isEmpty())
|
||||||
if (m_makeCmd.isEmpty())
|
args << "-w";
|
||||||
args << "-w";
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setEnabled(true);
|
setEnabled(true);
|
||||||
setArguments(args);
|
setArguments(args);
|
||||||
|
|
||||||
if (type == ProjectExplorer::ToolChain::MSVC || type == ProjectExplorer::ToolChain::WINCE)
|
setOutputParser(new ProjectExplorer::GnuMakeParser(workingDirectory));
|
||||||
setBuildParser(ProjectExplorer::Constants::BUILD_PARSER_MSVC);
|
if (toolchain)
|
||||||
else if (ProjectExplorer::ToolChain::GCCE == type)
|
appendOutputParser(toolchain->outputParser());
|
||||||
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);
|
|
||||||
|
|
||||||
return AbstractMakeStep::init();
|
return AbstractProcessStep::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStep::run(QFutureInterface<bool> & fi)
|
void MakeStep::run(QFutureInterface<bool> & fi)
|
||||||
@@ -173,7 +163,7 @@ void MakeStep::run(QFutureInterface<bool> & fi)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractMakeStep::run(fi);
|
AbstractProcessStep::run(fi);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MakeStep::name()
|
QString MakeStep::name()
|
||||||
@@ -183,7 +173,7 @@ QString MakeStep::name()
|
|||||||
|
|
||||||
QString MakeStep::displayName()
|
QString MakeStep::displayName()
|
||||||
{
|
{
|
||||||
return "Make";
|
return QLatin1String("Make");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MakeStep::immutable() const
|
bool MakeStep::immutable() const
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
#include "ui_makestep.h"
|
#include "ui_makestep.h"
|
||||||
#include "qtversionmanager.h"
|
#include "qtversionmanager.h"
|
||||||
|
|
||||||
#include <projectexplorer/abstractmakestep.h>
|
#include <projectexplorer/abstractprocessstep.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
|
|
||||||
class Qt4Project;
|
class Qt4Project;
|
||||||
|
|
||||||
class MakeStep : public ProjectExplorer::AbstractMakeStep
|
class MakeStep : public ProjectExplorer::AbstractProcessStep
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
friend class MakeStepConfigWidget; // TODO remove this
|
friend class MakeStepConfigWidget; // TODO remove this
|
||||||
|
@@ -29,53 +29,30 @@
|
|||||||
|
|
||||||
#include "qmakeparser.h"
|
#include "qmakeparser.h"
|
||||||
#include "qt4projectmanagerconstants.h"
|
#include "qt4projectmanagerconstants.h"
|
||||||
|
|
||||||
#include <projectexplorer/taskwindow.h>
|
#include <projectexplorer/taskwindow.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace Qt4ProjectManager::Internal;
|
using namespace Qt4ProjectManager::Internal;
|
||||||
using ProjectExplorer::TaskWindow;
|
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()
|
QMakeParser::QMakeParser()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QMakeParser::name() const
|
void QMakeParser::stdError(const QString &line)
|
||||||
{
|
|
||||||
return QLatin1String(Qt4ProjectManager::Constants::BUILD_PARSER_QMAKE);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QMakeParser::stdOutput(const QString & line)
|
|
||||||
{
|
|
||||||
Q_UNUSED(line)
|
|
||||||
}
|
|
||||||
|
|
||||||
void QMakeParser::stdError(const QString & line)
|
|
||||||
{
|
{
|
||||||
QString lne(line.trimmed());
|
QString lne(line.trimmed());
|
||||||
if (lne.startsWith("Project ERROR:"))
|
if (lne.startsWith("Project ERROR:")) {
|
||||||
{
|
const QString description = lne.mid(15);
|
||||||
lne = lne.mid(15);
|
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error,
|
description,
|
||||||
lne /* description */,
|
QString() /* filename */,
|
||||||
QString() /* filename */,
|
-1 /* linenumber */,
|
||||||
-1 /* linenumber */,
|
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
|
||||||
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
IOutputParser::stdError(line);
|
||||||
}
|
}
|
||||||
|
@@ -30,37 +30,23 @@
|
|||||||
#ifndef QMAKEPARSER_H
|
#ifndef QMAKEPARSER_H
|
||||||
#define QMAKEPARSER_H
|
#define QMAKEPARSER_H
|
||||||
|
|
||||||
#include <projectexplorer/ibuildparser.h>
|
#include <projectexplorer/ioutputparser.h>
|
||||||
|
|
||||||
#include <QtCore/QRegExp>
|
#include <QtCore/QRegExp>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class QMakeParserFactory : public ProjectExplorer::IBuildParserFactory
|
class QMakeParser : public ProjectExplorer::IOutputParser
|
||||||
{
|
|
||||||
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
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QMakeParser();
|
QMakeParser();
|
||||||
QString name() const;
|
virtual void stdError(const QString &line);
|
||||||
virtual void stdOutput(const QString & line);
|
|
||||||
virtual void stdError(const QString & line);
|
|
||||||
private:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namesapce Interanal
|
} // namesapce Internal
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
#endif // QMAKEPARSER_H
|
#endif // QMAKEPARSER_H
|
||||||
|
@@ -29,36 +29,33 @@
|
|||||||
|
|
||||||
#include "qmakestep.h"
|
#include "qmakestep.h"
|
||||||
|
|
||||||
|
#include "qmakeparser.h"
|
||||||
|
#include "qt4buildconfiguration.h"
|
||||||
#include "qt4project.h"
|
#include "qt4project.h"
|
||||||
#include "qt4projectmanagerconstants.h"
|
#include "qt4projectmanagerconstants.h"
|
||||||
#include "qt4projectmanager.h"
|
#include "qt4projectmanager.h"
|
||||||
#include "makestep.h"
|
|
||||||
#include "qtversionmanager.h"
|
#include "qtversionmanager.h"
|
||||||
#include "qt4buildconfiguration.h"
|
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QFileDialog>
|
#include <QtCore/QDir>
|
||||||
#include <QDir>
|
#include <QtCore/QFile>
|
||||||
#include <QFile>
|
|
||||||
#include <QCoreApplication>
|
|
||||||
|
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace Qt4ProjectManager::Internal;
|
using namespace Qt4ProjectManager::Internal;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
QMakeStep::QMakeStep(ProjectExplorer::BuildConfiguration *bc)
|
QMakeStep::QMakeStep(ProjectExplorer::BuildConfiguration *bc) :
|
||||||
: AbstractMakeStep(bc), m_forced(false)
|
AbstractProcessStep(bc), m_forced(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QMakeStep::QMakeStep(QMakeStep *bs, ProjectExplorer::BuildConfiguration *bc)
|
QMakeStep::QMakeStep(QMakeStep *bs, ProjectExplorer::BuildConfiguration *bc) :
|
||||||
: AbstractMakeStep(bs, bc),
|
AbstractProcessStep(bs, bc),
|
||||||
m_forced(false),
|
m_forced(false),
|
||||||
m_userArgs(bs->m_userArgs)
|
m_userArgs(bs->m_userArgs)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QMakeStep::~QMakeStep()
|
QMakeStep::~QMakeStep()
|
||||||
@@ -112,9 +109,9 @@ bool QMakeStep::init()
|
|||||||
|
|
||||||
if (!qtVersion->isValid()) {
|
if (!qtVersion->isValid()) {
|
||||||
#if defined(Q_WS_MAC)
|
#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
|
#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
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -124,7 +121,7 @@ bool QMakeStep::init()
|
|||||||
|
|
||||||
QString program = qtVersion->qmakeCommand();
|
QString program = qtVersion->qmakeCommand();
|
||||||
|
|
||||||
// Check wheter we need to run qmake
|
// Check whether we need to run qmake
|
||||||
m_needToRunQMake = true;
|
m_needToRunQMake = true;
|
||||||
if (QDir(workingDirectory).exists(QLatin1String("Makefile"))) {
|
if (QDir(workingDirectory).exists(QLatin1String("Makefile"))) {
|
||||||
QString qmakePath = QtVersionManager::findQMakeBinaryFromMakefile(workingDirectory);
|
QString qmakePath = QtVersionManager::findQMakeBinaryFromMakefile(workingDirectory);
|
||||||
@@ -144,8 +141,8 @@ bool QMakeStep::init()
|
|||||||
setArguments(args);
|
setArguments(args);
|
||||||
setEnvironment(qt4bc->environment());
|
setEnvironment(qt4bc->environment());
|
||||||
|
|
||||||
setBuildParser(Qt4ProjectManager::Constants::BUILD_PARSER_QMAKE);
|
setOutputParser(new QMakeParser);
|
||||||
return AbstractMakeStep::init();
|
return AbstractProcessStep::init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMakeStep::run(QFutureInterface<bool> &fi)
|
void QMakeStep::run(QFutureInterface<bool> &fi)
|
||||||
@@ -157,21 +154,21 @@ void QMakeStep::run(QFutureInterface<bool> &fi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!m_needToRunQMake) {
|
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);
|
fi.reportResult(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AbstractMakeStep::run(fi);
|
AbstractProcessStep::run(fi);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QMakeStep::name()
|
QString QMakeStep::name()
|
||||||
{
|
{
|
||||||
return Constants::QMAKESTEP;
|
return QLatin1String(Constants::QMAKESTEP);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QMakeStep::displayName()
|
QString QMakeStep::displayName()
|
||||||
{
|
{
|
||||||
return "QMake";
|
return QLatin1String("QMake");
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMakeStep::setForced(bool b)
|
void QMakeStep::setForced(bool b)
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#include "ui_qmakestep.h"
|
#include "ui_qmakestep.h"
|
||||||
|
|
||||||
#include <projectexplorer/abstractmakestep.h>
|
#include <projectexplorer/abstractprocessstep.h>
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
|
|
||||||
class QMakeStep : public ProjectExplorer::AbstractMakeStep
|
class QMakeStep : public ProjectExplorer::AbstractProcessStep
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@@ -28,18 +28,16 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "abldparser.h"
|
#include "abldparser.h"
|
||||||
#include <utils/qtcassert.h>
|
|
||||||
|
|
||||||
|
#include <projectexplorer/gnumakeparser.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/taskwindow.h>
|
#include <projectexplorer/taskwindow.h>
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
|
||||||
|
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
using namespace ProjectExplorer::Constants;
|
||||||
|
|
||||||
AbldParser::AbldParser(const QString &name) :
|
AbldParser::AbldParser() :
|
||||||
m_name(name),
|
|
||||||
m_currentLine(-1),
|
m_currentLine(-1),
|
||||||
m_waitingForStdErrContinuation(false),
|
m_waitingForStdErrContinuation(false),
|
||||||
m_waitingForStdOutContinuation(false)
|
m_waitingForStdOutContinuation(false)
|
||||||
@@ -47,47 +45,7 @@ AbldParser::AbldParser(const QString &name) :
|
|||||||
m_perlIssue.setPattern("^(WARNING|ERROR):\\s([^\\(\\)]+[^\\d])\\((\\d+)\\) : (.+)$");
|
m_perlIssue.setPattern("^(WARNING|ERROR):\\s([^\\(\\)]+[^\\d])\\((\\d+)\\) : (.+)$");
|
||||||
m_perlIssue.setMinimal(true);
|
m_perlIssue.setMinimal(true);
|
||||||
|
|
||||||
// Now look for new parser
|
appendOutputParser(new GnuMakeParser);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbldParser::stdOutput(const QString &line)
|
void AbldParser::stdOutput(const QString &line)
|
||||||
@@ -97,19 +55,19 @@ void AbldParser::stdOutput(const QString &line)
|
|||||||
QString lne = line.trimmed();
|
QString lne = line.trimmed();
|
||||||
// possible ABLD.bat errors:
|
// possible ABLD.bat errors:
|
||||||
if (lne.startsWith("Is Perl, version ")) {
|
if (lne.startsWith("Is Perl, version ")) {
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error,
|
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||||
lne /* description */,
|
lne /* description */,
|
||||||
QString() /* filename */,
|
QString() /* filename */,
|
||||||
-1 /* linenumber */,
|
-1 /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
TASK_CATEGORY_BUILDSYSTEM));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (lne.startsWith("FATAL ERROR:")) {
|
if (lne.startsWith("FATAL ERROR:")) {
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error,
|
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||||
lne /* description */,
|
lne /* description */,
|
||||||
QString() /* filename */,
|
QString() /* filename */,
|
||||||
-1 /* linenumber */,
|
-1 /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
TASK_CATEGORY_BUILDSYSTEM));
|
||||||
m_waitingForStdOutContinuation = false;
|
m_waitingForStdOutContinuation = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -122,14 +80,14 @@ void AbldParser::stdOutput(const QString &line)
|
|||||||
TaskWindow::Task task(TaskWindow::Unknown,
|
TaskWindow::Task task(TaskWindow::Unknown,
|
||||||
m_perlIssue.cap(4) /* description */,
|
m_perlIssue.cap(4) /* description */,
|
||||||
m_currentFile, m_currentLine,
|
m_currentFile, m_currentLine,
|
||||||
Constants::TASK_CATEGORY_BUILDSYSTEM);
|
TASK_CATEGORY_BUILDSYSTEM);
|
||||||
|
|
||||||
if (m_perlIssue.cap(1) == QLatin1String("WARNING"))
|
if (m_perlIssue.cap(1) == QLatin1String("WARNING"))
|
||||||
task.type = TaskWindow::Warning;
|
task.type = TaskWindow::Warning;
|
||||||
else if (m_perlIssue.cap(1) == QLatin1String("ERROR"))
|
else if (m_perlIssue.cap(1) == QLatin1String("ERROR"))
|
||||||
task.type = TaskWindow::Error;
|
task.type = TaskWindow::Error;
|
||||||
|
|
||||||
emit addToTaskWindow(task);
|
emit addTask(task);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,17 +97,14 @@ void AbldParser::stdOutput(const QString &line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_waitingForStdOutContinuation) {
|
if (m_waitingForStdOutContinuation) {
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Unknown,
|
emit addTask(TaskWindow::Task(TaskWindow::Unknown,
|
||||||
lne /* description */,
|
lne /* description */,
|
||||||
m_currentFile, m_currentLine,
|
m_currentFile, m_currentLine,
|
||||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
TASK_CATEGORY_BUILDSYSTEM));
|
||||||
m_waitingForStdOutContinuation = true;
|
m_waitingForStdOutContinuation = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
IOutputParser::stdOutput(line);
|
||||||
QTC_ASSERT(0 != m_subparser, return);
|
|
||||||
// pass on to compiler output parser:
|
|
||||||
m_subparser->stdOutput(lne);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbldParser::stdError(const QString &line)
|
void AbldParser::stdError(const QString &line)
|
||||||
@@ -162,20 +117,20 @@ void AbldParser::stdError(const QString &line)
|
|||||||
if (lne.startsWith("ABLD ERROR:") ||
|
if (lne.startsWith("ABLD ERROR:") ||
|
||||||
lne.startsWith("This project does not support ") ||
|
lne.startsWith("This project does not support ") ||
|
||||||
lne.startsWith("Platform ")) {
|
lne.startsWith("Platform ")) {
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error,
|
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||||
lne /* description */,
|
lne /* description */,
|
||||||
QString() /* filename */,
|
QString() /* filename */,
|
||||||
-1 /* linenumber */,
|
-1 /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
TASK_CATEGORY_BUILDSYSTEM));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lne.startsWith("Died at ")) {
|
if (lne.startsWith("Died at ")) {
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error,
|
emit addTask(TaskWindow::Task(TaskWindow::Error,
|
||||||
lne /* description */,
|
lne /* description */,
|
||||||
QString() /* filename */,
|
QString() /* filename */,
|
||||||
-1 /* linenumber */,
|
-1 /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
TASK_CATEGORY_BUILDSYSTEM));
|
||||||
m_waitingForStdErrContinuation = false;
|
m_waitingForStdErrContinuation = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -191,34 +146,31 @@ void AbldParser::stdError(const QString &line)
|
|||||||
}
|
}
|
||||||
if (lne.startsWith("WARNING: ")) {
|
if (lne.startsWith("WARNING: ")) {
|
||||||
QString description = lne.mid(9);
|
QString description = lne.mid(9);
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Warning, description,
|
emit addTask(TaskWindow::Task(TaskWindow::Warning, description,
|
||||||
m_currentFile,
|
m_currentFile,
|
||||||
-1 /* linenumber */,
|
-1 /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
TASK_CATEGORY_BUILDSYSTEM));
|
||||||
m_waitingForStdErrContinuation = true;
|
m_waitingForStdErrContinuation = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (lne.startsWith("ERROR: ")) {
|
if (lne.startsWith("ERROR: ")) {
|
||||||
QString description = lne.mid(7);
|
QString description = lne.mid(7);
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Error, description,
|
emit addTask(TaskWindow::Task(TaskWindow::Error, description,
|
||||||
m_currentFile,
|
m_currentFile,
|
||||||
-1 /* linenumber */,
|
-1 /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
TASK_CATEGORY_BUILDSYSTEM));
|
||||||
m_waitingForStdErrContinuation = true;
|
m_waitingForStdErrContinuation = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_waitingForStdErrContinuation)
|
if (m_waitingForStdErrContinuation)
|
||||||
{
|
{
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Unknown,
|
emit addTask(TaskWindow::Task(TaskWindow::Unknown,
|
||||||
lne /* description */,
|
lne /* description */,
|
||||||
m_currentFile,
|
m_currentFile,
|
||||||
-1 /* linenumber */,
|
-1 /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_BUILDSYSTEM));
|
TASK_CATEGORY_BUILDSYSTEM));
|
||||||
m_waitingForStdErrContinuation = true;
|
m_waitingForStdErrContinuation = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
IOutputParser::stdError(line);
|
||||||
QTC_ASSERT(0 != m_subparser, return);
|
|
||||||
// pass on to compiler output parser:
|
|
||||||
m_subparser->stdError(lne);
|
|
||||||
}
|
}
|
||||||
|
@@ -30,27 +30,23 @@
|
|||||||
#ifndef ABLDPARSER_H
|
#ifndef ABLDPARSER_H
|
||||||
#define ABLDPARSER_H
|
#define ABLDPARSER_H
|
||||||
|
|
||||||
#include <projectexplorer/ibuildparser.h>
|
#include <projectexplorer/ioutputparser.h>
|
||||||
|
|
||||||
#include <QtCore/QRegExp>
|
#include <QtCore/QRegExp>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
|
|
||||||
class AbldParser : public ProjectExplorer::IBuildParser
|
class AbldParser : public ProjectExplorer::IOutputParser
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AbldParser(const QString & name);
|
AbldParser();
|
||||||
~AbldParser();
|
|
||||||
|
|
||||||
QString name() const;
|
|
||||||
virtual void stdOutput(const QString & line);
|
virtual void stdOutput(const QString & line);
|
||||||
virtual void stdError(const QString & line);
|
virtual void stdError(const QString & line);
|
||||||
private:
|
|
||||||
ProjectExplorer::IBuildParser * m_subparser;
|
|
||||||
const QString m_name;
|
|
||||||
|
|
||||||
|
private:
|
||||||
QRegExp m_perlIssue;
|
QRegExp m_perlIssue;
|
||||||
|
|
||||||
QString m_currentFile;
|
QString m_currentFile;
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
$$PWD/serialdevicelister.cpp \
|
$$PWD/serialdevicelister.cpp \
|
||||||
$$PWD/rvcttoolchain.cpp \
|
$$PWD/rvcttoolchain.cpp \
|
||||||
$$PWD/s60runconfigbluetoothstarter.cpp \
|
$$PWD/s60runconfigbluetoothstarter.cpp \
|
||||||
$$PWD/s60buildparserfactory.cpp \
|
|
||||||
$$PWD/abldparser.cpp \
|
$$PWD/abldparser.cpp \
|
||||||
$$PWD/rvctparser.cpp \
|
$$PWD/rvctparser.cpp \
|
||||||
$$PWD/winscwparser.cpp
|
$$PWD/winscwparser.cpp
|
||||||
@@ -27,7 +26,6 @@
|
|||||||
$$PWD/serialdevicelister.h \
|
$$PWD/serialdevicelister.h \
|
||||||
$$PWD/rvcttoolchain.h \
|
$$PWD/rvcttoolchain.h \
|
||||||
$$PWD/s60runconfigbluetoothstarter.h \
|
$$PWD/s60runconfigbluetoothstarter.h \
|
||||||
$$PWD/s60buildparserfactory.h \
|
|
||||||
$$PWD/abldparser.h \
|
$$PWD/abldparser.h \
|
||||||
$$PWD/rvctparser.h \
|
$$PWD/rvctparser.h \
|
||||||
$$PWD/winscwparser.h
|
$$PWD/winscwparser.h
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include <projectexplorer/taskwindow.h>
|
#include <projectexplorer/taskwindow.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
using namespace ProjectExplorer::Constants;
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
|
|
||||||
RvctParser::RvctParser() :
|
RvctParser::RvctParser() :
|
||||||
@@ -48,46 +49,28 @@ RvctParser::RvctParser() :
|
|||||||
// linker problems:
|
// linker problems:
|
||||||
m_linkerProblem.setPattern("^(\\S*)\\(\\S+\\):\\s(.+)$");
|
m_linkerProblem.setPattern("^(\\S*)\\(\\S+\\):\\s(.+)$");
|
||||||
m_linkerProblem.setMinimal(true);
|
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)
|
void RvctParser::stdError(const QString &line)
|
||||||
{
|
{
|
||||||
QString lne = line.trimmed();
|
QString lne = line.trimmed();
|
||||||
if (m_linkerProblem.indexIn(lne) > -1) {
|
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(2) /* description */,
|
||||||
m_linkerProblem.cap(1) /* filename */,
|
m_linkerProblem.cap(1) /* filename */,
|
||||||
-1 /* linenumber */,
|
-1 /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_COMPILE));
|
TASK_CATEGORY_COMPILE));
|
||||||
} else if (m_warningOrError.indexIn(lne) > -1) {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_warningOrError.indexIn(lne) > -1) {
|
||||||
m_lastFile = m_warningOrError.cap(1);
|
m_lastFile = m_warningOrError.cap(1);
|
||||||
m_lastLine = m_warningOrError.cap(2).toInt();
|
m_lastLine = m_warningOrError.cap(2).toInt();
|
||||||
|
|
||||||
TaskWindow::Task task(TaskWindow::Unknown,
|
TaskWindow::Task task(TaskWindow::Unknown,
|
||||||
m_warningOrError.cap(5) /* description */,
|
m_warningOrError.cap(5) /* description */,
|
||||||
m_lastFile, m_lastLine,
|
m_lastFile, m_lastLine,
|
||||||
Constants::TASK_CATEGORY_COMPILE);
|
TASK_CATEGORY_COMPILE);
|
||||||
if (m_warningOrError.cap(4) == "Warning")
|
if (m_warningOrError.cap(4) == "Warning")
|
||||||
task.type = TaskWindow::Warning;
|
task.type = TaskWindow::Warning;
|
||||||
else if (m_warningOrError.cap(4) == "Error")
|
else if (m_warningOrError.cap(4) == "Error")
|
||||||
@@ -95,14 +78,21 @@ void RvctParser::stdError(const QString &line)
|
|||||||
|
|
||||||
m_additionalInfo = true;
|
m_additionalInfo = true;
|
||||||
|
|
||||||
emit addToTaskWindow(task);
|
emit addTask(task);
|
||||||
} else if (m_doneWithFile.indexIn(lne) > -1) {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_doneWithFile.indexIn(lne) > -1) {
|
||||||
m_additionalInfo = false;
|
m_additionalInfo = false;
|
||||||
} else if (m_additionalInfo) {
|
return;
|
||||||
|
}
|
||||||
|
if (m_additionalInfo) {
|
||||||
// Report any lines after a error/warning message as these contain
|
// Report any lines after a error/warning message as these contain
|
||||||
// additional information on the problem.
|
// additional information on the problem.
|
||||||
emit addToTaskWindow(TaskWindow::Task(TaskWindow::Unknown, lne,
|
emit addTask(TaskWindow::Task(TaskWindow::Unknown, lne,
|
||||||
m_lastFile, m_lastLine,
|
m_lastFile, m_lastLine,
|
||||||
Constants::TASK_CATEGORY_COMPILE));
|
TASK_CATEGORY_COMPILE));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
IOutputParser::stdError(line);
|
||||||
}
|
}
|
||||||
|
@@ -30,26 +30,24 @@
|
|||||||
#ifndef RVCTPARSER_H
|
#ifndef RVCTPARSER_H
|
||||||
#define RVCTPARSER_H
|
#define RVCTPARSER_H
|
||||||
|
|
||||||
#include <projectexplorer/ibuildparser.h>
|
#include <projectexplorer/ioutputparser.h>
|
||||||
|
|
||||||
#include <QtCore/QRegExp>
|
#include <QtCore/QRegExp>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
|
|
||||||
class RvctParser : public ProjectExplorer::IBuildParser
|
class RvctParser : public ProjectExplorer::IOutputParser
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RvctParser();
|
RvctParser();
|
||||||
QString name() const;
|
|
||||||
virtual void stdOutput(const QString & line);
|
|
||||||
virtual void stdError(const QString & line);
|
virtual void stdError(const QString & line);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QRegExp m_warningOrError;
|
QRegExp m_warningOrError;
|
||||||
QRegExp m_doneWithFile;
|
QRegExp m_doneWithFile;
|
||||||
QRegExp m_linkerProblem;
|
QRegExp m_linkerProblem;
|
||||||
QRegExp m_makeDir;
|
|
||||||
|
|
||||||
bool m_additionalInfo;
|
bool m_additionalInfo;
|
||||||
QString m_lastFile;
|
QString m_lastFile;
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "rvcttoolchain.h"
|
#include "rvcttoolchain.h"
|
||||||
|
#include "rvctparser.h"
|
||||||
|
|
||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
@@ -139,6 +141,11 @@ QString RVCTToolChain::makeCommand() const
|
|||||||
return QLatin1String("make");
|
return QLatin1String("make");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ProjectExplorer::IOutputParser *RVCTToolChain::outputParser() const
|
||||||
|
{
|
||||||
|
return new RvctParser;
|
||||||
|
}
|
||||||
|
|
||||||
bool RVCTToolChain::equals(ToolChain *otherIn) const
|
bool RVCTToolChain::equals(ToolChain *otherIn) const
|
||||||
{
|
{
|
||||||
if (otherIn->type() != type())
|
if (otherIn->type() != type())
|
||||||
|
@@ -47,6 +47,8 @@ public:
|
|||||||
void addToEnvironment(ProjectExplorer::Environment &env);
|
void addToEnvironment(ProjectExplorer::Environment &env);
|
||||||
ProjectExplorer::ToolChain::ToolChainType type() const;
|
ProjectExplorer::ToolChain::ToolChainType type() const;
|
||||||
QString makeCommand() const;
|
QString makeCommand() const;
|
||||||
|
ProjectExplorer::IOutputParser *outputParser() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool equals(ToolChain *other) const;
|
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 "rvcttoolchain.h"
|
||||||
#include "s60emulatorrunconfiguration.h"
|
#include "s60emulatorrunconfiguration.h"
|
||||||
#include "s60devicerunconfiguration.h"
|
#include "s60devicerunconfiguration.h"
|
||||||
#include "s60buildparserfactory.h"
|
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
@@ -118,9 +117,6 @@ S60Manager::S60Manager(QObject *parent)
|
|||||||
(QLatin1String(ProjectExplorer::Constants::RUNMODE),
|
(QLatin1String(ProjectExplorer::Constants::RUNMODE),
|
||||||
tr("Run on Device"), parent));
|
tr("Run on Device"), parent));
|
||||||
|
|
||||||
// Build parsers
|
|
||||||
addAutoReleasedObject(new S60ParserFactory);
|
|
||||||
|
|
||||||
if (Debugger::DebuggerManager::instance())
|
if (Debugger::DebuggerManager::instance())
|
||||||
addAutoReleasedObject(new RunControlFactory<S60DeviceDebugRunControl,
|
addAutoReleasedObject(new RunControlFactory<S60DeviceDebugRunControl,
|
||||||
S60DeviceRunConfiguration>
|
S60DeviceRunConfiguration>
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
using namespace ProjectExplorer::Constants;
|
||||||
|
|
||||||
WinscwParser::WinscwParser()
|
WinscwParser::WinscwParser()
|
||||||
{
|
{
|
||||||
@@ -43,41 +44,26 @@ WinscwParser::WinscwParser()
|
|||||||
// WINSCW issue:
|
// WINSCW issue:
|
||||||
m_compilerProblem.setPattern("^([^\\(\\)]+[^\\d]):(\\d+):\\s(.+)$");
|
m_compilerProblem.setPattern("^([^\\(\\)]+[^\\d]):(\\d+):\\s(.+)$");
|
||||||
m_compilerProblem.setMinimal(true);
|
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)
|
void WinscwParser::stdOutput(const QString &line)
|
||||||
{
|
{
|
||||||
QString lne = line.trimmed();
|
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) {
|
if (m_compilerProblem.indexIn(lne) > -1) {
|
||||||
TaskWindow::Task task(TaskWindow::Error,
|
TaskWindow::Task task(TaskWindow::Error,
|
||||||
m_compilerProblem.cap(3) /* description */,
|
m_compilerProblem.cap(3) /* description */,
|
||||||
m_compilerProblem.cap(1) /* filename */,
|
m_compilerProblem.cap(1) /* filename */,
|
||||||
m_compilerProblem.cap(2).toInt() /* linenumber */,
|
m_compilerProblem.cap(2).toInt() /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_COMPILE);
|
TASK_CATEGORY_COMPILE);
|
||||||
if (task.description.startsWith("warning: ")) {
|
if (task.description.startsWith("warning: ")) {
|
||||||
task.type = TaskWindow::Warning;
|
task.type = TaskWindow::Warning;
|
||||||
task.description = task.description.mid(9);
|
task.description = task.description.mid(9);
|
||||||
}
|
}
|
||||||
emit addToTaskWindow(task);
|
emit addTask(task);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
IOutputParser::stdOutput(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WinscwParser::stdError(const QString &line)
|
void WinscwParser::stdError(const QString &line)
|
||||||
@@ -85,10 +71,12 @@ void WinscwParser::stdError(const QString &line)
|
|||||||
QString lne = line.trimmed();
|
QString lne = line.trimmed();
|
||||||
|
|
||||||
if (m_linkerProblem.indexIn(lne) > -1) {
|
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(2) /* description */,
|
||||||
m_linkerProblem.cap(1) /* filename */,
|
m_linkerProblem.cap(1) /* filename */,
|
||||||
-1 /* linenumber */,
|
-1 /* linenumber */,
|
||||||
Constants::TASK_CATEGORY_COMPILE));
|
TASK_CATEGORY_COMPILE));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
IOutputParser::stdError(line);
|
||||||
}
|
}
|
||||||
|
@@ -30,25 +30,25 @@
|
|||||||
#ifndef WINSCWPARSER_H
|
#ifndef WINSCWPARSER_H
|
||||||
#define WINSCWPARSER_H
|
#define WINSCWPARSER_H
|
||||||
|
|
||||||
#include <projectexplorer/ibuildparser.h>
|
#include <projectexplorer/ioutputparser.h>
|
||||||
|
|
||||||
#include <QtCore/QRegExp>
|
#include <QtCore/QRegExp>
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
|
|
||||||
class WinscwParser : public ProjectExplorer::IBuildParser
|
class WinscwParser : public ProjectExplorer::IOutputParser
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WinscwParser();
|
WinscwParser();
|
||||||
QString name() const;
|
|
||||||
virtual void stdOutput(const QString & line);
|
virtual void stdOutput(const QString &line);
|
||||||
virtual void stdError(const QString & line);
|
virtual void stdError(const QString &line);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QRegExp m_compilerProblem;
|
QRegExp m_compilerProblem;
|
||||||
QRegExp m_linkerProblem;
|
QRegExp m_linkerProblem;
|
||||||
QRegExp m_makeDir;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
@@ -29,9 +29,10 @@
|
|||||||
|
|
||||||
#include "winscwtoolchain.h"
|
#include "winscwtoolchain.h"
|
||||||
|
|
||||||
|
#include "winscwparser.h"
|
||||||
|
|
||||||
#include <QtCore/QByteArray>
|
#include <QtCore/QByteArray>
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtDebug>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Qt4ProjectManager::Internal;
|
using namespace Qt4ProjectManager::Internal;
|
||||||
@@ -108,7 +109,12 @@ void WINSCWToolChain::addToEnvironment(ProjectExplorer::Environment &env)
|
|||||||
|
|
||||||
QString WINSCWToolChain::makeCommand() const
|
QString WINSCWToolChain::makeCommand() const
|
||||||
{
|
{
|
||||||
return "make";
|
return QLatin1String("make");
|
||||||
|
}
|
||||||
|
|
||||||
|
IOutputParser *WINSCWToolChain::outputParser() const
|
||||||
|
{
|
||||||
|
return new WinscwParser;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WINSCWToolChain::equals(ToolChain *other) const
|
bool WINSCWToolChain::equals(ToolChain *other) const
|
||||||
|
@@ -47,6 +47,7 @@ public:
|
|||||||
void addToEnvironment(ProjectExplorer::Environment &env);
|
void addToEnvironment(ProjectExplorer::Environment &env);
|
||||||
ProjectExplorer::ToolChain::ToolChainType type() const;
|
ProjectExplorer::ToolChain::ToolChainType type() const;
|
||||||
QString makeCommand() const;
|
QString makeCommand() const;
|
||||||
|
ProjectExplorer::IOutputParser *outputParser() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool equals(ToolChain *other) const;
|
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_ID = "Qt Versions";
|
||||||
const char * const QTVERSION_SETTINGS_PAGE_NAME = QT_TRANSLATE_NOOP("Qt4ProjectManager", "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 Constants
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|
||||||
|
@@ -45,14 +45,13 @@
|
|||||||
#include "externaleditors.h"
|
#include "externaleditors.h"
|
||||||
#include "gettingstartedwelcomepage.h"
|
#include "gettingstartedwelcomepage.h"
|
||||||
#include "gettingstartedwelcomepagewidget.h"
|
#include "gettingstartedwelcomepagewidget.h"
|
||||||
#include "qmakeparser.h"
|
|
||||||
|
|
||||||
#ifdef QTCREATOR_WITH_S60
|
#ifdef QTCREATOR_WITH_S60
|
||||||
#include "qt-s60/s60manager.h"
|
# include "qt-s60/s60manager.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef QTCREATOR_WITH_MAEMO
|
#ifdef QTCREATOR_WITH_MAEMO
|
||||||
#include "qt-maemo/maemomanager.h"
|
# include "qt-maemo/maemomanager.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
@@ -68,14 +67,12 @@
|
|||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <texteditor/texteditoractionhandler.h>
|
#include <texteditor/texteditoractionhandler.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
|
||||||
#include <QtCore/QtPlugin>
|
|
||||||
#include <QtGui/QMenu>
|
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
#include <QTest>
|
# include <QTest>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <QtCore/QtPlugin>
|
||||||
|
|
||||||
using namespace Qt4ProjectManager::Internal;
|
using namespace Qt4ProjectManager::Internal;
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using ProjectExplorer::Project;
|
using ProjectExplorer::Project;
|
||||||
@@ -92,17 +89,6 @@ Qt4ProjectManagerPlugin::~Qt4ProjectManagerPlugin()
|
|||||||
removeObject(m_welcomePage);
|
removeObject(m_welcomePage);
|
||||||
delete 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)
|
bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||||
{
|
{
|
||||||
@@ -150,7 +136,6 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
|||||||
|
|
||||||
addAutoReleasedObject(new QMakeStepFactory);
|
addAutoReleasedObject(new QMakeStepFactory);
|
||||||
addAutoReleasedObject(new MakeStepFactory);
|
addAutoReleasedObject(new MakeStepFactory);
|
||||||
addAutoReleasedObject(new QMakeParserFactory);
|
|
||||||
|
|
||||||
addAutoReleasedObject(new Qt4RunConfigurationFactory);
|
addAutoReleasedObject(new Qt4RunConfigurationFactory);
|
||||||
|
|
||||||
|
@@ -46,8 +46,6 @@ class GuiAppWizard;
|
|||||||
class EmptyProjectWizard;
|
class EmptyProjectWizard;
|
||||||
class QMakeStepFactory;
|
class QMakeStepFactory;
|
||||||
class MakeStepFactory;
|
class MakeStepFactory;
|
||||||
class GccParserFactory;
|
|
||||||
class MsvcParserFactory;
|
|
||||||
class EmbeddedPropertiesPage;
|
class EmbeddedPropertiesPage;
|
||||||
class GettingStartedWelcomePage;
|
class GettingStartedWelcomePage;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user