Incredibuild: Do not rely on metaobject classnames for build steps

The preferred interface are step ids, #include'ing other modules
*constants.h header is considered ok for siblings in the core
distribution and does not create run time dependencies between plugins.

Change-Id: I0421936068b459c1aea61e23310f860d8ed1f0d4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-08-07 13:50:03 +02:00
parent 326cf1a982
commit 2bda74b46f
6 changed files with 24 additions and 38 deletions

View File

@@ -26,15 +26,12 @@
#include "cmakecommandbuilder.h"
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildstep.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/project.h>
#include <utils/qtcprocess.h>
#include <cmakeprojectmanager/cmakeprojectconstants.h> // Compile-time only
#include <QRegularExpression>
#include <QStandardPaths>
@@ -43,19 +40,9 @@ using namespace ProjectExplorer;
namespace IncrediBuild {
namespace Internal {
bool CMakeCommandBuilder::canMigrate(BuildStepList *buildStepList)
QList<Utils::Id> CMakeCommandBuilder::migratableSteps() const
{
// "Make"
QString makeClassName("CMakeProjectManager::Internal::CMakeBuildStep");
for (int i = buildStepList->count() - 1; i >= 0; --i) {
QString className = QString::fromUtf8(buildStepList->at(i)->metaObject()->className());
if (className.compare(makeClassName) == 0) {
buildStepList->at(i)->setEnabled(false);
buildStepList->at(i)->projectConfiguration()->project()->saveSettings();
return true;
}
}
return false;
return {CMakeProjectManager::Constants::CMAKE_BUILD_STEP_ID};
}
QString CMakeCommandBuilder::defaultCommand() const