2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2017-02-09 11:40:25 +01:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "qmakeprojectmanager_global.h"
|
|
|
|
|
#include "proparser/prowriter.h"
|
|
|
|
|
#include "proparser/profileevaluator.h"
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/idocument.h>
|
2021-08-30 10:58:08 +02:00
|
|
|
#include <cppeditor/generatedcodemodelsupport.h>
|
2019-07-24 16:04:09 +02:00
|
|
|
#include <utils/textfileformat.h>
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2019-08-20 14:48:48 +02:00
|
|
|
#include <QFutureWatcher>
|
2017-02-09 11:40:25 +01:00
|
|
|
#include <QHash>
|
2020-03-11 14:01:35 +01:00
|
|
|
#include <QLoggingCategory>
|
2017-02-09 11:40:25 +01:00
|
|
|
#include <QMap>
|
2019-08-20 14:48:48 +02:00
|
|
|
#include <QPair>
|
|
|
|
|
#include <QStringList>
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2017-02-09 15:09:25 +01:00
|
|
|
#include <memory>
|
|
|
|
|
|
2020-02-18 15:55:26 +01:00
|
|
|
namespace ProjectExplorer { class BuildConfiguration; }
|
|
|
|
|
|
2018-11-30 10:31:56 +02:00
|
|
|
namespace Utils {
|
2019-05-28 13:49:26 +02:00
|
|
|
class FilePath;
|
2018-11-30 10:31:56 +02:00
|
|
|
class FileSystemWatcher;
|
|
|
|
|
} // namespace Utils;
|
|
|
|
|
|
2017-02-09 11:40:25 +01:00
|
|
|
namespace QtSupport { class ProFileReader; }
|
|
|
|
|
|
|
|
|
|
namespace QmakeProjectManager {
|
2019-10-25 09:55:32 +02:00
|
|
|
class QmakeBuildSystem;
|
2017-02-09 16:45:36 +01:00
|
|
|
class QmakeProFile;
|
2017-02-09 11:40:25 +01:00
|
|
|
class QmakeProject;
|
|
|
|
|
|
|
|
|
|
// Type of projects
|
|
|
|
|
enum class ProjectType {
|
|
|
|
|
Invalid = 0,
|
|
|
|
|
ApplicationTemplate,
|
|
|
|
|
StaticLibraryTemplate,
|
|
|
|
|
SharedLibraryTemplate,
|
|
|
|
|
ScriptTemplate,
|
|
|
|
|
AuxTemplate,
|
|
|
|
|
SubDirsTemplate
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Other variables of interest
|
|
|
|
|
enum class Variable {
|
|
|
|
|
Defines = 1,
|
|
|
|
|
IncludePath,
|
|
|
|
|
CppFlags,
|
2017-11-03 12:26:21 +01:00
|
|
|
CFlags,
|
2019-01-04 09:07:55 +01:00
|
|
|
ExactSource,
|
|
|
|
|
CumulativeSource,
|
2017-02-09 11:40:25 +01:00
|
|
|
ExactResource,
|
|
|
|
|
CumulativeResource,
|
|
|
|
|
UiDir,
|
|
|
|
|
HeaderExtension,
|
|
|
|
|
CppExtension,
|
|
|
|
|
MocDir,
|
|
|
|
|
PkgConfig,
|
|
|
|
|
PrecompiledHeader,
|
|
|
|
|
LibDirectories,
|
|
|
|
|
Config,
|
|
|
|
|
Qt,
|
|
|
|
|
QmlImportPath,
|
|
|
|
|
QmlDesignerImportPath,
|
|
|
|
|
Makefile,
|
|
|
|
|
ObjectExt,
|
|
|
|
|
ObjectsDir,
|
|
|
|
|
Version,
|
|
|
|
|
TargetExt,
|
|
|
|
|
TargetVersionExt,
|
|
|
|
|
StaticLibExtension,
|
|
|
|
|
ShLibExtension,
|
2021-09-05 18:49:26 +03:00
|
|
|
AndroidAbi,
|
2020-07-14 15:23:26 +03:00
|
|
|
AndroidAbis,
|
2021-09-05 18:49:26 +03:00
|
|
|
AndroidDeploySettingsFile,
|
2017-02-09 11:40:25 +01:00
|
|
|
AndroidPackageSourceDir,
|
|
|
|
|
AndroidExtraLibs,
|
2021-09-05 18:49:26 +03:00
|
|
|
AndroidApplicationArgs,
|
2019-11-14 15:02:47 +01:00
|
|
|
AppmanPackageDir,
|
|
|
|
|
AppmanManifest,
|
2017-02-09 11:40:25 +01:00
|
|
|
IsoIcons,
|
|
|
|
|
QmakeProjectName,
|
|
|
|
|
QmakeCc,
|
|
|
|
|
QmakeCxx
|
|
|
|
|
};
|
2022-07-13 09:27:18 +02:00
|
|
|
size_t qHash(Variable key, uint seed = 0);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
|
|
|
|
namespace Internal {
|
2020-03-11 14:01:35 +01:00
|
|
|
Q_DECLARE_LOGGING_CATEGORY(qmakeNodesLog)
|
2017-02-09 11:40:25 +01:00
|
|
|
class QmakeEvalInput;
|
|
|
|
|
class QmakeEvalResult;
|
2021-10-21 12:15:57 +02:00
|
|
|
using QmakeEvalResultPtr = std::shared_ptr<QmakeEvalResult>; // FIXME: Use unique_ptr once we require Qt 6
|
2017-02-09 11:40:25 +01:00
|
|
|
class QmakePriFileEvalResult;
|
2017-02-09 15:43:06 +01:00
|
|
|
} // namespace Internal;
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2017-02-15 13:44:13 +01:00
|
|
|
class InstallsList;
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2019-08-20 14:48:48 +02:00
|
|
|
enum class FileOrigin { ExactParse, CumulativeParse };
|
2022-07-13 09:27:18 +02:00
|
|
|
size_t qHash(FileOrigin fo);
|
2019-08-20 14:48:48 +02:00
|
|
|
using SourceFile = QPair<Utils::FilePath, FileOrigin>;
|
|
|
|
|
using SourceFiles = QSet<SourceFile>;
|
|
|
|
|
|
2017-02-09 11:40:25 +01:00
|
|
|
// Implements ProjectNode for qmake .pri files
|
2017-02-10 09:56:33 +01:00
|
|
|
class QMAKEPROJECTMANAGER_EXPORT QmakePriFile
|
2017-02-09 11:40:25 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2019-10-25 09:55:32 +02:00
|
|
|
QmakePriFile(QmakeBuildSystem *buildSystem, QmakeProFile *qmakeProFile, const Utils::FilePath &filePath);
|
2020-01-31 15:52:20 +01:00
|
|
|
explicit QmakePriFile(const Utils::FilePath &filePath);
|
2017-02-10 09:56:33 +01:00
|
|
|
virtual ~QmakePriFile();
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2020-01-31 15:52:20 +01:00
|
|
|
void finishInitialization(QmakeBuildSystem *buildSystem, QmakeProFile *qmakeProFile);
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath filePath() const;
|
|
|
|
|
Utils::FilePath directoryPath() const;
|
2017-02-15 10:24:32 +01:00
|
|
|
virtual QString displayName() const;
|
2017-02-09 15:35:19 +01:00
|
|
|
|
2017-02-09 17:02:47 +01:00
|
|
|
QmakePriFile *parent() const;
|
2017-02-15 10:24:32 +01:00
|
|
|
QmakeProject *project() const;
|
2022-09-30 13:13:35 +02:00
|
|
|
const QVector<QmakePriFile *> children() const;
|
2017-02-15 12:24:57 +01:00
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
QmakePriFile *findPriFile(const Utils::FilePath &fileName);
|
|
|
|
|
const QmakePriFile *findPriFile(const Utils::FilePath &fileName) const;
|
2017-02-15 12:24:57 +01:00
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
bool knowsFile(const Utils::FilePath &filePath) const;
|
2017-02-15 14:47:30 +01:00
|
|
|
|
2017-02-10 09:56:33 +01:00
|
|
|
void makeEmpty();
|
2017-02-09 17:02:47 +01:00
|
|
|
|
2019-05-06 16:46:03 +02:00
|
|
|
// Files of the specified type declared in this file.
|
2019-08-20 14:48:48 +02:00
|
|
|
SourceFiles files(const ProjectExplorer::FileType &type) const;
|
2017-02-15 12:52:36 +01:00
|
|
|
|
2019-05-06 16:46:03 +02:00
|
|
|
// Files of the specified type declared in this file and in included .pri files.
|
2019-05-28 13:49:26 +02:00
|
|
|
const QSet<Utils::FilePath> collectFiles(const ProjectExplorer::FileType &type) const;
|
2019-05-06 16:46:03 +02:00
|
|
|
|
2017-02-09 11:40:25 +01:00
|
|
|
void update(const Internal::QmakePriFileEvalResult &result);
|
|
|
|
|
|
2021-08-09 14:03:54 +02:00
|
|
|
bool canAddSubProject(const Utils::FilePath &proFilePath) const;
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2021-08-09 14:03:54 +02:00
|
|
|
bool addSubProject(const Utils::FilePath &proFile);
|
|
|
|
|
bool removeSubProjects(const Utils::FilePath &proFilePath);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2021-07-14 16:49:42 +02:00
|
|
|
bool addFiles(const Utils::FilePaths &filePaths, Utils::FilePaths *notAdded = nullptr);
|
|
|
|
|
bool removeFiles(const Utils::FilePaths &filePaths, Utils::FilePaths *notRemoved = nullptr);
|
|
|
|
|
bool deleteFiles(const Utils::FilePaths &filePaths);
|
2021-06-11 14:34:34 +02:00
|
|
|
bool canRenameFile(const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath);
|
|
|
|
|
bool renameFile(const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath);
|
2019-06-18 15:41:27 +02:00
|
|
|
bool addDependencies(const QStringList &dependencies);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
|
|
|
|
bool setProVariable(const QString &var, const QStringList &values,
|
|
|
|
|
const QString &scope = QString(),
|
|
|
|
|
int flags = QmakeProjectManager::Internal::ProWriter::ReplaceValues);
|
|
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
bool folderChanged(const QString &changedFolder, const QSet<Utils::FilePath> &newFiles);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2017-12-20 17:48:37 +01:00
|
|
|
bool deploysFolder(const QString &folder) const;
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2017-02-09 16:45:36 +01:00
|
|
|
QmakeProFile *proFile() const;
|
2017-02-10 11:21:58 +01:00
|
|
|
QVector<QmakePriFile *> subPriFilesExact() const;
|
2017-02-09 11:40:25 +01:00
|
|
|
|
|
|
|
|
// Set by parent
|
|
|
|
|
bool includedInExactParse() const;
|
|
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
static QSet<Utils::FilePath> recursiveEnumerate(const QString &folder);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2017-02-09 15:09:25 +01:00
|
|
|
void scheduleUpdate();
|
|
|
|
|
|
2019-10-25 09:55:32 +02:00
|
|
|
QmakeBuildSystem *buildSystem() const;
|
|
|
|
|
|
2017-02-09 11:40:25 +01:00
|
|
|
protected:
|
|
|
|
|
void setIncludedInExactParse(bool b);
|
|
|
|
|
static QStringList varNames(ProjectExplorer::FileType type, QtSupport::ProFileReader *readerExact);
|
|
|
|
|
static QStringList varNamesForRemoving();
|
|
|
|
|
static QString varNameForAdding(const QString &mimeType);
|
2019-05-28 13:49:26 +02:00
|
|
|
static QSet<Utils::FilePath> filterFilesProVariables(ProjectExplorer::FileType fileType, const QSet<Utils::FilePath> &files);
|
|
|
|
|
static QSet<Utils::FilePath> filterFilesRecursiveEnumerata(ProjectExplorer::FileType fileType, const QSet<Utils::FilePath> &files);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
|
|
|
|
enum ChangeType {
|
|
|
|
|
AddToProFile,
|
|
|
|
|
RemoveFromProFile
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum class Change { Save, TestOnly };
|
2021-06-11 14:34:34 +02:00
|
|
|
bool renameFile(const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath, Change mode);
|
2017-02-09 11:40:25 +01:00
|
|
|
void changeFiles(const QString &mimeType,
|
2021-07-14 16:49:42 +02:00
|
|
|
const Utils::FilePaths &filePaths,
|
|
|
|
|
Utils::FilePaths *notChanged,
|
2017-02-09 11:40:25 +01:00
|
|
|
ChangeType change,
|
|
|
|
|
Change mode = Change::Save);
|
|
|
|
|
|
2017-02-09 17:02:47 +01:00
|
|
|
void addChild(QmakePriFile *pf);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2017-02-09 15:09:25 +01:00
|
|
|
private:
|
2017-02-09 17:02:47 +01:00
|
|
|
void setParent(QmakePriFile *p);
|
|
|
|
|
|
2017-02-09 11:40:25 +01:00
|
|
|
bool prepareForChange();
|
|
|
|
|
static bool ensureWriteableProFile(const QString &file);
|
2019-07-24 16:04:09 +02:00
|
|
|
QPair<ProFile *, QStringList> readProFile();
|
2017-02-09 11:40:25 +01:00
|
|
|
static QPair<ProFile *, QStringList> readProFileFromContents(const QString &contents);
|
|
|
|
|
void save(const QStringList &lines);
|
|
|
|
|
bool saveModifiedEditors();
|
2021-07-14 16:49:42 +02:00
|
|
|
Utils::FilePaths formResources(const Utils::FilePath &formFile) const;
|
2017-02-09 11:40:25 +01:00
|
|
|
static QStringList baseVPaths(QtSupport::ProFileReader *reader, const QString &projectDir, const QString &buildDir);
|
|
|
|
|
static QStringList fullVPaths(const QStringList &baseVPaths, QtSupport::ProFileReader *reader, const QString &qmakeVariable, const QString &projectDir);
|
2019-08-20 14:48:48 +02:00
|
|
|
static void extractSources(QHash<int, Internal::QmakePriFileEvalResult *> proToResult,
|
2017-02-09 11:40:25 +01:00
|
|
|
Internal::QmakePriFileEvalResult *fallback,
|
2019-08-20 14:48:48 +02:00
|
|
|
QVector<ProFileEvaluator::SourceFile> sourceFiles, ProjectExplorer::FileType type, bool cumulative);
|
2017-02-09 11:40:25 +01:00
|
|
|
static void extractInstalls(
|
2017-08-14 18:30:29 +02:00
|
|
|
QHash<int, Internal::QmakePriFileEvalResult *> proToResult,
|
2017-02-09 11:40:25 +01:00
|
|
|
Internal::QmakePriFileEvalResult *fallback,
|
2017-02-15 13:44:13 +01:00
|
|
|
const InstallsList &installList);
|
2017-02-09 11:40:25 +01:00
|
|
|
static void processValues(Internal::QmakePriFileEvalResult &result);
|
2019-05-28 13:49:26 +02:00
|
|
|
void watchFolders(const QSet<Utils::FilePath> &folders);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2019-02-01 16:50:29 +01:00
|
|
|
QString continuationIndent() const;
|
|
|
|
|
|
2019-10-25 09:55:32 +02:00
|
|
|
QPointer<QmakeBuildSystem> m_buildSystem;
|
2017-02-09 16:45:36 +01:00
|
|
|
QmakeProFile *m_qmakeProFile = nullptr;
|
2017-02-09 17:02:47 +01:00
|
|
|
QmakePriFile *m_parent = nullptr;
|
|
|
|
|
QVector<QmakePriFile *> m_children;
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2019-07-24 16:04:09 +02:00
|
|
|
Utils::TextFileFormat m_textFormat;
|
2017-02-09 11:40:25 +01:00
|
|
|
|
|
|
|
|
// Memory is cheap...
|
2019-08-20 14:48:48 +02:00
|
|
|
QMap<ProjectExplorer::FileType, SourceFiles> m_files;
|
2019-05-28 13:49:26 +02:00
|
|
|
QSet<Utils::FilePath> m_recursiveEnumerateFiles; // FIXME: Remove this?!
|
2017-02-09 11:40:25 +01:00
|
|
|
QSet<QString> m_watchedFolders;
|
2020-01-31 15:52:20 +01:00
|
|
|
const Utils::FilePath m_filePath;
|
2017-02-09 11:40:25 +01:00
|
|
|
bool m_includedInExactParse = true;
|
|
|
|
|
|
2017-02-10 11:16:18 +01:00
|
|
|
friend class QmakeProFile;
|
2017-02-09 11:40:25 +01:00
|
|
|
};
|
|
|
|
|
|
2017-02-15 13:44:13 +01:00
|
|
|
class QMAKEPROJECTMANAGER_EXPORT TargetInformation
|
2017-02-09 11:40:25 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
bool valid = false;
|
|
|
|
|
QString target;
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath destDir;
|
|
|
|
|
Utils::FilePath buildDir;
|
2017-02-09 11:40:25 +01:00
|
|
|
QString buildTarget;
|
2017-02-15 13:44:13 +01:00
|
|
|
bool operator==(const TargetInformation &other) const
|
2017-02-09 11:40:25 +01:00
|
|
|
{
|
|
|
|
|
return target == other.target
|
|
|
|
|
&& valid == other.valid
|
|
|
|
|
&& destDir == other.destDir
|
|
|
|
|
&& buildDir == other.buildDir
|
|
|
|
|
&& buildTarget == other.buildTarget;
|
|
|
|
|
}
|
2017-02-15 13:44:13 +01:00
|
|
|
bool operator!=(const TargetInformation &other) const
|
2017-02-09 11:40:25 +01:00
|
|
|
{
|
|
|
|
|
return !(*this == other);
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-15 13:44:13 +01:00
|
|
|
TargetInformation() = default;
|
2017-02-09 11:40:25 +01:00
|
|
|
};
|
|
|
|
|
|
2017-02-15 13:44:13 +01:00
|
|
|
class QMAKEPROJECTMANAGER_EXPORT InstallsItem {
|
2017-02-09 23:30:14 +01:00
|
|
|
public:
|
2017-02-15 13:44:13 +01:00
|
|
|
InstallsItem() = default;
|
2019-07-04 11:30:56 +02:00
|
|
|
InstallsItem(QString p, QVector<ProFileEvaluator::SourceFile> f, bool a, bool e)
|
|
|
|
|
: path(p), files(f), active(a), executable(e) {}
|
2017-02-09 11:40:25 +01:00
|
|
|
QString path;
|
|
|
|
|
QVector<ProFileEvaluator::SourceFile> files;
|
|
|
|
|
bool active = false;
|
2019-07-04 11:30:56 +02:00
|
|
|
bool executable = false;
|
2017-02-09 11:40:25 +01:00
|
|
|
};
|
|
|
|
|
|
2017-02-15 13:44:13 +01:00
|
|
|
class QMAKEPROJECTMANAGER_EXPORT InstallsList {
|
2017-02-09 23:30:14 +01:00
|
|
|
public:
|
2017-02-09 11:40:25 +01:00
|
|
|
void clear() { targetPath.clear(); items.clear(); }
|
|
|
|
|
QString targetPath;
|
2017-02-15 13:44:13 +01:00
|
|
|
QVector<InstallsItem> items;
|
2017-02-09 11:40:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Implements ProjectNode for qmake .pro files
|
2017-02-09 16:45:36 +01:00
|
|
|
class QMAKEPROJECTMANAGER_EXPORT QmakeProFile : public QmakePriFile
|
2017-02-09 11:40:25 +01:00
|
|
|
{
|
|
|
|
|
public:
|
2019-10-25 09:55:32 +02:00
|
|
|
QmakeProFile(QmakeBuildSystem *buildSystem, const Utils::FilePath &filePath);
|
2020-01-31 15:52:20 +01:00
|
|
|
explicit QmakeProFile(const Utils::FilePath &filePath);
|
2017-02-09 16:45:36 +01:00
|
|
|
~QmakeProFile() override;
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2017-02-09 16:45:36 +01:00
|
|
|
bool isParent(QmakeProFile *node);
|
2017-02-15 10:24:32 +01:00
|
|
|
QString displayName() const final;
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2017-02-15 12:40:09 +01:00
|
|
|
QList<QmakeProFile *> allProFiles();
|
2019-05-28 13:49:26 +02:00
|
|
|
QmakeProFile *findProFile(const Utils::FilePath &fileName);
|
|
|
|
|
const QmakeProFile *findProFile(const Utils::FilePath &fileName) const;
|
2017-02-15 12:40:09 +01:00
|
|
|
|
2017-02-09 11:40:25 +01:00
|
|
|
ProjectType projectType() const;
|
|
|
|
|
|
|
|
|
|
QStringList variableValue(const Variable var) const;
|
|
|
|
|
QString singleVariableValue(const Variable var) const;
|
|
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
bool isSubProjectDeployable(const Utils::FilePath &filePath) const {
|
2017-02-09 11:40:25 +01:00
|
|
|
return !m_subProjectsNotToDeploy.contains(filePath);
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath sourceDir() const;
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2019-12-17 14:07:53 +01:00
|
|
|
Utils::FilePaths generatedFiles(const Utils::FilePath &buildDirectory,
|
2019-05-28 13:49:26 +02:00
|
|
|
const Utils::FilePath &sourceFile,
|
2017-02-10 11:16:18 +01:00
|
|
|
const ProjectExplorer::FileType &sourceFileType) const;
|
2017-02-09 11:40:25 +01:00
|
|
|
QList<ProjectExplorer::ExtraCompiler *> extraCompilers() const;
|
|
|
|
|
|
2017-02-15 13:44:13 +01:00
|
|
|
TargetInformation targetInformation() const;
|
|
|
|
|
InstallsList installsList() const;
|
2019-03-19 16:03:36 +01:00
|
|
|
const QStringList featureRoots() const { return m_featureRoots; }
|
2017-02-09 11:40:25 +01:00
|
|
|
|
|
|
|
|
QByteArray cxxDefines() const;
|
|
|
|
|
|
|
|
|
|
enum AsyncUpdateDelay { ParseNow, ParseLater };
|
2017-02-09 16:45:36 +01:00
|
|
|
using QmakePriFile::scheduleUpdate;
|
2017-02-09 11:40:25 +01:00
|
|
|
void scheduleUpdate(AsyncUpdateDelay delay);
|
|
|
|
|
|
|
|
|
|
bool validParse() const;
|
|
|
|
|
bool parseInProgress() const;
|
|
|
|
|
|
|
|
|
|
void setParseInProgressRecursive(bool b);
|
|
|
|
|
|
|
|
|
|
void asyncUpdate();
|
|
|
|
|
|
2019-06-18 14:39:38 +03:00
|
|
|
bool isFileFromWildcard(const QString &filePath) const;
|
|
|
|
|
|
2017-02-09 11:40:25 +01:00
|
|
|
private:
|
2021-10-25 11:18:49 +02:00
|
|
|
void cleanupFutureWatcher();
|
|
|
|
|
void setupFutureWatcher();
|
|
|
|
|
|
2017-02-09 11:40:25 +01:00
|
|
|
void setParseInProgress(bool b);
|
|
|
|
|
void setValidParseRecursive(bool b);
|
|
|
|
|
|
|
|
|
|
void setupReader();
|
|
|
|
|
Internal::QmakeEvalInput evalInput() const;
|
|
|
|
|
|
2021-10-21 12:15:57 +02:00
|
|
|
static Internal::QmakeEvalResultPtr evaluate(const Internal::QmakeEvalInput &input);
|
|
|
|
|
void applyEvaluate(const Internal::QmakeEvalResultPtr &parseResult);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2021-10-21 12:15:57 +02:00
|
|
|
void asyncEvaluate(QFutureInterface<Internal::QmakeEvalResultPtr> &fi,
|
|
|
|
|
Internal::QmakeEvalInput input);
|
2017-02-09 11:40:25 +01:00
|
|
|
void cleanupProFileReaders();
|
|
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
void updateGeneratedFiles(const Utils::FilePath &buildDir);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
static QString uiDirPath(QtSupport::ProFileReader *reader, const Utils::FilePath &buildDir);
|
|
|
|
|
static QString mocDirPath(QtSupport::ProFileReader *reader, const Utils::FilePath &buildDir);
|
2017-02-09 11:40:25 +01:00
|
|
|
static QString sysrootify(const QString &path, const QString &sysroot, const QString &baseDir, const QString &outputDir);
|
2019-05-28 13:49:26 +02:00
|
|
|
static QStringList includePaths(QtSupport::ProFileReader *reader, const Utils::FilePath &sysroot, const Utils::FilePath &buildDir, const QString &projectDir);
|
2017-02-09 11:40:25 +01:00
|
|
|
static QStringList libDirectories(QtSupport::ProFileReader *reader);
|
2019-12-17 14:07:53 +01:00
|
|
|
static Utils::FilePaths subDirsPaths(QtSupport::ProFileReader *reader, const QString &projectDir, QStringList *subProjectsNotToDeploy, QStringList *errors);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
static TargetInformation targetInformation(QtSupport::ProFileReader *reader, QtSupport::ProFileReader *readerBuildPass, const Utils::FilePath &buildDir, const Utils::FilePath &projectFilePath);
|
2017-02-15 13:44:13 +01:00
|
|
|
static InstallsList installsList(const QtSupport::ProFileReader *reader, const QString &projectFilePath, const QString &projectDir, const QString &buildDir);
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
void setupExtraCompiler(const Utils::FilePath &buildDir,
|
2017-02-10 11:16:18 +01:00
|
|
|
const ProjectExplorer::FileType &fileType,
|
|
|
|
|
ProjectExplorer::ExtraCompilerFactory *factory);
|
|
|
|
|
|
2017-02-09 11:40:25 +01:00
|
|
|
bool m_validParse = false;
|
|
|
|
|
bool m_parseInProgress = false;
|
|
|
|
|
|
2017-02-10 09:56:33 +01:00
|
|
|
QString m_displayName;
|
2017-02-09 11:40:25 +01:00
|
|
|
ProjectType m_projectType = ProjectType::Invalid;
|
2017-02-15 12:24:57 +01:00
|
|
|
|
|
|
|
|
using VariablesHash = QHash<Variable, QStringList>;
|
2017-02-09 11:40:25 +01:00
|
|
|
VariablesHash m_varValues;
|
2017-02-15 12:24:57 +01:00
|
|
|
|
2017-02-09 11:40:25 +01:00
|
|
|
QList<ProjectExplorer::ExtraCompiler *> m_extraCompilers;
|
|
|
|
|
|
2017-02-15 13:44:13 +01:00
|
|
|
TargetInformation m_qmakeTargetInformation;
|
2019-12-17 14:07:53 +01:00
|
|
|
Utils::FilePaths m_subProjectsNotToDeploy;
|
2017-02-15 13:44:13 +01:00
|
|
|
InstallsList m_installsList;
|
2019-03-19 16:03:36 +01:00
|
|
|
QStringList m_featureRoots;
|
2017-02-09 11:40:25 +01:00
|
|
|
|
2018-11-30 10:31:56 +02:00
|
|
|
std::unique_ptr<Utils::FileSystemWatcher> m_wildcardWatcher;
|
2019-04-25 11:06:58 +03:00
|
|
|
QMap<QString, QStringList> m_wildcardDirectoryContents;
|
2018-11-30 10:31:56 +02:00
|
|
|
|
2017-02-09 11:40:25 +01:00
|
|
|
// Async stuff
|
2021-10-21 12:15:57 +02:00
|
|
|
QFutureWatcher<Internal::QmakeEvalResultPtr> *m_parseFutureWatcher = nullptr;
|
2017-02-09 11:40:25 +01:00
|
|
|
QtSupport::ProFileReader *m_readerExact = nullptr;
|
|
|
|
|
QtSupport::ProFileReader *m_readerCumulative = nullptr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace QmakeProjectManager
|