forked from qt-creator/qt-creator
ProjectExplorer: Add a mechanism to specify initial steps
... in a deploy configuration. The idea is to replace DeployConfiguration-derived::initialize() functions by that. This can also be used to cut link-time ties of "derived plugins" by using step ids instead of creation of real class instances when specifying deploy config contents. Change-Id: Id7c613b054e37fe5d03463b9b0aa7dfef44a8e13 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -198,6 +198,10 @@ DeployConfiguration *DeployConfigurationFactory::create(Target *parent, Core::Id
|
||||
if (!dc)
|
||||
return nullptr;
|
||||
dc->initialize();
|
||||
for (const DeployStepCreationInfo &info : qAsConst(m_initialSteps)) {
|
||||
if (!info.condition || info.condition(parent))
|
||||
dc->stepList()->appendStep(info.deployStepId);
|
||||
}
|
||||
return dc;
|
||||
}
|
||||
|
||||
@@ -251,6 +255,11 @@ void DeployConfigurationFactory::setSupportedProjectType(Core::Id id)
|
||||
m_supportedProjectType = id;
|
||||
}
|
||||
|
||||
void DeployConfigurationFactory::addInitialStep(Core::Id stepId, const std::function<bool (Target *)> &condition)
|
||||
{
|
||||
m_initialSteps.append({stepId, condition});
|
||||
}
|
||||
|
||||
///
|
||||
// DefaultDeployConfigurationFactory
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user