Merge remote-tracking branch 'origin/4.12'

Conflicts:
	src/plugins/cmakeprojectmanager/tealeafreader.cpp
	src/plugins/cmakeprojectmanager/tealeafreader.h
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: I88d85be3903f57a55fddb7901e771a4822db1b85
This commit is contained in:
Eike Ziller
2020-03-04 08:15:50 +01:00
368 changed files with 8945 additions and 6485 deletions

View File

@@ -390,7 +390,7 @@ void BuildDirManager::parse()
reparseParameters & REPARSE_FORCE_CONFIGURATION);
}
QVector<FilePath> BuildDirManager::takeProjectFilesToWatch()
QSet<FilePath> BuildDirManager::projectFilesToWatch() const
{
QTC_ASSERT(!m_isHandlingError, return {});
QTC_ASSERT(m_reader, return {});
@@ -398,7 +398,7 @@ QVector<FilePath> BuildDirManager::takeProjectFilesToWatch()
Utils::FilePath sourceDir = m_parameters.sourceDirectory;
Utils::FilePath buildDir = m_parameters.workDirectory;
return Utils::filtered(m_reader->takeProjectFilesToWatch(),
return Utils::filtered(m_reader->projectFilesToWatch(),
[&sourceDir,
&buildDir](const Utils::FilePath &p) {
return p.isChildOf(sourceDir)

View File

@@ -89,7 +89,7 @@ public:
bool isFilesystemScanRequested() const;
void parse();
QVector<Utils::FilePath> takeProjectFilesToWatch();
QSet<Utils::FilePath> projectFilesToWatch() const;
std::unique_ptr<CMakeProjectNode> generateProjectTree(const QList<const ProjectExplorer::FileNode *> &allFiles,
QString &errorMessage) const;
ProjectExplorer::RawProjectParts createRawProjectParts(QString &errorMessage) const;

View File

@@ -63,7 +63,7 @@ public:
virtual bool isParsing() const = 0;
virtual QVector<Utils::FilePath> takeProjectFilesToWatch() = 0;
virtual QSet<Utils::FilePath> projectFilesToWatch() const = 0;
virtual QList<CMakeBuildTarget> takeBuildTargets(QString &errorMessage) = 0;
virtual CMakeConfig takeParsedConfiguration(QString &errorMessage) = 0;
virtual std::unique_ptr<CMakeProjectNode> generateProjectTree(

View File

@@ -294,11 +294,6 @@ void CMakeBuildConfiguration::clearError(ForceEnabledChanged fec)
}
}
void CMakeBuildConfiguration::emitBuildTypeChanged()
{
emit buildTypeChanged();
}
static CMakeConfig removeDuplicates(const CMakeConfig &config)
{
CMakeConfig result;

View File

@@ -51,8 +51,6 @@ class CMakeBuildConfiguration final : public ProjectExplorer::BuildConfiguration
~CMakeBuildConfiguration() final;
public:
void emitBuildTypeChanged();
CMakeConfig configurationForCMake() const;
CMakeConfig configurationFromCMake() const;

View File

@@ -204,7 +204,7 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc)
});
connect(project(), &Project::projectFileIsDirty, this, [this]() {
if (m_buildConfiguration->isActive()) {
if (m_buildConfiguration->isActive() && !isParsing()) {
const auto cmake = CMakeKitAspect::cmakeTool(m_buildConfiguration->target()->kit());
if (cmake && cmake->isAutoRun()) {
qCDebug(cmakeBuildSystemLog) << "Requesting parse due to dirty project file";
@@ -235,9 +235,20 @@ CMakeBuildSystem::~CMakeBuildSystem()
void CMakeBuildSystem::triggerParsing()
{
qCDebug(cmakeBuildSystemLog) << "Parsing has been triggered";
m_currentGuard = guardParsingRun();
QTC_ASSERT(m_currentGuard.guardsProject(), return );
auto guard = guardParsingRun();
if (!guard.guardsProject()) {
// This can legitimately trigger if e.g. Build->Run CMake
// is selected while this here is already running.
// FIXME: Instead of aborting the second run here we could try to
// cancel the first one in the Build->Run CMake handler and then
// continue to here normally. This here could then be an Assert.
return;
}
m_currentGuard = std::move(guard);
if (m_allFiles.isEmpty())
m_buildDirManager.requestFilesystemScan();
@@ -398,7 +409,7 @@ void CMakeBuildSystem::updateProjectData()
QTC_ASSERT(m_treeScanner.isFinished() && !m_buildDirManager.isParsing(), return);
m_buildConfiguration->project()->setExtraProjectFiles(m_buildDirManager.takeProjectFilesToWatch());
m_buildConfiguration->project()->setExtraProjectFiles(m_buildDirManager.projectFilesToWatch());
CMakeConfig patchedConfig = m_buildConfiguration->configurationFromCMake();
{
@@ -486,7 +497,7 @@ void CMakeBuildSystem::updateProjectData()
updateQmlJSCodeModel();
}
emit m_buildConfiguration->emitBuildTypeChanged();
emit m_buildConfiguration->buildTypeChanged();
m_buildDirManager.resetData();

View File

@@ -35,9 +35,11 @@
#include <utils/algorithm.h>
#include <utils/fileutils.h>
#include <utils/stringutils.h>
#include <QDir>
#include <QObject>
#include <QTime>
#include <QTimer>
namespace CMakeProjectManager {
@@ -149,6 +151,7 @@ void CMakeProcess::run(const BuildDirParameters &parameters, const QStringList &
process->setCommand(commandLine);
emit started();
m_elapsed.start();
process->start();
m_process = std::move(process);
@@ -234,6 +237,9 @@ void CMakeProcess::handleProcessFinished(int code, QProcess::ExitStatus status)
m_future->reportFinished();
emit finished(code, status);
const QString elapsedTime = Utils::formatElapsedTime(m_elapsed.elapsed());
Core::MessageManager::write(elapsedTime);
}
void CMakeProcess::checkForCancelled()

View File

@@ -31,6 +31,7 @@
#include <utils/qtcprocess.h>
#include <QElapsedTimer>
#include <QFutureInterface>
#include <QTimer>
@@ -73,6 +74,7 @@ private:
std::unique_ptr<QFutureInterface<void>> m_future;
bool m_processWasCanceled = false;
QTimer m_cancelTimer;
QElapsedTimer m_elapsed;
};
} // namespace Internal

View File

@@ -164,9 +164,9 @@ bool FileApiReader::isParsing() const
return m_isParsing;
}
QVector<FilePath> FileApiReader::takeProjectFilesToWatch()
QSet<FilePath> FileApiReader::projectFilesToWatch() const
{
return QVector<FilePath>::fromList(Utils::toList(m_cmakeFiles));
return m_cmakeFiles;
}
QList<CMakeBuildTarget> FileApiReader::takeBuildTargets(QString &errorMessage){

View File

@@ -62,7 +62,7 @@ public:
bool isParsing() const final;
QVector<Utils::FilePath> takeProjectFilesToWatch() final;
QSet<Utils::FilePath> projectFilesToWatch() const final;
QList<CMakeBuildTarget> takeBuildTargets(QString &errorMessage) final;
CMakeConfig takeParsedConfiguration(QString &errorMessage) final;
std::unique_ptr<CMakeProjectNode> generateProjectTree(

View File

@@ -55,7 +55,7 @@ public:
bool isParsing() const final;
QVector<Utils::FilePath> takeProjectFilesToWatch() final { return {}; };
QSet<Utils::FilePath> projectFilesToWatch() const final { return {}; };
QList<CMakeBuildTarget> takeBuildTargets(QString &errorMessage) final;
CMakeConfig takeParsedConfiguration(QString &errorMessage) final;
std::unique_ptr<CMakeProjectNode> generateProjectTree(