forked from qt-creator/qt-creator
RecipeRunner: Introduce RunInterface
For communication between RunControl and run recipes. Change-Id: Idf4a187384be057fa9f023a69e810cb3261d5fab Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -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());
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user