forked from qt-creator/qt-creator
QbsProjectManager: Remove the QbsParser class
It serves no purpose. Change-Id: I92e700ed5c1d2b72398f4c7b88dab0cea9404e4d Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -15,7 +15,6 @@ add_qtc_plugin(QbsProjectManager
|
||||
qbskitinformation.cpp qbskitinformation.h
|
||||
qbsnodes.cpp qbsnodes.h
|
||||
qbsnodetreebuilder.cpp qbsnodetreebuilder.h
|
||||
qbsparser.cpp qbsparser.h
|
||||
qbspmlogging.cpp qbspmlogging.h
|
||||
qbsprofilemanager.cpp qbsprofilemanager.h
|
||||
qbsprofilessettingspage.cpp qbsprofilessettingspage.h
|
||||
|
@@ -26,7 +26,6 @@
|
||||
#include "qbsbuildstep.h"
|
||||
|
||||
#include "qbsbuildconfiguration.h"
|
||||
#include "qbsparser.h"
|
||||
#include "qbsproject.h"
|
||||
#include "qbsprojectmanagerconstants.h"
|
||||
#include "qbssession.h"
|
||||
@@ -35,6 +34,7 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/variablechooser.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/ioutputparser.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
@@ -60,7 +60,6 @@
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
const char QBS_CONFIG[] = "Qbs.Configuration";
|
||||
const char QBS_DRY_RUN[] = "Qbs.DryRun";
|
||||
const char QBS_KEEP_GOING[] = "Qbs.DryKeepGoing";
|
||||
const char QBS_MAXJOBCOUNT[] = "Qbs.MaxJobs";
|
||||
const char QBS_SHOWCOMMANDLINES[] = "Qbs.ShowCommandLines";
|
||||
@@ -170,17 +169,14 @@ bool QbsBuildStep::init()
|
||||
return false;
|
||||
|
||||
delete m_parser;
|
||||
m_parser = new Internal::QbsParser;
|
||||
ProjectExplorer::IOutputParser *parser = target()->kit()->createOutputParser();
|
||||
if (parser)
|
||||
m_parser->appendOutputParser(parser);
|
||||
m_parser = target()->kit()->createOutputParser();
|
||||
if (m_parser)
|
||||
connect(m_parser, &ProjectExplorer::IOutputParser::addTask, this, &QbsBuildStep::addTask);
|
||||
|
||||
m_changedFiles = bc->changedFiles();
|
||||
m_activeFileTags = bc->activeFileTags();
|
||||
m_products = bc->products();
|
||||
|
||||
connect(m_parser, &ProjectExplorer::IOutputParser::addTask, this, &QbsBuildStep::addTask);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -379,18 +375,22 @@ void QbsBuildStep::handleProcessResult(
|
||||
if (success && !hasOutput)
|
||||
return;
|
||||
|
||||
m_parser->setWorkingDirectory(workingDir);
|
||||
if (m_parser)
|
||||
m_parser->setWorkingDirectory(workingDir);
|
||||
emit addOutput(executable.toUserOutput() + ' ' + QtcProcess::joinArgs(arguments),
|
||||
OutputFormat::Stdout);
|
||||
for (const QString &line : stdErr) {
|
||||
m_parser->handleStderr(line + '\n');
|
||||
if (m_parser)
|
||||
m_parser->handleStderr(line + '\n');
|
||||
emit addOutput(line, OutputFormat::Stderr);
|
||||
}
|
||||
for (const QString &line : stdOut) {
|
||||
m_parser->handleStdout(line + '\n');
|
||||
if (m_parser)
|
||||
m_parser->handleStdout(line + '\n');
|
||||
emit addOutput(line, OutputFormat::Stdout);
|
||||
}
|
||||
m_parser->flush();
|
||||
if (m_parser)
|
||||
m_parser->flush();
|
||||
}
|
||||
|
||||
void QbsBuildStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message,
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <projectexplorer/task.h>
|
||||
|
||||
namespace ProjectExplorer { class IOutputParser; }
|
||||
namespace Utils { class FancyLineEdit; }
|
||||
|
||||
namespace QbsProjectManager {
|
||||
|
@@ -1,55 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qbsparser.h"
|
||||
|
||||
#include <projectexplorer/task.h>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
|
||||
namespace QbsProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
QbsParser::QbsParser()
|
||||
{
|
||||
setObjectName(QLatin1String("QbsParser"));
|
||||
}
|
||||
|
||||
// TODO: Is this really needed? qbs never emits relative paths...
|
||||
void QbsParser::taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines)
|
||||
{
|
||||
ProjectExplorer::Task editable(task);
|
||||
const QString filePath = task.file.toString();
|
||||
if (!filePath.isEmpty())
|
||||
editable.file = workingDirectory().pathAppended(filePath);
|
||||
IOutputParser::taskAdded(editable, linkedLines, skipLines);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QbsProjectManager
|
||||
|
@@ -1,47 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "qbsprojectmanager_global.h"
|
||||
|
||||
#include <projectexplorer/ioutputparser.h>
|
||||
|
||||
namespace QbsProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class QbsParser : public ProjectExplorer::IOutputParser
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QbsParser();
|
||||
|
||||
private:
|
||||
void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines) override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QbsProjectManager
|
@@ -16,7 +16,6 @@ HEADERS = \
|
||||
qbsinstallstep.h \
|
||||
qbsnodes.h \
|
||||
qbsnodetreebuilder.h \
|
||||
qbsparser.h \
|
||||
qbspmlogging.h \
|
||||
qbsprofilemanager.h \
|
||||
qbsprofilessettingspage.h \
|
||||
@@ -39,7 +38,6 @@ SOURCES = \
|
||||
qbskitinformation.cpp \
|
||||
qbsnodes.cpp \
|
||||
qbsnodetreebuilder.cpp \
|
||||
qbsparser.cpp \
|
||||
qbspmlogging.cpp \
|
||||
qbsprofilemanager.cpp \
|
||||
qbsprofilessettingspage.cpp \
|
||||
|
@@ -40,8 +40,6 @@ QtcPlugin {
|
||||
"qbsnodes.h",
|
||||
"qbsnodetreebuilder.cpp",
|
||||
"qbsnodetreebuilder.h",
|
||||
"qbsparser.cpp",
|
||||
"qbsparser.h",
|
||||
"qbspmlogging.cpp",
|
||||
"qbspmlogging.h",
|
||||
"qbsprofilemanager.cpp",
|
||||
|
Reference in New Issue
Block a user