2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://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
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2013-10-16 12:10:22 +02:00
|
|
|
#ifndef QMAKENODES_H
|
|
|
|
|
#define QMAKENODES_H
|
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"
|
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>
|
2013-07-09 16:41:57 +02:00
|
|
|
#include <qtsupport/uicodemodelsupport.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
|
|
|
|
|
|
|
|
// defined in proitems.h
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class ProFile;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
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,
|
|
|
|
|
LibraryTemplate,
|
|
|
|
|
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,
|
2012-04-19 12:49:55 +02:00
|
|
|
CppHeaderVar,
|
2012-02-16 15:09:56 +01:00
|
|
|
CppSourceVar,
|
|
|
|
|
ObjCSourceVar,
|
2013-03-21 22:10:38 +04:00
|
|
|
ObjCHeaderVar,
|
2013-05-21 11:35:15 +02:00
|
|
|
ResourceVar,
|
|
|
|
|
ExactResourceVar,
|
2008-12-02 12:01:29 +01:00
|
|
|
UiDirVar,
|
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,
|
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,
|
|
|
|
|
IsoIconsVar
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2011-05-25 11:23:25 +02:00
|
|
|
// Import base classes into namespace
|
|
|
|
|
using ProjectExplorer::Node;
|
|
|
|
|
using ProjectExplorer::FileNode;
|
|
|
|
|
using ProjectExplorer::FolderNode;
|
|
|
|
|
using ProjectExplorer::ProjectNode;
|
2010-01-20 14:47:08 +01:00
|
|
|
|
2011-05-25 11:23:25 +02:00
|
|
|
// Import enums into namespace
|
|
|
|
|
using ProjectExplorer::NodeType;
|
|
|
|
|
using ProjectExplorer::FileNodeType;
|
|
|
|
|
using ProjectExplorer::FolderNodeType;
|
|
|
|
|
using ProjectExplorer::ProjectNodeType;
|
2010-01-20 14:47:08 +01:00
|
|
|
|
2011-05-25 11:23:25 +02:00
|
|
|
using ProjectExplorer::UnknownFileType;
|
|
|
|
|
using ProjectExplorer::ProjectFileType;
|
2010-01-20 14:47:08 +01:00
|
|
|
|
2011-05-25 11:23:25 +02:00
|
|
|
using ProjectExplorer::FileType;
|
2010-01-20 14:47:08 +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;
|
|
|
|
|
// TOOD can probably move into the .cpp file
|
2014-09-09 15:38:48 +02:00
|
|
|
class VariableAndVPathInformation
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
QString variable;
|
|
|
|
|
QStringList vPathsExact;
|
|
|
|
|
QStringList vPathsCumulative;
|
|
|
|
|
};
|
|
|
|
|
|
2011-09-07 11:52:04 +02:00
|
|
|
}
|
2010-01-20 14:47:08 +01:00
|
|
|
|
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:
|
2013-10-29 17:37:39 +01:00
|
|
|
QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmakeProFileNode, const QString &filePath);
|
2013-10-29 14:22:31 +01:00
|
|
|
~QmakePriFileNode();
|
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
|
|
|
|
|
|
|
|
// ProjectNode interface
|
2014-02-03 14:45:28 +01:00
|
|
|
QList<ProjectExplorer::ProjectAction> supportedActions(Node *node) const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-03-17 11:52:45 +01:00
|
|
|
bool showInSimpleTree() const { return false; }
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-08-26 18:33:16 +02:00
|
|
|
bool canAddSubProject(const QString &proFilePath) const;
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
bool addSubProjects(const QStringList &proFilePaths);
|
|
|
|
|
bool removeSubProjects(const QStringList &proFilePaths);
|
|
|
|
|
|
2013-07-01 16:13:48 +02:00
|
|
|
bool addFiles(const QStringList &filePaths, QStringList *notAdded = 0);
|
|
|
|
|
bool removeFiles(const QStringList &filePaths, QStringList *notRemoved = 0);
|
|
|
|
|
bool deleteFiles(const QStringList &filePaths);
|
|
|
|
|
bool renameFile(const QString &filePath, const QString &newFilePath);
|
2014-03-07 16:23:04 +01:00
|
|
|
AddNewInformation addNewInformation(const QStringList &files, Node *context) const;
|
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
|
|
|
|
2010-08-24 17:17:11 +02:00
|
|
|
bool deploysFolder(const QString &folder) const;
|
2014-04-29 08:35:00 +02:00
|
|
|
QList<ProjectExplorer::RunConfiguration *> runConfigurations() const;
|
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);
|
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);
|
2014-09-10 12:53:55 +02:00
|
|
|
static QStringList dynamicVarNames(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative, bool isQt5);
|
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
|
|
|
|
|
};
|
|
|
|
|
|
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,
|
|
|
|
|
ChangeType change);
|
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();
|
|
|
|
|
|
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);
|
2008-12-02 12:01:29 +01:00
|
|
|
bool priFileWritable(const QString &path);
|
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);
|
|
|
|
|
static Internal::PriFileEvalResult extractValues(const Internal::EvalInput &input, ProFile *includeFileExact, ProFile *includeFileCumlative,
|
|
|
|
|
const QList<QList<Internal::VariableAndVPathInformation>> &variableAndVPathInformation);
|
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;
|
2008-12-02 12:01:29 +01:00
|
|
|
QString m_projectFilePath;
|
|
|
|
|
QString m_projectDir;
|
2008-12-09 17:17:12 +01:00
|
|
|
|
2013-07-09 16:41:57 +02:00
|
|
|
QMap<QString, QtSupport::UiCodeModelSupport *> m_uiCodeModelSupport;
|
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;
|
2011-09-06 17:21:51 +02:00
|
|
|
bool m_includedInExactParse;
|
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
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakePriFile(QmakePriFileNode *qmakePriFile);
|
2011-05-25 11:23:25 +02:00
|
|
|
virtual bool save(QString *errorString, const QString &fileName, bool autoSave);
|
|
|
|
|
|
|
|
|
|
virtual QString defaultPath() const;
|
|
|
|
|
virtual QString suggestedFileName() const;
|
|
|
|
|
|
|
|
|
|
virtual bool isModified() const;
|
|
|
|
|
virtual bool isSaveAsAllowed() const;
|
|
|
|
|
|
|
|
|
|
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
|
|
|
|
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
explicit ProVirtualFolderNode(const QString &folderPath, int priority, const QString &typeName)
|
|
|
|
|
: VirtualFolderNode(folderPath, priority), m_typeName(typeName)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString displayName() const
|
|
|
|
|
{
|
|
|
|
|
return m_typeName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString tooltip() const
|
|
|
|
|
{
|
|
|
|
|
return QString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QString m_typeName;
|
|
|
|
|
};
|
|
|
|
|
|
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:
|
2010-03-10 16:55:37 +01:00
|
|
|
bool valid;
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TargetInformation()
|
|
|
|
|
: valid(false)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
TargetInformation(const TargetInformation &other)
|
|
|
|
|
: valid(other.valid),
|
|
|
|
|
target(other.target),
|
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
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2013-10-29 15:58:10 +01:00
|
|
|
struct QMAKEPROJECTMANAGER_EXPORT InstallsItem {
|
2010-10-27 17:19:52 +02:00
|
|
|
InstallsItem(QString p, QStringList f) : path(p), files(f) {}
|
|
|
|
|
QString path;
|
|
|
|
|
QStringList files;
|
|
|
|
|
};
|
|
|
|
|
|
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;
|
|
|
|
|
QList<InstallsItem> items;
|
|
|
|
|
};
|
|
|
|
|
|
2013-10-29 15:58:10 +01:00
|
|
|
struct QMAKEPROJECTMANAGER_EXPORT ProjectVersion {
|
2011-05-13 13:23:38 +02:00
|
|
|
int major;
|
|
|
|
|
int minor;
|
|
|
|
|
int patch;
|
|
|
|
|
};
|
|
|
|
|
|
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:
|
2013-10-29 14:22:31 +01:00
|
|
|
QmakeProFileNode(QmakeProject *project,
|
2015-01-09 15:50:06 +01:00
|
|
|
const QString &filePath);
|
2013-10-29 14:22:31 +01:00
|
|
|
~QmakeProFileNode();
|
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
|
|
|
|
2014-03-17 11:52:45 +01:00
|
|
|
bool showInSimpleTree() const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-03-07 16:23:04 +01:00
|
|
|
AddNewInformation addNewInformation(const QStringList &files, Node *context) const;
|
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
|
|
|
|
2014-09-05 16:13:21 +02:00
|
|
|
QString uiDirectory(const QString &buildDir) const;
|
2009-12-03 16:23:15 +01:00
|
|
|
static QString uiHeaderFile(const QString &uiDir, const QString &formFile);
|
2013-07-11 16:24:51 +02:00
|
|
|
QHash<QString, QString> uiFiles() const;
|
2009-12-03 16:23:15 +01:00
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
const QmakeProFileNode *findProFileFor(const QString &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;
|
2011-05-10 16:18:04 +02:00
|
|
|
bool isDeployable() 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);
|
2011-09-12 12:40:53 +02:00
|
|
|
void emitProFileUpdatedRecursive();
|
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;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2014-09-05 16:13:21 +02:00
|
|
|
void updateUiFiles(const QString &buildDir);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-09-10 12:53:55 +02:00
|
|
|
static QStringList fileListForVar(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative,
|
|
|
|
|
const QString &varName, const QString &projectDir, const QString &buildDir);
|
|
|
|
|
static QString uiDirPath(QtSupport::ProFileReader *reader, const QString &buildDir);
|
|
|
|
|
static QString mocDirPath(QtSupport::ProFileReader *reader, const QString &buildDir);
|
|
|
|
|
static QStringList includePaths(QtSupport::ProFileReader *reader, const QString &buildDir, const QString &projectDir);
|
|
|
|
|
static QStringList libDirectories(QtSupport::ProFileReader *reader);
|
|
|
|
|
static QStringList 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);
|
|
|
|
|
static InstallsList installsList(const QtSupport::ProFileReader *reader, const QString &projectFilePath, const QString &projectDir);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-02-18 18:47:54 +01:00
|
|
|
bool m_isDeployable;
|
|
|
|
|
|
|
|
|
|
bool m_validParse;
|
|
|
|
|
bool m_parseInProgress;
|
|
|
|
|
|
2013-10-29 16:08:37 +01:00
|
|
|
QmakeProjectType m_projectType;
|
|
|
|
|
QmakeVariablesHash m_varValues;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-01-14 17:13:17 +01:00
|
|
|
QMap<QString, QDateTime> m_uitimestamps;
|
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
|
|
|
|
2013-07-11 16:24:51 +02:00
|
|
|
QHash<QString, QString> m_uiFiles; // ui-file path, ui header path
|
2012-10-08 14:33:33 +02:00
|
|
|
|
2010-03-10 16:55:37 +01:00
|
|
|
// Async stuff
|
2014-09-10 12:53:55 +02:00
|
|
|
QFutureWatcher<Internal::EvalResult *> m_parseFutureWatcher;
|
2011-05-20 21:40:53 +02:00
|
|
|
QtSupport::ProFileReader *m_readerExact;
|
|
|
|
|
QtSupport::ProFileReader *m_readerCumulative;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
2013-10-16 11:02:37 +02:00
|
|
|
} // namespace QmakeProjectManager
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-16 12:10:22 +02:00
|
|
|
#endif // QMAKENODES_H
|