2013-01-30 18:19:31 +01:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-01-30 18:19:31 +01:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** 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.
|
2013-01-30 18:19:31 +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.
|
2013-01-30 18:19:31 +01:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-01-30 18:19:31 +01:00
|
|
|
|
|
|
|
|
#include <extensionsystem/iplugin.h>
|
2013-05-27 14:36:59 +02:00
|
|
|
#include <utils/parameteraction.h>
|
2013-01-30 18:19:31 +01:00
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QAction;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
class Project;
|
|
|
|
|
class ProjectExplorerPlugin;
|
|
|
|
|
class Node;
|
|
|
|
|
class Target;
|
|
|
|
|
} // namespace ProjectExplorer
|
|
|
|
|
|
|
|
|
|
namespace QbsProjectManager {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class QbsProject;
|
|
|
|
|
|
|
|
|
|
class QbsProjectManagerPlugin : public ExtensionSystem::IPlugin
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QbsProjectManager.json")
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
QbsProjectManagerPlugin();
|
|
|
|
|
|
|
|
|
|
bool initialize(const QStringList &arguments, QString *errorMessage);
|
|
|
|
|
|
|
|
|
|
void extensionsInitialized();
|
|
|
|
|
|
|
|
|
|
private slots:
|
2014-04-08 14:59:14 +02:00
|
|
|
void projectWasAdded(ProjectExplorer::Project *project);
|
2014-04-08 15:13:05 +02:00
|
|
|
void currentProjectWasChanged(ProjectExplorer::Project *project);
|
2014-04-08 16:53:21 +02:00
|
|
|
void projectWasRemoved();
|
2014-04-08 16:41:12 +02:00
|
|
|
void nodeSelectionChanged(ProjectExplorer::Node *node, ProjectExplorer::Project *project);
|
2013-01-30 18:19:31 +01:00
|
|
|
void buildStateChanged(ProjectExplorer::Project *project);
|
|
|
|
|
void parsingStateChanged();
|
2014-04-08 16:53:21 +02:00
|
|
|
void currentEditorChanged();
|
2014-04-08 14:59:14 +02:00
|
|
|
|
2013-01-30 18:19:31 +01:00
|
|
|
void buildFileContextMenu();
|
2013-05-27 14:36:59 +02:00
|
|
|
void buildFile();
|
2013-06-10 15:40:18 +02:00
|
|
|
void buildProductContextMenu();
|
|
|
|
|
void buildProduct();
|
2014-02-10 17:28:15 +01:00
|
|
|
void buildSubprojectContextMenu();
|
|
|
|
|
void buildSubproject();
|
2013-01-30 18:19:31 +01:00
|
|
|
|
2014-04-08 14:50:20 +02:00
|
|
|
void reparseSelectedProject();
|
2014-04-08 15:13:05 +02:00
|
|
|
void reparseCurrentProject();
|
|
|
|
|
void reparseProject(QbsProject *project);
|
2013-01-30 18:19:31 +01:00
|
|
|
|
|
|
|
|
private:
|
2014-04-08 16:46:08 +02:00
|
|
|
void updateContextActions();
|
|
|
|
|
void updateReparseQbsAction();
|
|
|
|
|
void updateBuildActions();
|
|
|
|
|
|
2013-07-24 16:47:02 +02:00
|
|
|
void buildFiles(QbsProject *project, const QStringList &files,
|
|
|
|
|
const QStringList &activeFileTags);
|
|
|
|
|
void buildSingleFile(QbsProject *project, const QString &file);
|
2013-06-10 15:40:18 +02:00
|
|
|
void buildProducts(QbsProject *project, const QStringList &products);
|
2013-05-27 14:36:59 +02:00
|
|
|
|
2013-01-30 18:19:31 +01:00
|
|
|
QAction *m_reparseQbs;
|
|
|
|
|
QAction *m_reparseQbsCtx;
|
2014-04-08 11:35:37 +02:00
|
|
|
QAction *m_buildFileCtx;
|
|
|
|
|
QAction *m_buildProductCtx;
|
|
|
|
|
QAction *m_buildSubprojectCtx;
|
2013-05-27 14:36:59 +02:00
|
|
|
Utils::ParameterAction *m_buildFile;
|
2013-06-10 15:40:18 +02:00
|
|
|
Utils::ParameterAction *m_buildProduct;
|
2014-02-10 17:28:15 +01:00
|
|
|
Utils::ParameterAction *m_buildSubproject;
|
2013-01-30 18:19:31 +01:00
|
|
|
|
2014-04-08 11:52:52 +02:00
|
|
|
Internal::QbsProject *m_selectedProject;
|
|
|
|
|
ProjectExplorer::Node *m_selectedNode;
|
2014-04-08 15:13:05 +02:00
|
|
|
|
|
|
|
|
Internal::QbsProject *m_currentProject;
|
2014-04-08 16:53:21 +02:00
|
|
|
|
|
|
|
|
Internal::QbsProject *m_editorProject;
|
|
|
|
|
ProjectExplorer::Node *m_editorNode;
|
2013-01-30 18:19:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
2013-06-12 12:03:12 +02:00
|
|
|
} // namespace QbsProjectManager
|