forked from qt-creator/qt-creator
Python: Use setup functions for run related items
Change-Id: Iefbeda433b0f7eaaf3c429dbc853e0c8578ceb3a Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -43,9 +43,6 @@ QObject *pluginInstance()
|
|||||||
class PythonPluginPrivate
|
class PythonPluginPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PythonRunConfigurationFactory runConfigFactory;
|
|
||||||
SimpleTargetRunnerFactory runWorkerFactory{{runConfigFactory.runConfigurationId()}};
|
|
||||||
SimpleDebugRunnerFactory debugRunWorkerFactory{{runConfigFactory.runConfigurationId()}, {ProjectExplorer::Constants::DAP_PY_DEBUG_RUN_MODE}};
|
|
||||||
PythonSettings settings;
|
PythonSettings settings;
|
||||||
PythonWizardPageFactory pythonWizardPageFactory;
|
PythonWizardPageFactory pythonWizardPageFactory;
|
||||||
};
|
};
|
||||||
@@ -77,6 +74,9 @@ private:
|
|||||||
setupPySideBuildStep();
|
setupPySideBuildStep();
|
||||||
setupPythonBuildConfiguration();
|
setupPythonBuildConfiguration();
|
||||||
|
|
||||||
|
setupPythonRunConfiguration();
|
||||||
|
setupPythonRunWorker();
|
||||||
|
setupPythonDebugWorker();
|
||||||
setupPythonOutputParser();
|
setupPythonOutputParser();
|
||||||
|
|
||||||
KitManager::setIrrelevantAspects(KitManager::irrelevantAspects()
|
KitManager::setIrrelevantAspects(KitManager::irrelevantAspects()
|
||||||
|
@@ -16,13 +16,17 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <debugger/debuggerruncontrol.h>
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/buildsystem.h>
|
#include <projectexplorer/buildsystem.h>
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
#include <projectexplorer/kitaspects.h>
|
#include <projectexplorer/kitaspects.h>
|
||||||
|
#include <projectexplorer/runconfiguration.h>
|
||||||
#include <projectexplorer/runconfigurationaspects.h>
|
#include <projectexplorer/runconfigurationaspects.h>
|
||||||
|
#include <projectexplorer/runcontrol.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
|
|
||||||
@@ -183,10 +187,34 @@ public:
|
|||||||
|
|
||||||
// Factories
|
// Factories
|
||||||
|
|
||||||
PythonRunConfigurationFactory::PythonRunConfigurationFactory()
|
class PythonRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
||||||
{
|
{
|
||||||
registerRunConfiguration<PythonRunConfiguration>(Constants::C_PYTHONRUNCONFIGURATION_ID);
|
public:
|
||||||
addSupportedProjectType(PythonProjectId);
|
PythonRunConfigurationFactory()
|
||||||
|
{
|
||||||
|
registerRunConfiguration<PythonRunConfiguration>(Constants::C_PYTHONRUNCONFIGURATION_ID);
|
||||||
|
addSupportedProjectType(PythonProjectId);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void setupPythonRunConfiguration()
|
||||||
|
{
|
||||||
|
static PythonRunConfigurationFactory thePythonRunConfigurationFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setupPythonRunWorker()
|
||||||
|
{
|
||||||
|
static SimpleTargetRunnerFactory thePythonRunWorkerFactory(
|
||||||
|
{Constants::C_PYTHONRUNCONFIGURATION_ID}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setupPythonDebugWorker()
|
||||||
|
{
|
||||||
|
static Debugger::SimpleDebugRunnerFactory thePythonDebugRunWorkerFactory(
|
||||||
|
{Constants::C_PYTHONRUNCONFIGURATION_ID},
|
||||||
|
{ProjectExplorer::Constants::DAP_PY_DEBUG_RUN_MODE}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupPythonOutputParser()
|
void setupPythonOutputParser()
|
||||||
|
@@ -3,20 +3,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/runconfiguration.h>
|
|
||||||
#include <projectexplorer/runconfigurationaspects.h>
|
|
||||||
#include <projectexplorer/runcontrol.h>
|
|
||||||
|
|
||||||
namespace Python::Internal {
|
namespace Python::Internal {
|
||||||
|
|
||||||
class PySideUicExtraCompiler;
|
void setupPythonRunConfiguration();
|
||||||
|
void setupPythonRunWorker();
|
||||||
class PythonRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
void setupPythonDebugWorker();
|
||||||
{
|
|
||||||
public:
|
|
||||||
PythonRunConfigurationFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
void setupPythonOutputParser();
|
void setupPythonOutputParser();
|
||||||
|
|
||||||
} // Python::Internal
|
} // Python::Internal
|
||||||
|
Reference in New Issue
Block a user