forked from qt-creator/qt-creator
ProjectExplorer: Remove Target::applicationTargets()
That's BuildSystem::applicationTargets() nowadays. Change-Id: I01cf0a491e4cb289af08f529fd15c85bfcdf5493 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#include <cpptools/projectinfo.h>
|
#include <cpptools/projectinfo.h>
|
||||||
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
#include <projectexplorer/buildsystem.h>
|
||||||
#include <projectexplorer/buildtargetinfo.h>
|
#include <projectexplorer/buildtargetinfo.h>
|
||||||
#include <projectexplorer/deploymentdata.h>
|
#include <projectexplorer/deploymentdata.h>
|
||||||
#include <projectexplorer/environmentaspect.h>
|
#include <projectexplorer/environmentaspect.h>
|
||||||
@@ -137,8 +138,9 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
|
|||||||
|
|
||||||
const QSet<QString> buildSystemTargets = m_buildTargets;
|
const QSet<QString> buildSystemTargets = m_buildTargets;
|
||||||
qCDebug(LOG) << "BuildSystemTargets\n " << buildSystemTargets;
|
qCDebug(LOG) << "BuildSystemTargets\n " << buildSystemTargets;
|
||||||
|
const QList<BuildTargetInfo> buildTargets = target->buildSystem()->applicationTargets();
|
||||||
BuildTargetInfo targetInfo
|
BuildTargetInfo targetInfo
|
||||||
= Utils::findOrDefault(target->applicationTargets(),
|
= Utils::findOrDefault(buildTargets,
|
||||||
[&buildSystemTargets] (const BuildTargetInfo &bti) {
|
[&buildSystemTargets] (const BuildTargetInfo &bti) {
|
||||||
return buildSystemTargets.contains(bti.buildKey);
|
return buildSystemTargets.contains(bti.buildKey);
|
||||||
});
|
});
|
||||||
@@ -146,7 +148,6 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode)
|
|||||||
// there would be no BuildTargetInfo that could match
|
// there would be no BuildTargetInfo that could match
|
||||||
if (targetInfo.targetFilePath.isEmpty()) {
|
if (targetInfo.targetFilePath.isEmpty()) {
|
||||||
qCDebug(LOG) << "BuildTargetInfos";
|
qCDebug(LOG) << "BuildTargetInfos";
|
||||||
const QList<BuildTargetInfo> buildTargets = target->applicationTargets();
|
|
||||||
// if there is only one build target just use it (but be honest that we're deducing)
|
// if there is only one build target just use it (but be honest that we're deducing)
|
||||||
if (buildTargets.size() == 1) {
|
if (buildTargets.size() == 1) {
|
||||||
targetInfo = buildTargets.first();
|
targetInfo = buildTargets.first();
|
||||||
|
@@ -445,17 +445,17 @@ QString RunConfigurationFactory::decoratedTargetName(const QString &targetName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
QList<RunConfigurationCreationInfo>
|
QList<RunConfigurationCreationInfo>
|
||||||
RunConfigurationFactory::availableCreators(Target *parent) const
|
RunConfigurationFactory::availableCreators(Target *target) const
|
||||||
{
|
{
|
||||||
const QList<BuildTargetInfo> buildTargets = parent->applicationTargets();
|
const QList<BuildTargetInfo> buildTargets = target->buildSystem()->applicationTargets();
|
||||||
const bool hasAnyQtcRunnable = Utils::anyOf(buildTargets,
|
const bool hasAnyQtcRunnable = Utils::anyOf(buildTargets,
|
||||||
Utils::equal(&BuildTargetInfo::isQtcRunnable, true));
|
Utils::equal(&BuildTargetInfo::isQtcRunnable, true));
|
||||||
return Utils::transform(buildTargets, [&](const BuildTargetInfo &ti) {
|
return Utils::transform(buildTargets, [&](const BuildTargetInfo &ti) {
|
||||||
QString displayName = ti.displayName;
|
QString displayName = ti.displayName;
|
||||||
if (displayName.isEmpty())
|
if (displayName.isEmpty())
|
||||||
displayName = decoratedTargetName(ti.buildKey, parent);
|
displayName = decoratedTargetName(ti.buildKey, target);
|
||||||
else if (m_decorateDisplayNames)
|
else if (m_decorateDisplayNames)
|
||||||
displayName = decoratedTargetName(displayName, parent);
|
displayName = decoratedTargetName(displayName, target);
|
||||||
RunConfigurationCreationInfo rci;
|
RunConfigurationCreationInfo rci;
|
||||||
rci.factory = this;
|
rci.factory = this;
|
||||||
rci.id = m_runConfigBaseId;
|
rci.id = m_runConfigBaseId;
|
||||||
|
@@ -236,7 +236,7 @@ public:
|
|||||||
static QString decoratedTargetName(const QString &targetName, Target *kit);
|
static QString decoratedTargetName(const QString &targetName, Target *kit);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QList<RunConfigurationCreationInfo> availableCreators(Target *parent) const;
|
virtual QList<RunConfigurationCreationInfo> availableCreators(Target *target) const;
|
||||||
|
|
||||||
using RunConfigurationCreator = std::function<RunConfiguration *(Target *)>;
|
using RunConfigurationCreator = std::function<RunConfiguration *(Target *)>;
|
||||||
|
|
||||||
|
@@ -232,12 +232,6 @@ DeploymentData Target::buildSystemDeploymentData() const
|
|||||||
return buildSystem()->deploymentData();
|
return buildSystem()->deploymentData();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<BuildTargetInfo> Target::applicationTargets() const
|
|
||||||
{
|
|
||||||
QTC_ASSERT(buildSystem(), return {});
|
|
||||||
return buildSystem()->applicationTargets();
|
|
||||||
}
|
|
||||||
|
|
||||||
BuildTargetInfo Target::buildTarget(const QString &buildKey) const
|
BuildTargetInfo Target::buildTarget(const QString &buildKey) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(buildSystem(), return {});
|
QTC_ASSERT(buildSystem(), return {});
|
||||||
|
@@ -121,7 +121,6 @@ public:
|
|||||||
|
|
||||||
DeploymentData deploymentData() const;
|
DeploymentData deploymentData() const;
|
||||||
DeploymentData buildSystemDeploymentData() const;
|
DeploymentData buildSystemDeploymentData() const;
|
||||||
const QList<BuildTargetInfo> applicationTargets() const;
|
|
||||||
BuildTargetInfo buildTarget(const QString &buildKey) const;
|
BuildTargetInfo buildTarget(const QString &buildKey) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@@ -37,6 +37,7 @@
|
|||||||
#include <cpptools/cppmodelmanager.h>
|
#include <cpptools/cppmodelmanager.h>
|
||||||
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
#include <projectexplorer/buildsystem.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
@@ -44,6 +45,7 @@
|
|||||||
#include <projectexplorer/runconfiguration.h>
|
#include <projectexplorer/runconfiguration.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
#include <qmljs/qmljsbind.h>
|
#include <qmljs/qmljsbind.h>
|
||||||
#include <qmljs/qmljsfindexportedcpptypes.h>
|
#include <qmljs/qmljsfindexportedcpptypes.h>
|
||||||
#include <qmljs/qmljsplugindumper.h>
|
#include <qmljs/qmljsplugindumper.h>
|
||||||
@@ -141,7 +143,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
|
|||||||
projectInfo.qmlDumpEnvironment.appendOrSet("QML2_IMPORT_PATH", bc->environment().expandedValueForKey("QML2_IMPORT_PATH"), ":");
|
projectInfo.qmlDumpEnvironment.appendOrSet("QML2_IMPORT_PATH", bc->environment().expandedValueForKey("QML2_IMPORT_PATH"), ":");
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto appTargets = activeTarget->applicationTargets();
|
const auto appTargets = activeTarget->buildSystem()->applicationTargets();
|
||||||
for (const auto &target : appTargets) {
|
for (const auto &target : appTargets) {
|
||||||
if (target.targetFilePath.isEmpty())
|
if (target.targetFilePath.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user