2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2009-05-04 12:19:22 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2009-05-04 12:19:22 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2009-05-04 12:19:22 +02: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.
|
2009-05-04 12:19:22 +02: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
|
|
|
****************************************************************************/
|
2009-05-04 12:19:22 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2009-05-04 12:19:22 +02:00
|
|
|
|
2010-01-12 16:56:36 +01:00
|
|
|
#include "qmlprojectmanager_global.h"
|
2016-01-08 12:49:00 +01:00
|
|
|
#include "qmlprojectnodes.h"
|
2016-01-08 11:31:06 +01:00
|
|
|
|
2009-05-04 12:19:22 +02:00
|
|
|
#include <projectexplorer/project.h>
|
|
|
|
|
|
2018-01-29 13:38:41 +01:00
|
|
|
#include <utils/environment.h>
|
|
|
|
|
|
2012-09-24 13:48:18 +02:00
|
|
|
#include <QPointer>
|
2009-05-04 12:19:22 +02:00
|
|
|
|
2012-10-09 16:20:26 +02:00
|
|
|
namespace ProjectExplorer { class RunConfiguration; }
|
2009-12-16 16:39:39 +01:00
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
namespace QmlProjectManager {
|
2009-12-16 16:39:39 +01:00
|
|
|
|
2010-02-16 13:39:13 +01:00
|
|
|
class QmlProjectItem;
|
2009-12-16 16:39:39 +01:00
|
|
|
|
2010-01-12 16:56:36 +01:00
|
|
|
class QMLPROJECTMANAGER_EXPORT QmlProject : public ProjectExplorer::Project
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2019-05-28 13:49:26 +02:00
|
|
|
explicit QmlProject(const Utils::FilePath &filename);
|
2016-01-07 17:58:34 +01:00
|
|
|
~QmlProject() override;
|
2010-01-12 16:56:36 +01:00
|
|
|
|
2019-05-27 16:09:44 +02:00
|
|
|
ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final;
|
2010-01-12 16:56:36 +01:00
|
|
|
|
2010-01-19 13:53:48 +01:00
|
|
|
enum RefreshOption {
|
|
|
|
|
ProjectFile = 0x01,
|
|
|
|
|
Files = 0x02,
|
|
|
|
|
Configuration = 0x04,
|
|
|
|
|
Everything = ProjectFile | Files | Configuration
|
2010-01-12 16:56:36 +01:00
|
|
|
};
|
2010-01-19 13:53:48 +01:00
|
|
|
Q_DECLARE_FLAGS(RefreshOptions,RefreshOption)
|
2010-01-12 16:56:36 +01:00
|
|
|
|
|
|
|
|
void refresh(RefreshOptions options);
|
|
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath canonicalProjectDir() const;
|
2010-12-03 17:04:29 +01:00
|
|
|
QString mainFile() const;
|
2019-01-18 20:38:48 +01:00
|
|
|
void setMainFile(const QString &mainFilePath);
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath targetDirectory(const ProjectExplorer::Target *target) const;
|
|
|
|
|
Utils::FilePath targetFile(const Utils::FilePath &sourceFile,
|
2017-11-28 15:57:15 +01:00
|
|
|
const ProjectExplorer::Target *target) const;
|
2018-01-29 13:38:41 +01:00
|
|
|
|
2019-05-07 16:51:22 +02:00
|
|
|
Utils::EnvironmentItems environment() const;
|
2012-12-03 15:28:34 +01:00
|
|
|
QStringList customImportPaths() const;
|
2019-04-08 17:02:20 +02:00
|
|
|
QStringList customFileSelectors() const;
|
2010-01-12 16:56:36 +01:00
|
|
|
|
2010-02-17 11:20:35 +01:00
|
|
|
bool addFiles(const QStringList &filePaths);
|
|
|
|
|
|
2010-01-19 13:53:48 +01:00
|
|
|
void refreshProjectFile();
|
2011-09-15 13:05:36 +02:00
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
static QStringList makeAbsolute(const Utils::FilePath &path, const QStringList &relativePaths);
|
2019-04-08 17:02:20 +02:00
|
|
|
|
|
|
|
|
QVariant additionalData(Core::Id id, const ProjectExplorer::Target *target) const override;
|
|
|
|
|
|
2016-07-01 12:19:37 +03:00
|
|
|
protected:
|
|
|
|
|
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
|
|
|
|
|
|
|
|
|
private:
|
2019-04-12 14:49:59 +02:00
|
|
|
ProjectExplorer::DeploymentKnowledge deploymentKnowledge() const override;
|
|
|
|
|
|
2017-03-01 14:26:46 +01:00
|
|
|
void generateProjectTree();
|
2017-11-28 15:57:15 +01:00
|
|
|
void updateDeploymentData(ProjectExplorer::Target *target);
|
2010-05-18 13:40:35 +02:00
|
|
|
void refreshFiles(const QSet<QString> &added, const QSet<QString> &removed);
|
2017-11-28 15:57:15 +01:00
|
|
|
void refreshTargetDirectory();
|
2012-10-09 16:20:26 +02:00
|
|
|
void addedTarget(ProjectExplorer::Target *target);
|
2013-05-02 15:29:33 +02:00
|
|
|
void onActiveTargetChanged(ProjectExplorer::Target *target);
|
2013-11-06 12:59:04 +01:00
|
|
|
void onKitChanged();
|
2010-01-19 13:53:48 +01:00
|
|
|
|
2010-01-18 16:32:14 +01:00
|
|
|
// plain format
|
2010-01-12 16:56:36 +01:00
|
|
|
void parseProject(RefreshOptions options);
|
|
|
|
|
|
2017-03-27 12:12:38 +02:00
|
|
|
ProjectExplorer::Target *m_activeTarget = nullptr;
|
2010-01-12 16:56:36 +01:00
|
|
|
|
2012-09-24 13:48:18 +02:00
|
|
|
QPointer<QmlProjectItem> m_projectItem;
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath m_canonicalProjectDir;
|
2010-01-12 16:56:36 +01:00
|
|
|
};
|
|
|
|
|
|
2009-05-04 12:19:22 +02:00
|
|
|
} // namespace QmlProjectManager
|
|
|
|
|
|
2010-01-19 13:53:48 +01:00
|
|
|
Q_DECLARE_OPERATORS_FOR_FLAGS(QmlProjectManager::QmlProject::RefreshOptions)
|