forked from qt-creator/qt-creator
Qnx: Use new setup scheme for most factories
Change-Id: Ie6154d816fb9d77948d73416b43bb933a56f6bbb Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -48,11 +48,20 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
QnxQmlProfilerWorkerFactory::QnxQmlProfilerWorkerFactory()
|
class QnxQmlProfilerWorkerFactory final : public RunWorkerFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QnxQmlProfilerWorkerFactory()
|
||||||
{
|
{
|
||||||
setProduct<QnxQmlProfilerSupport>();
|
setProduct<QnxQmlProfilerSupport>();
|
||||||
// FIXME: Shouldn't this use the run mode id somehow?
|
// FIXME: Shouldn't this use the run mode id somehow?
|
||||||
addSupportedRunConfig(Constants::QNX_RUNCONFIG_ID);
|
addSupportedRunConfig(Constants::QNX_RUNCONFIG_ID);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupQnxQmlProfiler()
|
||||||
|
{
|
||||||
|
static QnxQmlProfilerWorkerFactory theQnxQmlProfilerWorkerFactory;
|
||||||
|
}
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
@@ -3,14 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/runcontrol.h>
|
|
||||||
|
|
||||||
namespace Qnx::Internal {
|
namespace Qnx::Internal {
|
||||||
|
|
||||||
class QnxQmlProfilerWorkerFactory final : public ProjectExplorer::RunWorkerFactory
|
void setupQnxQmlProfiler();
|
||||||
{
|
|
||||||
public:
|
|
||||||
QnxQmlProfilerWorkerFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
@@ -252,11 +252,20 @@ void showAttachToProcessDialog()
|
|||||||
|
|
||||||
// QnxDebugWorkerFactory
|
// QnxDebugWorkerFactory
|
||||||
|
|
||||||
QnxDebugWorkerFactory::QnxDebugWorkerFactory()
|
class QnxDebugWorkerFactory final : public RunWorkerFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QnxDebugWorkerFactory()
|
||||||
{
|
{
|
||||||
setProduct<QnxDebugSupport>();
|
setProduct<QnxDebugSupport>();
|
||||||
addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
||||||
addSupportedRunConfig(Constants::QNX_RUNCONFIG_ID);
|
addSupportedRunConfig(Constants::QNX_RUNCONFIG_ID);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupQnxDebugging()
|
||||||
|
{
|
||||||
|
static QnxDebugWorkerFactory theQnxDebugWorkerFactory;
|
||||||
|
}
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
@@ -3,16 +3,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <debugger/debuggerruncontrol.h>
|
|
||||||
|
|
||||||
namespace Qnx::Internal {
|
namespace Qnx::Internal {
|
||||||
|
|
||||||
void showAttachToProcessDialog();
|
void showAttachToProcessDialog();
|
||||||
|
void setupQnxDebugging();
|
||||||
class QnxDebugWorkerFactory final : public ProjectExplorer::RunWorkerFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QnxDebugWorkerFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <projectexplorer/devicesupport/idevicefactory.h>
|
||||||
#include <projectexplorer/devicesupport/sshparameters.h>
|
#include <projectexplorer/devicesupport/sshparameters.h>
|
||||||
|
|
||||||
#include <remotelinux/linuxdevice.h>
|
#include <remotelinux/linuxdevice.h>
|
||||||
@@ -86,7 +87,10 @@ public:
|
|||||||
DeviceTester *createDeviceTester() const final { return new QnxDeviceTester; }
|
DeviceTester *createDeviceTester() const final { return new QnxDeviceTester; }
|
||||||
};
|
};
|
||||||
|
|
||||||
QnxDeviceFactory::QnxDeviceFactory() : IDeviceFactory(Constants::QNX_QNX_OS_TYPE)
|
class QnxDeviceFactory final : public IDeviceFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QnxDeviceFactory() : IDeviceFactory(Constants::QNX_QNX_OS_TYPE)
|
||||||
{
|
{
|
||||||
setDisplayName(Tr::tr("QNX Device"));
|
setDisplayName(Tr::tr("QNX Device"));
|
||||||
setCombinedIcon(":/qnx/images/qnxdevicesmall.png",
|
setCombinedIcon(":/qnx/images/qnxdevicesmall.png",
|
||||||
@@ -101,5 +105,11 @@ QnxDeviceFactory::QnxDeviceFactory() : IDeviceFactory(Constants::QNX_QNX_OS_TYPE
|
|||||||
return device;
|
return device;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupQnxDevice()
|
||||||
|
{
|
||||||
|
static QnxDeviceFactory theQnxDeviceFactory;
|
||||||
|
}
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
@@ -3,14 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/idevicefactory.h>
|
|
||||||
|
|
||||||
namespace Qnx::Internal {
|
namespace Qnx::Internal {
|
||||||
|
|
||||||
class QnxDeviceFactory final : public ProjectExplorer::IDeviceFactory
|
void setupQnxDevice();
|
||||||
{
|
|
||||||
public:
|
|
||||||
QnxDeviceFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
@@ -71,6 +71,14 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void setupQnxDeployment()
|
||||||
|
{
|
||||||
|
static QnxDeployConfigurationFactory deployConfigFactory;
|
||||||
|
static QnxDeployStepFactory directUploadDeployFactory{RemoteLinux::Constants::DirectUploadStepId,
|
||||||
|
Constants::QNX_DIRECT_UPLOAD_STEP_ID};
|
||||||
|
static QnxDeployStepFactory makeInstallStepFactory{RemoteLinux::Constants::MakeInstallStepId};
|
||||||
|
}
|
||||||
|
|
||||||
class QnxPluginPrivate
|
class QnxPluginPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -80,17 +88,6 @@ public:
|
|||||||
QAction m_attachToQnxApplication{Tr::tr("Attach to remote QNX application..."), nullptr};
|
QAction m_attachToQnxApplication{Tr::tr("Attach to remote QNX application..."), nullptr};
|
||||||
|
|
||||||
QnxSettingsPage settingsPage;
|
QnxSettingsPage settingsPage;
|
||||||
QnxQtVersionFactory qtVersionFactory;
|
|
||||||
QnxDeviceFactory deviceFactory;
|
|
||||||
QnxDeployConfigurationFactory deployConfigFactory;
|
|
||||||
QnxDeployStepFactory directUploadDeployFactory{RemoteLinux::Constants::DirectUploadStepId,
|
|
||||||
Constants::QNX_DIRECT_UPLOAD_STEP_ID};
|
|
||||||
QnxDeployStepFactory makeInstallStepFactory{RemoteLinux::Constants::MakeInstallStepId};
|
|
||||||
QnxRunConfigurationFactory runConfigFactory;
|
|
||||||
QnxToolChainFactory toolChainFactory;
|
|
||||||
SimpleTargetRunnerFactory runWorkerFactory{{runConfigFactory.runConfigurationId()}};
|
|
||||||
QnxDebugWorkerFactory debugWorkerFactory;
|
|
||||||
QnxQmlProfilerWorkerFactory qmlProfilerWorkerFactory;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class QnxPlugin final : public ExtensionSystem::IPlugin
|
class QnxPlugin final : public ExtensionSystem::IPlugin
|
||||||
@@ -102,7 +99,19 @@ public:
|
|||||||
~QnxPlugin() final { delete d; }
|
~QnxPlugin() final { delete d; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialize() final { d = new QnxPluginPrivate; }
|
void initialize() final
|
||||||
|
{
|
||||||
|
d = new QnxPluginPrivate;
|
||||||
|
|
||||||
|
setupQnxDevice();
|
||||||
|
setupQnxToolChain();
|
||||||
|
setupQnxQtVersion();
|
||||||
|
setupQnxDeployment();
|
||||||
|
setupQnxRunnning();
|
||||||
|
setupQnxDebugging();
|
||||||
|
setupQnxQmlProfiler();
|
||||||
|
}
|
||||||
|
|
||||||
void extensionsInitialized() final;
|
void extensionsInitialized() final;
|
||||||
|
|
||||||
QnxPluginPrivate *d = nullptr;
|
QnxPluginPrivate *d = nullptr;
|
||||||
|
|||||||
@@ -190,12 +190,21 @@ EnvironmentItems QnxQtVersion::environment() const
|
|||||||
|
|
||||||
// Factory
|
// Factory
|
||||||
|
|
||||||
QnxQtVersionFactory::QnxQtVersionFactory()
|
class QnxQtVersionFactory : public QtSupport::QtVersionFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QnxQtVersionFactory()
|
||||||
{
|
{
|
||||||
setQtVersionCreator([] { return new QnxQtVersion; });
|
setQtVersionCreator([] { return new QnxQtVersion; });
|
||||||
setSupportedType(Constants::QNX_QNX_QT);
|
setSupportedType(Constants::QNX_QNX_QT);
|
||||||
setPriority(50);
|
setPriority(50);
|
||||||
setRestrictionChecker([](const SetupData &setup) { return setup.isQnx; });
|
setRestrictionChecker([](const SetupData &setup) { return setup.isQnx; });
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupQnxQtVersion()
|
||||||
|
{
|
||||||
|
static QnxQtVersionFactory theQnxQtVersionFactory;
|
||||||
|
}
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
@@ -57,10 +57,6 @@ private:
|
|||||||
mutable Utils::EnvironmentItems m_qnxEnv;
|
mutable Utils::EnvironmentItems m_qnxEnv;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QnxQtVersionFactory : public QtSupport::QtVersionFactory
|
void setupQnxQtVersion();
|
||||||
{
|
|
||||||
public:
|
|
||||||
QnxQtVersionFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
@@ -84,10 +84,20 @@ public:
|
|||||||
|
|
||||||
// QnxRunConfigurationFactory
|
// QnxRunConfigurationFactory
|
||||||
|
|
||||||
QnxRunConfigurationFactory::QnxRunConfigurationFactory()
|
class QnxRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QnxRunConfigurationFactory()
|
||||||
{
|
{
|
||||||
registerRunConfiguration<QnxRunConfiguration>(Constants::QNX_RUNCONFIG_ID);
|
registerRunConfiguration<QnxRunConfiguration>(Constants::QNX_RUNCONFIG_ID);
|
||||||
addSupportedTargetDeviceType(Constants::QNX_QNX_OS_TYPE);
|
addSupportedTargetDeviceType(Constants::QNX_QNX_OS_TYPE);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupQnxRunnning()
|
||||||
|
{
|
||||||
|
static QnxRunConfigurationFactory theQnxRunConfigurationFactory;
|
||||||
|
static SimpleTargetRunnerFactory theQnxRunWorkerFactory({Constants::QNX_RUNCONFIG_ID});
|
||||||
|
}
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
@@ -3,14 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
|
||||||
|
|
||||||
namespace Qnx::Internal {
|
namespace Qnx::Internal {
|
||||||
|
|
||||||
class QnxRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory
|
void setupQnxRunnning();
|
||||||
{
|
|
||||||
public:
|
|
||||||
QnxRunConfigurationFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
@@ -162,30 +162,6 @@ bool QnxToolChain::operator ==(const ToolChain &other) const
|
|||||||
return sdpPath() == qnxTc->sdpPath() && cpuDir() == qnxTc->cpuDir();
|
return sdpPath() == qnxTc->sdpPath() && cpuDir() == qnxTc->cpuDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
// QnxToolChainFactory
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
QnxToolChainFactory::QnxToolChainFactory()
|
|
||||||
{
|
|
||||||
setDisplayName(Tr::tr("QCC"));
|
|
||||||
setSupportedToolChainType(Constants::QNX_TOOLCHAIN_ID);
|
|
||||||
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
|
||||||
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
|
||||||
setToolchainConstructor([] { return new QnxToolChain; });
|
|
||||||
setUserCreatable(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
Toolchains QnxToolChainFactory::autoDetect(const ToolchainDetector &detector) const
|
|
||||||
{
|
|
||||||
// FIXME: Support detecting toolchains on remote devices
|
|
||||||
if (detector.device)
|
|
||||||
return {};
|
|
||||||
|
|
||||||
Toolchains tcs = QnxSettingsPage::autoDetect(detector.alreadyKnown);
|
|
||||||
return tcs;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
// QnxToolChainConfigWidget
|
// QnxToolChainConfigWidget
|
||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
@@ -275,4 +251,35 @@ void QnxToolChainConfigWidget::handleSdpPathChange()
|
|||||||
emit dirty();
|
emit dirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// QnxToolChainFactory
|
||||||
|
|
||||||
|
class QnxToolChainFactory : public ToolChainFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QnxToolChainFactory()
|
||||||
|
{
|
||||||
|
setDisplayName(Tr::tr("QCC"));
|
||||||
|
setSupportedToolChainType(Constants::QNX_TOOLCHAIN_ID);
|
||||||
|
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
||||||
|
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||||
|
setToolchainConstructor([] { return new QnxToolChain; });
|
||||||
|
setUserCreatable(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Toolchains autoDetect(const ToolchainDetector &detector) const final
|
||||||
|
{
|
||||||
|
// FIXME: Support detecting toolchains on remote devices
|
||||||
|
if (detector.device)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
Toolchains tcs = QnxSettingsPage::autoDetect(detector.alreadyKnown);
|
||||||
|
return tcs;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupQnxToolChain()
|
||||||
|
{
|
||||||
|
static QnxToolChainFactory theQnxToolChainFactory;
|
||||||
|
}
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
@@ -26,17 +26,6 @@ protected:
|
|||||||
DetectedAbisResult detectSupportedAbis() const override;
|
DetectedAbisResult detectSupportedAbis() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
void setupQnxToolChain();
|
||||||
// QnxToolChainFactory
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class QnxToolChainFactory : public ProjectExplorer::ToolChainFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QnxToolChainFactory();
|
|
||||||
|
|
||||||
ProjectExplorer::Toolchains autoDetect(
|
|
||||||
const ProjectExplorer::ToolchainDetector &detector) const final;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Qnx::Internal
|
} // Qnx::Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user