2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2012-04-24 15:49:09 +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.
|
2012-04-24 15:49:09 +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.
|
2012-04-24 15:49:09 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-02-02 18:26:51 +01:00
|
|
|
#pragma once
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-07-13 10:40:05 +02:00
|
|
|
#include "abi.h"
|
2016-07-12 16:27:45 +02:00
|
|
|
#include "devicesupport/idevice.h"
|
2012-09-03 18:31:44 +02:00
|
|
|
#include "kitmanager.h"
|
|
|
|
|
#include "kit.h"
|
2016-07-12 16:27:45 +02:00
|
|
|
#include "toolchain.h"
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2014-07-22 21:12:34 +02:00
|
|
|
#include <utils/environment.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
|
|
|
|
|
#include <QVariant>
|
|
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
class KitAspectWidget;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
// SysRootInformation:
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
class PROJECTEXPLORER_EXPORT SysRootKitAspect : public KitAspect
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2019-02-06 12:50:51 +01:00
|
|
|
SysRootKitAspect();
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2019-05-27 16:09:44 +02:00
|
|
|
Tasks validate(const Kit *k) const override;
|
2019-02-06 12:50:51 +01:00
|
|
|
KitAspectWidget *createConfigWidget(Kit *k) const override;
|
2016-01-04 13:39:02 +01:00
|
|
|
ItemList toUserOutput(const Kit *k) const override;
|
2016-03-22 12:21:01 +01:00
|
|
|
void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2013-09-09 17:10:41 +02:00
|
|
|
static Core::Id id();
|
2012-09-03 18:31:44 +02:00
|
|
|
static Utils::FileName sysRoot(const Kit *k);
|
|
|
|
|
static void setSysRoot(Kit *k, const Utils::FileName &v);
|
2012-04-24 15:49:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
// ToolChainInformation:
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
class PROJECTEXPLORER_EXPORT ToolChainKitAspect : public KitAspect
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2019-02-06 12:50:51 +01:00
|
|
|
ToolChainKitAspect();
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2019-05-27 16:09:44 +02:00
|
|
|
Tasks validate(const Kit *k) const override;
|
2016-07-20 16:24:32 +02:00
|
|
|
void upgrade(Kit *k) override;
|
2016-01-04 13:39:02 +01:00
|
|
|
void fix(Kit *k) override;
|
|
|
|
|
void setup(Kit *k) override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
KitAspectWidget *createConfigWidget(Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QString displayNamePostfix(const Kit *k) const override;
|
2012-08-07 13:09:56 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
ItemList toUserOutput(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
void addToEnvironment(const Kit *k, Utils::Environment &env) const override;
|
|
|
|
|
void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override;
|
|
|
|
|
IOutputParser *createOutputParser(const Kit *k) const override;
|
2017-02-07 00:26:51 +01:00
|
|
|
QSet<Core::Id> availableFeatures(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2013-09-09 17:10:41 +02:00
|
|
|
static Core::Id id();
|
2018-04-19 15:59:05 +02:00
|
|
|
static QByteArray toolChainId(const Kit *k, Core::Id language);
|
2016-12-16 00:43:14 +01:00
|
|
|
static ToolChain *toolChain(const Kit *k, Core::Id language);
|
2016-07-12 16:27:45 +02:00
|
|
|
static QList<ToolChain *> toolChains(const Kit *k);
|
2012-09-03 18:31:44 +02:00
|
|
|
static void setToolChain(Kit *k, ToolChain *tc);
|
2017-08-04 13:56:57 +02:00
|
|
|
static void setAllToolChainsToMatch(Kit *k, ToolChain *tc);
|
2016-12-16 00:43:14 +01:00
|
|
|
static void clearToolChain(Kit *k, Core::Id language);
|
2016-07-13 10:40:05 +02:00
|
|
|
static Abi targetAbi(const Kit *k);
|
2012-07-27 15:43:00 +02:00
|
|
|
|
|
|
|
|
static QString msgNoToolChainInTarget();
|
2013-07-24 16:22:37 +02:00
|
|
|
|
2016-01-29 16:38:37 +02:00
|
|
|
private:
|
2013-02-28 15:07:01 +01:00
|
|
|
void kitsWereLoaded();
|
2012-10-17 17:27:17 +02:00
|
|
|
void toolChainUpdated(ProjectExplorer::ToolChain *tc);
|
2013-02-28 15:07:01 +01:00
|
|
|
void toolChainRemoved(ProjectExplorer::ToolChain *tc);
|
2012-04-24 15:49:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
// DeviceTypeInformation:
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
class PROJECTEXPLORER_EXPORT DeviceTypeKitAspect : public KitAspect
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2019-02-06 12:50:51 +01:00
|
|
|
DeviceTypeKitAspect();
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2019-03-23 11:28:55 +01:00
|
|
|
void setup(Kit *k) override;
|
2019-05-27 16:09:44 +02:00
|
|
|
Tasks validate(const Kit *k) const override;
|
2019-02-06 12:50:51 +01:00
|
|
|
KitAspectWidget *createConfigWidget(Kit *k) const override;
|
2016-01-04 13:39:02 +01:00
|
|
|
ItemList toUserOutput(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2013-09-09 17:10:41 +02:00
|
|
|
static const Core::Id id();
|
2012-09-03 18:31:44 +02:00
|
|
|
static const Core::Id deviceTypeId(const Kit *k);
|
|
|
|
|
static void setDeviceTypeId(Kit *k, Core::Id type);
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QSet<Core::Id> supportedPlatforms(const Kit *k) const override;
|
|
|
|
|
QSet<Core::Id> availableFeatures(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
// DeviceInformation:
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
class PROJECTEXPLORER_EXPORT DeviceKitAspect : public KitAspect
|
2012-04-24 15:49:09 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2019-02-06 12:50:51 +01:00
|
|
|
DeviceKitAspect();
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2019-05-27 16:09:44 +02:00
|
|
|
Tasks validate(const Kit *k) const override;
|
2016-01-04 13:39:02 +01:00
|
|
|
void fix(Kit *k) override;
|
|
|
|
|
void setup(Kit *k) override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
KitAspectWidget *createConfigWidget(Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
QString displayNamePostfix(const Kit *k) const override;
|
2012-08-07 13:09:56 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
ItemList toUserOutput(const Kit *k) const override;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2018-05-07 14:58:16 +02:00
|
|
|
void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override;
|
2014-10-22 10:00:07 +02:00
|
|
|
|
2013-09-09 17:10:41 +02:00
|
|
|
static Core::Id id();
|
2012-09-03 18:31:44 +02:00
|
|
|
static IDevice::ConstPtr device(const Kit *k);
|
|
|
|
|
static Core::Id deviceId(const Kit *k);
|
|
|
|
|
static void setDevice(Kit *k, IDevice::ConstPtr dev);
|
2014-07-01 11:08:26 +02:00
|
|
|
static void setDeviceId(Kit *k, Core::Id dataId);
|
2013-07-24 16:22:37 +02:00
|
|
|
|
2016-01-29 16:38:37 +02:00
|
|
|
private:
|
2019-03-12 16:50:39 +01:00
|
|
|
QVariant defaultValue(const Kit *k) const;
|
|
|
|
|
|
2013-02-28 14:06:17 +01:00
|
|
|
void kitsWereLoaded();
|
2014-07-01 11:08:26 +02:00
|
|
|
void deviceUpdated(Core::Id dataId);
|
2013-07-08 16:39:03 +02:00
|
|
|
void devicesChanged();
|
2013-02-28 18:29:16 +01:00
|
|
|
void kitUpdated(ProjectExplorer::Kit *k);
|
2012-04-24 15:49:09 +02:00
|
|
|
};
|
|
|
|
|
|
2014-07-22 21:12:34 +02:00
|
|
|
// --------------------------------------------------------------------------
|
2019-02-06 12:50:51 +01:00
|
|
|
// EnvironmentKitAspect:
|
2014-07-22 21:12:34 +02:00
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
class PROJECTEXPLORER_EXPORT EnvironmentKitAspect : public KitAspect
|
2014-07-22 21:12:34 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2019-02-06 12:50:51 +01:00
|
|
|
EnvironmentKitAspect();
|
2014-07-22 21:12:34 +02:00
|
|
|
|
2019-05-27 16:09:44 +02:00
|
|
|
Tasks validate(const Kit *k) const override;
|
2016-01-04 13:39:02 +01:00
|
|
|
void fix(Kit *k) override;
|
2014-07-22 21:12:34 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
void addToEnvironment(const Kit *k, Utils::Environment &env) const override;
|
2019-02-06 12:50:51 +01:00
|
|
|
KitAspectWidget *createConfigWidget(Kit *k) const override;
|
2014-07-22 21:12:34 +02:00
|
|
|
|
2016-01-04 13:39:02 +01:00
|
|
|
ItemList toUserOutput(const Kit *k) const override;
|
2014-07-22 21:12:34 +02:00
|
|
|
|
|
|
|
|
static Core::Id id();
|
|
|
|
|
static QList<Utils::EnvironmentItem> environmentChanges(const Kit *k);
|
|
|
|
|
static void setEnvironmentChanges(Kit *k, const QList<Utils::EnvironmentItem> &changes);
|
|
|
|
|
};
|
|
|
|
|
|
2012-04-24 15:49:09 +02:00
|
|
|
} // namespace ProjectExplorer
|