forked from qt-creator/qt-creator
AppMan: Use current setup pattern for build steps
Change-Id: Ia69b9ea67fdec6a33f13fba665ee4589e82a2574 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
|
||||
#include "appmanagerconstants.h"
|
||||
#include "appmanagertargetinformation.h"
|
||||
#include "appmanagertr.h"
|
||||
|
||||
#include <projectexplorer/buildstep.h>
|
||||
#include <projectexplorer/deployconfiguration.h>
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
@@ -16,32 +18,38 @@
|
||||
#include <cmakeprojectmanager/cmakeprojectconstants.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace CMakeProjectManager;
|
||||
using namespace Utils;
|
||||
|
||||
namespace AppManager {
|
||||
namespace Internal {
|
||||
namespace AppManager::Internal {
|
||||
|
||||
AppManagerCMakePackageStepFactory::AppManagerCMakePackageStepFactory()
|
||||
class AppManagerCMakePackageStepFactory final : public BuildStepFactory
|
||||
{
|
||||
cloneStepCreator(CMakeProjectManager::Constants::CMAKE_BUILD_STEP_ID, Constants::CMAKE_PACKAGE_STEP_ID);
|
||||
setExtraInit([] (BuildStep *step) {
|
||||
// We update the build targets when the active run configuration changes
|
||||
const auto updaterSlot = [step] {
|
||||
const auto targetInformation = TargetInformation(step->target());
|
||||
step->setBuildTargets({targetInformation.cmakeBuildTarget});
|
||||
step->setEnabled(!targetInformation.isBuiltin);
|
||||
};
|
||||
QObject::connect(step->target(), &Target::activeRunConfigurationChanged, step, updaterSlot);
|
||||
QObject::connect(step->target(), &Target::activeDeployConfigurationChanged, step, updaterSlot);
|
||||
QObject::connect(step->target(), &Target::parsingFinished, step, updaterSlot);
|
||||
QObject::connect(step->target(), &Target::runConfigurationsUpdated, step, updaterSlot);
|
||||
QObject::connect(step->project(), &Project::displayNameChanged, step, updaterSlot);
|
||||
});
|
||||
public:
|
||||
AppManagerCMakePackageStepFactory()
|
||||
{
|
||||
cloneStepCreator(CMakeProjectManager::Constants::CMAKE_BUILD_STEP_ID, Constants::CMAKE_PACKAGE_STEP_ID);
|
||||
setExtraInit([] (BuildStep *step) {
|
||||
// We update the build targets when the active run configuration changes
|
||||
const auto updaterSlot = [step] {
|
||||
const TargetInformation targetInformation(step->target());
|
||||
step->setBuildTargets({targetInformation.cmakeBuildTarget});
|
||||
step->setEnabled(!targetInformation.isBuiltin);
|
||||
};
|
||||
QObject::connect(step->target(), &Target::activeRunConfigurationChanged, step, updaterSlot);
|
||||
QObject::connect(step->target(), &Target::activeDeployConfigurationChanged, step, updaterSlot);
|
||||
QObject::connect(step->target(), &Target::parsingFinished, step, updaterSlot);
|
||||
QObject::connect(step->target(), &Target::runConfigurationsUpdated, step, updaterSlot);
|
||||
QObject::connect(step->project(), &Project::displayNameChanged, step, updaterSlot);
|
||||
});
|
||||
|
||||
setDisplayName(tr("Create Appman package with CMake"));
|
||||
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
|
||||
setDisplayName(Tr::tr("Create Appman package with CMake"));
|
||||
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
|
||||
}
|
||||
};
|
||||
|
||||
void setupAppManagerCMakePackageStep()
|
||||
{
|
||||
static AppManagerCMakePackageStepFactory theAppManagerCMakePackageStepFactory;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace AppManager
|
||||
} // AppManager::Internal
|
||||
|
||||
Reference in New Issue
Block a user