RecipeRunner: Introduce RunInterface

For communication between RunControl and run recipes.

Change-Id: Idf4a187384be057fa9f023a69e810cb3261d5fab
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2025-02-27 13:52:07 +01:00
parent 8099cd0143
commit 5785323883
2 changed files with 23 additions and 0 deletions

View File

@@ -1950,6 +1950,17 @@ ProcessRunnerFactory::ProcessRunnerFactory(const QList<Id> &runConfigs)
setSupportedRunConfigs(runConfigs);
}
Storage<RunInterface> runStorage()
{
static Storage<RunInterface> theRunStorage;
return theRunStorage;
}
Canceler canceler()
{
return [] { return std::make_pair(runStorage().activeStorage(), &RunInterface::canceled); };
}
void RecipeRunner::start()
{
QTC_CHECK(!m_taskTreeRunner.isRunning());

View File

@@ -304,6 +304,18 @@ void addOutputParserFactory(const std::function<Utils::OutputLineParser *(Target
PROJECTEXPLORER_EXPORT QList<Utils::OutputLineParser *> createOutputParsers(Target *target);
class PROJECTEXPLORER_EXPORT RunInterface : public QObject
{
Q_OBJECT
signals:
void canceled();
};
PROJECTEXPLORER_EXPORT Tasking::Storage<RunInterface> runStorage();
using Canceler = std::function<std::pair<RunInterface *, void (RunInterface::*)()>()>;
PROJECTEXPLORER_EXPORT Canceler canceler();
class PROJECTEXPLORER_EXPORT RecipeRunner final : public RunWorker
{
public: