2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-16 12:10:22 +02:00
|
|
|
#include "qmakeprojectmanager_global.h"
|
2014-03-07 12:56:59 +01:00
|
|
|
#include "proparser/prowriter.h"
|
2016-10-25 20:04:29 +02:00
|
|
|
#include "proparser/profileevaluator.h"
|
2011-01-21 15:37:05 +01:00
|
|
|
|
2012-02-14 16:43:51 +01:00
|
|
|
#include <coreplugin/idocument.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <projectexplorer/projectnodes.h>
|
2016-01-15 16:12:54 +01:00
|
|
|
#include <cpptools/generatedcodemodelsupport.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QHash>
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
#include <QDateTime>
|
|
|
|
|
#include <QMap>
|
|
|
|
|
#include <QFutureWatcher>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-03-28 09:01:07 +01:00
|
|
|
namespace Utils { class FileName; }
|
|
|
|
|
|
2014-02-11 21:55:42 +02:00
|
|
|
namespace Core { class ICore; }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2011-05-20 21:40:53 +02:00
|
|
|
namespace QtSupport {
|
2012-09-07 12:35:18 +02:00
|
|
|
class BaseQtVersion;
|
2011-05-20 21:40:53 +02:00
|
|
|
class ProFileReader;
|
|
|
|
|
}
|
|
|
|
|
|
2011-08-18 16:46:44 +02:00
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
class RunConfiguration;
|
|
|
|
|
class Project;
|
|
|
|
|
}
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-16 11:02:37 +02:00
|
|
|
namespace QmakeProjectManager {
|
2013-10-16 14:00:45 +02:00
|
|
|
class QmakeBuildConfiguration;
|
2013-10-29 14:22:31 +01:00
|
|
|
class QmakeProFileNode;
|
|
|
|
|
class QmakeProject;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
// Type of projects
|
2013-10-29 16:08:37 +01:00
|
|
|
enum QmakeProjectType {
|
2008-12-02 12:01:29 +01:00
|
|
|
InvalidProject = 0,
|
|
|
|
|
ApplicationTemplate,
|
2015-03-17 11:39:48 +02:00
|
|
|
StaticLibraryTemplate,
|
|
|
|
|
SharedLibraryTemplate,
|
2008-12-02 12:01:29 +01:00
|
|
|
ScriptTemplate,
|
2011-05-05 17:42:35 +02:00
|
|
|
AuxTemplate,
|
2008-12-02 12:01:29 +01:00
|
|
|
SubDirsTemplate
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Other variables of interest
|
2013-10-29 16:08:37 +01:00
|
|
|
enum QmakeVariable {
|
2008-12-02 12:01:29 +01:00
|
|
|
DefinesVar = 1,
|
|
|
|
|
IncludePathVar,
|
2012-02-16 15:09:56 +01:00
|
|
|
CppFlagsVar,
|
unify {,obj}c++{source,header} handling in qmake project manager
consistently with Xcode, qmake nowadays knows only one SOURCES list,
which is automatically classified by extension.
to replicate that, we actually copy the objective_c.prf file from qt
5.6.3 and use it to override whatever comes with qt, so we can treat all
qt versions uniformly.
also, the code model throws away the information which files were listed
as sources and which as headers. this is technically incorrect, as a
source may be only included rather than compiled, but there is no point
in extracting information which is not used.
conclusion: lump all c-like sources into one variable as far as project
processing is concerned.
and as far as configuration goes, our code model doesn't differentiate
anyway, so the duplicated setup paths can be eliminated as well.
Change-Id: I24b1bc056f8d9eb579c9378817f602912ab49971
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-25 16:28:40 +02:00
|
|
|
SourceVar,
|
2013-05-21 11:35:15 +02:00
|
|
|
ExactResourceVar,
|
2016-10-27 16:36:06 +02:00
|
|
|
CumulativeResourceVar,
|
2008-12-02 12:01:29 +01:00
|
|
|
UiDirVar,
|
2016-02-08 17:53:07 +01:00
|
|
|
HeaderExtensionVar,
|
|
|
|
|
CppExtensionVar,
|
2009-05-13 18:09:47 +02:00
|
|
|
MocDirVar,
|
2010-01-12 13:13:22 +01:00
|
|
|
PkgConfigVar,
|
2010-03-29 15:17:04 +02:00
|
|
|
PrecompiledHeaderVar,
|
2010-08-16 18:23:30 +02:00
|
|
|
LibDirectoriesVar,
|
2010-09-21 14:28:55 +02:00
|
|
|
ConfigVar,
|
2011-09-15 13:30:54 +02:00
|
|
|
QtVar,
|
2010-10-05 17:38:45 +02:00
|
|
|
QmlImportPathVar,
|
2016-09-28 17:49:50 +02:00
|
|
|
QmlDesignerImportPathVar,
|
2010-12-14 16:19:44 +01:00
|
|
|
Makefile,
|
2012-04-28 22:24:33 +03:00
|
|
|
ObjectExt,
|
2012-08-20 12:41:52 +02:00
|
|
|
ObjectsDir,
|
|
|
|
|
VersionVar,
|
2013-03-12 14:09:18 +01:00
|
|
|
TargetExtVar,
|
2012-08-20 12:41:52 +02:00
|
|
|
TargetVersionExtVar,
|
|
|
|
|
StaticLibExtensionVar,
|
2013-02-27 16:29:32 +01:00
|
|
|
ShLibExtensionVar,
|
2013-09-17 18:24:57 +02:00
|
|
|
AndroidArchVar,
|
2013-09-26 18:38:44 +02:00
|
|
|
AndroidDeploySettingsFile,
|
2013-09-30 15:32:06 +02:00
|
|
|
AndroidPackageSourceDir,
|
2015-01-21 13:32:08 +01:00
|
|
|
AndroidExtraLibs,
|
2015-08-12 11:16:36 +02:00
|
|
|
IsoIconsVar,
|
2016-09-23 15:53:31 +02:00
|
|
|
QmakeProjectName,
|
|
|
|
|
QmakeCc,
|
|
|
|
|
QmakeCxx
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2011-09-07 11:52:04 +02:00
|
|
|
namespace Internal {
|
2013-10-29 14:22:31 +01:00
|
|
|
class QmakePriFile;
|
2011-09-07 11:52:04 +02:00
|
|
|
struct InternalNode;
|
2014-09-09 15:38:48 +02:00
|
|
|
|
2014-09-10 12:53:55 +02:00
|
|
|
class EvalInput;
|
|
|
|
|
class EvalResult;
|
|
|
|
|
class PriFileEvalResult;
|
2011-09-07 11:52:04 +02:00
|
|
|
}
|
2010-01-20 14:47:08 +01:00
|
|
|
|
2016-10-25 21:25:25 +02:00
|
|
|
struct InstallsList;
|
|
|
|
|
|
2013-10-29 17:37:39 +01:00
|
|
|
// Implements ProjectNode for qmake .pri files
|
2013-10-29 15:58:10 +01:00
|
|
|
class QMAKEPROJECTMANAGER_EXPORT QmakePriFileNode : public ProjectExplorer::ProjectNode
|
2009-03-19 16:33:44 +01:00
|
|
|
{
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
2015-02-02 00:37:38 +02:00
|
|
|
QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmakeProFileNode, const Utils::FileName &filePath);
|
2015-10-29 16:59:27 +01:00
|
|
|
~QmakePriFileNode() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-09-10 12:53:55 +02:00
|
|
|
void update(const Internal::PriFileEvalResult &result);
|
2010-03-10 16:55:37 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
// ProjectNode interface
|
|
|
|
|
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
bool showInSimpleTree() const override { return false; }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
bool canAddSubProject(const QString &proFilePath) const override;
|
2010-08-26 18:33:16 +02:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
bool addSubProjects(const QStringList &proFilePaths) override;
|
|
|
|
|
bool removeSubProjects(const QStringList &proFilePaths) override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0) override;
|
|
|
|
|
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0) override;
|
|
|
|
|
bool deleteFiles(const QStringList &filePaths) override;
|
|
|
|
|
bool canRenameFile(const QString &filePath, const QString &newFilePath) override;
|
|
|
|
|
bool renameFile(const QString &filePath, const QString &newFilePath) override;
|
|
|
|
|
AddNewInformation addNewInformation(const QStringList &files, Node *context) const override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-03-07 12:56:59 +01:00
|
|
|
bool setProVariable(const QString &var, const QStringList &values,
|
|
|
|
|
const QString &scope = QString(),
|
|
|
|
|
int flags = QmakeProjectManager::Internal::ProWriter::ReplaceValues);
|
2013-09-26 18:38:44 +02:00
|
|
|
|
2013-07-01 11:35:38 +02:00
|
|
|
bool folderChanged(const QString &changedFolder, const QSet<Utils::FileName> &newFiles);
|
2010-08-10 16:27:35 +02:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
bool deploysFolder(const QString &folder) const override;
|
|
|
|
|
QList<ProjectExplorer::RunConfiguration *> runConfigurations() const override;
|
2010-08-24 17:17:11 +02:00
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakeProFileNode *proFileNode() const;
|
|
|
|
|
QList<QmakePriFileNode*> subProjectNodesExact() const;
|
2011-09-06 17:21:51 +02:00
|
|
|
|
|
|
|
|
// Set by parent
|
|
|
|
|
bool includedInExactParse() const;
|
|
|
|
|
|
2013-07-01 11:35:38 +02:00
|
|
|
static QSet<Utils::FileName> recursiveEnumerate(const QString &folder);
|
2015-09-14 15:33:50 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
protected:
|
2011-09-06 17:21:51 +02:00
|
|
|
void setIncludedInExactParse(bool b);
|
2014-01-24 15:16:06 +01:00
|
|
|
static QStringList varNames(ProjectExplorer::FileType type, QtSupport::ProFileReader *readerExact);
|
2013-08-08 19:32:33 +02:00
|
|
|
static QStringList varNamesForRemoving();
|
|
|
|
|
static QString varNameForAdding(const QString &mimeType);
|
2011-11-08 18:53:51 +01:00
|
|
|
static QSet<Utils::FileName> filterFilesProVariables(ProjectExplorer::FileType fileType, const QSet<Utils::FileName> &files);
|
|
|
|
|
static QSet<Utils::FileName> filterFilesRecursiveEnumerata(ProjectExplorer::FileType fileType, const QSet<Utils::FileName> &files);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
enum ChangeType {
|
|
|
|
|
AddToProFile,
|
|
|
|
|
RemoveFromProFile
|
|
|
|
|
};
|
|
|
|
|
|
2015-09-14 15:33:50 +02:00
|
|
|
enum class Change { Save, TestOnly };
|
|
|
|
|
bool renameFile(const QString &oldName,
|
|
|
|
|
const QString &newName,
|
|
|
|
|
const QString &mimeType,
|
|
|
|
|
Change mode = Change::Save);
|
2013-07-01 16:13:48 +02:00
|
|
|
void changeFiles(const QString &mimeType,
|
2008-12-02 12:01:29 +01:00
|
|
|
const QStringList &filePaths,
|
|
|
|
|
QStringList *notChanged,
|
2015-09-14 15:33:50 +02:00
|
|
|
ChangeType change,
|
|
|
|
|
Change mode = Change::Save);
|
2008-12-05 14:29:18 +01:00
|
|
|
|
2015-01-09 15:50:06 +01:00
|
|
|
private:
|
2008-12-09 17:17:12 +01:00
|
|
|
void scheduleUpdate();
|
|
|
|
|
|
2015-09-14 15:33:50 +02:00
|
|
|
bool prepareForChange();
|
2013-09-26 18:38:44 +02:00
|
|
|
static bool ensureWriteableProFile(const QString &file);
|
|
|
|
|
static QPair<ProFile *, QStringList> readProFile(const QString &file);
|
2014-03-07 12:56:59 +01:00
|
|
|
static QPair<ProFile *, QStringList> readProFileFromContents(const QString &contents);
|
2010-01-14 22:58:55 +01:00
|
|
|
void save(const QStringList &lines);
|
2015-10-29 17:53:47 +01:00
|
|
|
bool priFileWritable(const QString &absoluteFilePath);
|
2010-01-22 16:49:57 +01:00
|
|
|
bool saveModifiedEditors();
|
2010-06-08 12:15:43 +02:00
|
|
|
QStringList formResources(const QString &formFile) const;
|
2014-09-10 12:53:55 +02: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);
|
2016-10-25 20:04:29 +02:00
|
|
|
static void extractSources(
|
|
|
|
|
QHash<const ProFile *, Internal::PriFileEvalResult *> proToResult,
|
|
|
|
|
Internal::PriFileEvalResult *fallback,
|
|
|
|
|
QVector<ProFileEvaluator::SourceFile> sourceFiles, ProjectExplorer::FileType type);
|
2016-10-25 21:25:25 +02:00
|
|
|
static void extractInstalls(
|
|
|
|
|
QHash<const ProFile *, Internal::PriFileEvalResult *> proToResult,
|
|
|
|
|
Internal::PriFileEvalResult *fallback,
|
|
|
|
|
const InstallsList &installList);
|
|
|
|
|
static void processValues(Internal::PriFileEvalResult &result);
|
2010-08-10 16:27:35 +02:00
|
|
|
void watchFolders(const QSet<QString> &folders);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakeProject *m_project;
|
|
|
|
|
QmakeProFileNode *m_qmakeProFileNode;
|
2015-02-02 00:37:38 +02:00
|
|
|
Utils::FileName m_projectFilePath;
|
2008-12-02 12:01:29 +01:00
|
|
|
QString m_projectDir;
|
2008-12-09 17:17:12 +01:00
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
Internal::QmakePriFile *m_qmakePriFile;
|
2009-05-12 14:12:20 +02:00
|
|
|
|
2010-08-10 16:27:35 +02:00
|
|
|
// Memory is cheap...
|
2011-11-08 18:53:51 +01:00
|
|
|
QMap<ProjectExplorer::FileType, QSet<Utils::FileName> > m_files;
|
|
|
|
|
QSet<Utils::FileName> m_recursiveEnumerateFiles;
|
2010-08-10 16:27:35 +02:00
|
|
|
QSet<QString> m_watchedFolders;
|
2015-06-18 15:14:06 +02:00
|
|
|
bool m_includedInExactParse = true;
|
2010-08-10 16:27:35 +02:00
|
|
|
|
2013-10-29 16:08:37 +01:00
|
|
|
// managed by QmakeProFileNode
|
2013-10-29 14:22:31 +01:00
|
|
|
friend class QmakeProjectManager::QmakeProFileNode;
|
|
|
|
|
friend class Internal::QmakePriFile; // for scheduling updates on modified
|
2009-08-17 17:59:57 +02:00
|
|
|
// internal temporary subtree representation
|
2011-09-07 11:52:04 +02:00
|
|
|
friend struct Internal::InternalNode;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2011-09-07 11:52:04 +02:00
|
|
|
namespace Internal {
|
2013-10-29 14:22:31 +01:00
|
|
|
class QmakePriFile : public Core::IDocument
|
2011-05-25 11:23:25 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakePriFile(QmakePriFileNode *qmakePriFile);
|
2011-05-25 11:23:25 +02:00
|
|
|
|
2015-06-04 15:54:10 +02:00
|
|
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override;
|
|
|
|
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
|
2011-05-25 11:23:25 +02:00
|
|
|
|
|
|
|
|
private:
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakePriFileNode *m_priFile;
|
2011-05-25 11:23:25 +02:00
|
|
|
};
|
|
|
|
|
|
2012-05-04 11:49:37 +02:00
|
|
|
class ProVirtualFolderNode : public ProjectExplorer::VirtualFolderNode
|
|
|
|
|
{
|
|
|
|
|
public:
|
2015-02-02 00:37:38 +02:00
|
|
|
explicit ProVirtualFolderNode(const Utils::FileName &folderPath, int priority, const QString &typeName)
|
2012-05-04 11:49:37 +02:00
|
|
|
: VirtualFolderNode(folderPath, priority), m_typeName(typeName)
|
2015-10-29 16:59:27 +01:00
|
|
|
{ }
|
2012-05-04 11:49:37 +02:00
|
|
|
|
2015-11-02 17:00:46 +01:00
|
|
|
QString displayName() const override;
|
|
|
|
|
|
|
|
|
|
QString addFileFilter() const override;
|
|
|
|
|
|
|
|
|
|
void setAddFileFilter(const QString &filter)
|
2012-05-04 11:49:37 +02:00
|
|
|
{
|
2015-11-02 17:00:46 +01:00
|
|
|
m_addFileFilter = filter;
|
2012-05-04 11:49:37 +02:00
|
|
|
}
|
|
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
QString tooltip() const override
|
2012-05-04 11:49:37 +02:00
|
|
|
{
|
|
|
|
|
return QString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QString m_typeName;
|
2015-11-02 17:00:46 +01:00
|
|
|
QString m_addFileFilter;
|
2012-05-04 11:49:37 +02:00
|
|
|
};
|
|
|
|
|
|
2011-05-25 11:23:25 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
|
2013-10-29 15:58:10 +01:00
|
|
|
class QMAKEPROJECTMANAGER_EXPORT TargetInformation
|
2010-03-10 16:55:37 +01:00
|
|
|
{
|
2013-03-21 12:11:28 +01:00
|
|
|
public:
|
2015-06-18 15:14:06 +02:00
|
|
|
bool valid = false;
|
2010-03-10 16:55:37 +01:00
|
|
|
QString target;
|
2013-03-12 14:09:18 +01:00
|
|
|
QString destDir;
|
2010-05-07 10:41:34 +02:00
|
|
|
QString buildDir;
|
2013-03-12 14:09:18 +01:00
|
|
|
QString buildTarget;
|
2010-03-10 16:55:37 +01:00
|
|
|
bool operator==(const TargetInformation &other) const
|
|
|
|
|
{
|
2013-03-12 14:09:18 +01:00
|
|
|
return target == other.target
|
2011-05-27 14:57:03 +03:00
|
|
|
&& valid == other.valid
|
2013-03-12 14:09:18 +01:00
|
|
|
&& destDir == other.destDir
|
|
|
|
|
&& buildDir == other.buildDir
|
|
|
|
|
&& buildTarget == other.buildTarget;
|
2010-03-10 16:55:37 +01:00
|
|
|
}
|
|
|
|
|
bool operator!=(const TargetInformation &other) const
|
|
|
|
|
{
|
|
|
|
|
return !(*this == other);
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-18 15:14:06 +02:00
|
|
|
TargetInformation() = default;
|
2010-03-10 16:55:37 +01:00
|
|
|
|
2015-06-18 15:14:06 +02:00
|
|
|
TargetInformation(const TargetInformation &other) = default;
|
2010-03-10 16:55:37 +01:00
|
|
|
};
|
|
|
|
|
|
2013-10-29 15:58:10 +01:00
|
|
|
struct QMAKEPROJECTMANAGER_EXPORT InstallsItem {
|
2016-10-25 21:17:07 +02:00
|
|
|
InstallsItem() = default;
|
2016-10-25 21:25:25 +02:00
|
|
|
InstallsItem(QString p, QVector<ProFileEvaluator::SourceFile> f, bool a)
|
|
|
|
|
: path(p), files(f), active(a) {}
|
2010-10-27 17:19:52 +02:00
|
|
|
QString path;
|
2016-10-25 21:25:25 +02:00
|
|
|
QVector<ProFileEvaluator::SourceFile> files;
|
2016-11-29 13:44:36 +01:00
|
|
|
bool active = false;
|
2010-10-27 17:19:52 +02:00
|
|
|
};
|
|
|
|
|
|
2013-10-29 15:58:10 +01:00
|
|
|
struct QMAKEPROJECTMANAGER_EXPORT InstallsList {
|
2010-10-27 17:19:52 +02:00
|
|
|
void clear() { targetPath.clear(); items.clear(); }
|
|
|
|
|
QString targetPath;
|
2016-10-25 21:17:07 +02:00
|
|
|
QVector<InstallsItem> items;
|
2010-10-27 17:19:52 +02:00
|
|
|
};
|
|
|
|
|
|
2013-10-29 17:37:39 +01:00
|
|
|
// Implements ProjectNode for qmake .pro files
|
2013-10-29 15:58:10 +01:00
|
|
|
class QMAKEPROJECTMANAGER_EXPORT QmakeProFileNode : public QmakePriFileNode
|
2009-03-19 16:33:44 +01:00
|
|
|
{
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
2015-02-02 00:37:38 +02:00
|
|
|
QmakeProFileNode(QmakeProject *project, const Utils::FileName &filePath);
|
2015-10-29 16:59:27 +01:00
|
|
|
~QmakeProFileNode() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
bool isParent(QmakeProFileNode *node);
|
2010-03-10 16:55:37 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
bool showInSimpleTree() const override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-10-29 16:59:27 +01:00
|
|
|
AddNewInformation addNewInformation(const QStringList &files, Node *context) const override;
|
2014-02-18 16:31:36 +01:00
|
|
|
|
2013-10-29 16:08:37 +01:00
|
|
|
QmakeProjectType projectType() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-29 16:08:37 +01:00
|
|
|
QStringList variableValue(const QmakeVariable var) const;
|
|
|
|
|
QString singleVariableValue(const QmakeVariable var) const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-06-01 09:50:32 +02:00
|
|
|
bool isSubProjectDeployable(const QString &filePath) const {
|
|
|
|
|
return !m_subProjectsNotToDeploy.contains(filePath);
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-03 12:42:05 +02:00
|
|
|
QString sourceDir() const;
|
2013-10-16 14:00:45 +02:00
|
|
|
QString buildDir(QmakeBuildConfiguration *bc = 0) const;
|
2009-12-04 19:22:12 +01:00
|
|
|
|
2016-01-15 16:12:54 +01:00
|
|
|
QStringList generatedFiles(const QString &buildDirectory,
|
|
|
|
|
const ProjectExplorer::FileNode *sourceFile) const;
|
|
|
|
|
QList<ProjectExplorer::ExtraCompiler *> extraCompilers() const;
|
2009-12-03 16:23:15 +01:00
|
|
|
|
2015-02-18 16:01:58 +01:00
|
|
|
QmakeProFileNode *findProFileFor(const Utils::FileName &string) const;
|
2010-07-06 14:32:33 +02:00
|
|
|
TargetInformation targetInformation() const;
|
2009-12-04 19:22:12 +01:00
|
|
|
|
2010-10-27 17:19:52 +02:00
|
|
|
InstallsList installsList() const;
|
|
|
|
|
|
2010-10-05 17:38:45 +02:00
|
|
|
QString makefile() const;
|
2012-04-28 22:24:33 +03:00
|
|
|
QString objectExtension() const;
|
|
|
|
|
QString objectsDirectory() const;
|
2012-02-16 15:09:56 +01:00
|
|
|
QByteArray cxxDefines() const;
|
2010-10-05 17:38:45 +02:00
|
|
|
|
2014-10-24 12:43:14 +02:00
|
|
|
enum AsyncUpdateDelay { ParseNow, ParseLater };
|
|
|
|
|
void scheduleUpdate(AsyncUpdateDelay delay);
|
2010-03-10 16:55:37 +01:00
|
|
|
|
2010-10-27 16:27:22 +02:00
|
|
|
bool validParse() const;
|
2011-06-10 15:37:10 +02:00
|
|
|
bool parseInProgress() const;
|
2010-10-27 16:27:22 +02:00
|
|
|
|
2014-03-17 11:52:45 +01:00
|
|
|
bool showInSimpleTree(QmakeProjectType projectType) const;
|
2012-05-04 16:25:41 +03:00
|
|
|
bool isDebugAndRelease() const;
|
2014-06-12 16:24:52 +02:00
|
|
|
bool isQtcRunnable() const;
|
2011-01-20 18:05:58 +01:00
|
|
|
|
2011-09-12 12:40:53 +02:00
|
|
|
void setParseInProgress(bool b);
|
|
|
|
|
void setParseInProgressRecursive(bool b);
|
2012-05-08 12:53:24 +02:00
|
|
|
void setValidParse(bool b);
|
|
|
|
|
void setValidParseRecursive(bool b);
|
2015-01-09 15:50:06 +01:00
|
|
|
|
2010-03-10 16:55:37 +01:00
|
|
|
void asyncUpdate();
|
|
|
|
|
|
2015-01-09 15:50:06 +01:00
|
|
|
private:
|
2010-03-10 16:55:37 +01:00
|
|
|
void applyAsyncEvaluate();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-03-10 16:55:37 +01:00
|
|
|
void setupReader();
|
2014-09-10 12:53:55 +02:00
|
|
|
Internal::EvalInput evalInput() const;
|
|
|
|
|
|
2016-11-02 14:24:40 +01:00
|
|
|
static bool evaluateOne(
|
|
|
|
|
const Internal::EvalInput &input, ProFile *pro, QtSupport::ProFileReader *reader,
|
|
|
|
|
bool cumulative, QtSupport::ProFileReader **buildPassReader);
|
2014-09-10 12:53:55 +02:00
|
|
|
static Internal::EvalResult *evaluate(const Internal::EvalInput &input);
|
2014-09-26 15:24:32 +02:00
|
|
|
void applyEvaluate(Internal::EvalResult *parseResult);
|
2010-03-10 16:55:37 +01:00
|
|
|
|
2014-09-10 12:53:55 +02:00
|
|
|
void asyncEvaluate(QFutureInterface<Internal::EvalResult *> &fi, Internal::EvalInput input);
|
2014-11-18 17:05:09 +01:00
|
|
|
void cleanupProFileReaders();
|
2010-03-10 16:55:37 +01:00
|
|
|
|
2013-10-29 16:08:37 +01:00
|
|
|
typedef QHash<QmakeVariable, QStringList> QmakeVariablesHash;
|
2009-12-03 16:23:15 +01:00
|
|
|
|
2016-01-15 16:12:54 +01:00
|
|
|
void updateGeneratedFiles(const QString &buildDir);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2016-10-25 20:04:29 +02:00
|
|
|
static QStringList fileListForVar(
|
|
|
|
|
const QHash<QString, QVector<ProFileEvaluator::SourceFile> > &sourceFiles,
|
|
|
|
|
const QString &varName);
|
2014-09-10 12:53:55 +02:00
|
|
|
static QString uiDirPath(QtSupport::ProFileReader *reader, const QString &buildDir);
|
|
|
|
|
static QString mocDirPath(QtSupport::ProFileReader *reader, const QString &buildDir);
|
2016-10-21 20:23:07 +02:00
|
|
|
static QString sysrootify(const QString &path, const QString &sysroot, const QString &baseDir, const QString &outputDir);
|
|
|
|
|
static QStringList includePaths(QtSupport::ProFileReader *reader, const QString &sysroot, const QString &buildDir, const QString &projectDir);
|
2014-09-10 12:53:55 +02:00
|
|
|
static QStringList libDirectories(QtSupport::ProFileReader *reader);
|
2015-02-02 00:37:38 +02:00
|
|
|
static Utils::FileNameList subDirsPaths(QtSupport::ProFileReader *reader, const QString &projectDir, QStringList *subProjectsNotToDeploy, QStringList *errors);
|
2012-06-01 09:50:32 +02:00
|
|
|
|
2014-09-10 12:53:55 +02:00
|
|
|
static TargetInformation targetInformation(QtSupport::ProFileReader *reader, QtSupport::ProFileReader *readerBuildPass, const QString &buildDir, const QString &projectFilePath);
|
2016-10-24 21:01:22 +02:00
|
|
|
static InstallsList installsList(const QtSupport::ProFileReader *reader, const QString &projectFilePath, const QString &projectDir, const QString &buildDir);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-06-18 15:14:06 +02:00
|
|
|
bool m_validParse = false;
|
2016-11-02 12:10:18 +01:00
|
|
|
bool m_parseInProgress = false;
|
2013-02-18 18:47:54 +01:00
|
|
|
|
2015-06-18 15:14:06 +02:00
|
|
|
QmakeProjectType m_projectType = InvalidProject;
|
2013-10-29 16:08:37 +01:00
|
|
|
QmakeVariablesHash m_varValues;
|
2016-01-15 16:12:54 +01:00
|
|
|
QList<ProjectExplorer::ExtraCompiler *> m_extraCompilers;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-29 16:08:37 +01:00
|
|
|
TargetInformation m_qmakeTargetInformation;
|
2012-06-01 09:50:32 +02:00
|
|
|
QStringList m_subProjectsNotToDeploy;
|
2010-10-27 17:19:52 +02:00
|
|
|
InstallsList m_installsList;
|
2010-03-10 16:55:37 +01:00
|
|
|
|
|
|
|
|
// Async stuff
|
2014-09-10 12:53:55 +02:00
|
|
|
QFutureWatcher<Internal::EvalResult *> m_parseFutureWatcher;
|
2015-06-18 15:14:06 +02:00
|
|
|
QtSupport::ProFileReader *m_readerExact = nullptr;
|
|
|
|
|
QtSupport::ProFileReader *m_readerCumulative = nullptr;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2013-10-16 11:02:37 +02:00
|
|
|
} // namespace QmakeProjectManager
|