forked from qt-creator/qt-creator
Ios: Remove direct compile time dependency of IosRunConfig on qmake
Change-Id: Ieb0cbc71b525972afb66883b010cbf389657c406 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -44,6 +44,9 @@ const char IOS_SIMULATOR_DEVICE_ID[] = "iOS Simulator Device ";
|
|||||||
const char IOS_PRESET_BUILD_STEP_ID[] = "Ios.IosPresetBuildStep";
|
const char IOS_PRESET_BUILD_STEP_ID[] = "Ios.IosPresetBuildStep";
|
||||||
const char IOS_DSYM_BUILD_STEP_ID[] = "Ios.IosDsymBuildStep";
|
const char IOS_DSYM_BUILD_STEP_ID[] = "Ios.IosDsymBuildStep";
|
||||||
|
|
||||||
|
const char IosTarget[] = "IosTarget"; // QString
|
||||||
|
const char IosBuildDir[] = "IosBuildDir"; // QString
|
||||||
|
|
||||||
const quint16 IOS_DEVICE_PORT_START = 30000;
|
const quint16 IOS_DEVICE_PORT_START = 30000;
|
||||||
const quint16 IOS_DEVICE_PORT_END = 31000;
|
const quint16 IOS_DEVICE_PORT_END = 31000;
|
||||||
const quint16 IOS_SIMULATOR_PORT_START = 30000;
|
const quint16 IOS_SIMULATOR_PORT_START = 30000;
|
||||||
|
@@ -34,13 +34,11 @@
|
|||||||
#include <projectexplorer/deployconfiguration.h>
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||||
#include <projectexplorer/kitinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
|
#include <projectexplorer/project.h>
|
||||||
|
#include <projectexplorer/projectnodes.h>
|
||||||
#include <projectexplorer/runconfigurationaspects.h>
|
#include <projectexplorer/runconfigurationaspects.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
#include <qmakeprojectmanager/qmakenodes.h>
|
|
||||||
#include <qmakeprojectmanager/qmakeproject.h>
|
|
||||||
#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h>
|
|
||||||
|
|
||||||
#include <qtsupport/qtoutputformatter.h>
|
#include <qtsupport/qtoutputformatter.h>
|
||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
@@ -62,7 +60,6 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace QmakeProjectManager;
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Ios {
|
namespace Ios {
|
||||||
@@ -160,11 +157,9 @@ void IosRunConfiguration::updateEnabledState()
|
|||||||
QString IosRunConfiguration::applicationName() const
|
QString IosRunConfiguration::applicationName() const
|
||||||
{
|
{
|
||||||
Project *project = target()->project();
|
Project *project = target()->project();
|
||||||
if (auto pro = dynamic_cast<const QmakeProFileNode *>(project->findNodeForBuildKey(buildKey()))) {
|
if (ProjectNode *node = project->findNodeForBuildKey(buildKey()))
|
||||||
TargetInformation ti = pro->targetInformation();
|
return node->data(Constants::IosTarget).toString();
|
||||||
if (ti.valid)
|
|
||||||
return ti.target;
|
|
||||||
}
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,12 +174,8 @@ FileName IosRunConfiguration::bundleDirectory() const
|
|||||||
}
|
}
|
||||||
if (BuildConfiguration *bc = target()->activeBuildConfiguration()) {
|
if (BuildConfiguration *bc = target()->activeBuildConfiguration()) {
|
||||||
Project *project = target()->project();
|
Project *project = target()->project();
|
||||||
auto pro = dynamic_cast<const QmakeProFileNode *>(project->findNodeForBuildKey(buildKey()));
|
if (ProjectNode *node = project->findNodeForBuildKey(buildKey()))
|
||||||
if (pro) {
|
res = FileName::fromString(node->data(Constants::IosBuildDir).toString());
|
||||||
TargetInformation ti = pro->targetInformation();
|
|
||||||
if (ti.valid)
|
|
||||||
res = ti.buildDir;
|
|
||||||
}
|
|
||||||
if (res.isEmpty())
|
if (res.isEmpty())
|
||||||
res = bc->buildDirectory();
|
res = bc->buildDirectory();
|
||||||
switch (bc->buildType()) {
|
switch (bc->buildType()) {
|
||||||
@@ -400,7 +391,6 @@ IosRunConfigurationFactory::IosRunConfigurationFactory()
|
|||||||
registerRunConfiguration<IosRunConfiguration>("Qt4ProjectManager.IosRunConfiguration:");
|
registerRunConfiguration<IosRunConfiguration>("Qt4ProjectManager.IosRunConfiguration:");
|
||||||
addSupportedTargetDeviceType(Constants::IOS_DEVICE_TYPE);
|
addSupportedTargetDeviceType(Constants::IOS_DEVICE_TYPE);
|
||||||
addSupportedTargetDeviceType(Constants::IOS_SIMULATOR_TYPE);
|
addSupportedTargetDeviceType(Constants::IOS_SIMULATOR_TYPE);
|
||||||
addSupportedProjectType(QmakeProjectManager::Constants::QMAKEPROJECT_ID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -36,6 +36,7 @@
|
|||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
#include <android/androidconstants.h>
|
#include <android/androidconstants.h>
|
||||||
|
#include <ios/iosconstants.h>
|
||||||
|
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
@@ -292,6 +293,18 @@ QVariant QmakeProFileNode::data(Core::Id role) const
|
|||||||
if (role == Android::Constants::AndroidTargets)
|
if (role == Android::Constants::AndroidTargets)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
|
if (role == Ios::Constants::IosTarget) {
|
||||||
|
const TargetInformation info = targetInformation();
|
||||||
|
if (info.valid)
|
||||||
|
return info.target;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (role == Ios::Constants::IosBuildDir) {
|
||||||
|
const TargetInformation info = targetInformation();
|
||||||
|
if (info.valid)
|
||||||
|
return info.buildDir.toString();
|
||||||
|
}
|
||||||
|
|
||||||
QTC_CHECK(false);
|
QTC_CHECK(false);
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user