WebAssembly: use a dedicated class to create EmrunRunWorker

Change-Id: Idbeece82d8b59f02148207b0459a76aae162bb51
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-01-06 14:32:11 +01:00
parent 57adf73a89
commit 82c1a3a934
4 changed files with 22 additions and 27 deletions

View File

@@ -25,8 +25,7 @@ using namespace Core;
using namespace ProjectExplorer;
using namespace Utils;
namespace WebAssembly {
namespace Internal {
namespace WebAssembly::Internal {
class WebAssemblyPluginPrivate
{
@@ -35,11 +34,7 @@ public:
WebAssemblyDeviceFactory deviceFactory;
WebAssemblyQtVersionFactory qtVersionFactory;
EmrunRunConfigurationFactory emrunRunConfigurationFactory;
RunWorkerFactory emrunRunWorkerFactory{
makeEmrunWorker(),
{ProjectExplorer::Constants::NORMAL_RUN_MODE},
{Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN}
};
EmrunRunWorkerFactory emrunRunWorkerFactory;
WebAssemblyOptionsPage optionsPage;
};
@@ -94,5 +89,4 @@ void WebAssemblyPlugin::askUserAboutEmSdkSetup()
ICore::infoBar()->addInfo(info);
}
} // namespace Internal
} // namespace WebAssembly
} // WebAssembly::Internal

View File

@@ -7,8 +7,7 @@
#include <extensionsystem/iplugin.h>
namespace WebAssembly {
namespace Internal {
namespace WebAssembly::Internal {
class WebAssemblyPlugin : public ExtensionSystem::IPlugin
{
@@ -32,5 +31,4 @@ private slots:
#endif // WITH_TESTS
};
} // namespace Internal
} // namespace WebAssembly
} // WebAssembly::Internal

View File

@@ -11,14 +11,14 @@
#include <projectexplorer/devicesupport/devicemanager.h>
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runcontrol.h>
#include <projectexplorer/target.h>
using namespace ProjectExplorer;
using namespace Utils;
namespace WebAssembly {
namespace Internal {
namespace WebAssembly::Internal {
static FilePath pythonInterpreter(const Environment &env)
{
@@ -111,11 +111,6 @@ public:
}
};
RunWorkerFactory::WorkerCreator makeEmrunWorker()
{
return RunWorkerFactory::make<EmrunRunWorker>();
}
// Factories
EmrunRunConfigurationFactory::EmrunRunConfigurationFactory()
@@ -124,5 +119,11 @@ EmrunRunConfigurationFactory::EmrunRunConfigurationFactory()
addSupportedTargetDeviceType(Constants::WEBASSEMBLY_DEVICE_TYPE);
}
} // namespace Internal
} // namespace Webassembly
EmrunRunWorkerFactory::EmrunRunWorkerFactory()
{
setProduct<EmrunRunWorker>();
addSupportedRunMode(ProjectExplorer::Constants::NORMAL_RUN_MODE);
addSupportedRunConfig(Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN);
}
} // Webassembly::Internal

View File

@@ -6,8 +6,7 @@
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/runcontrol.h>
namespace WebAssembly {
namespace Internal {
namespace WebAssembly::Internal {
class EmrunRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory
{
@@ -15,7 +14,10 @@ public:
EmrunRunConfigurationFactory();
};
ProjectExplorer::RunWorkerFactory::WorkerCreator makeEmrunWorker();
class EmrunRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
{
public:
EmrunRunWorkerFactory();
};
} // namespace Internal
} // namespace Webassembly
} // Webassembly::Internal