forked from qt-creator/qt-creator
ProjectExplorer: Introduce and use a Target::buildSystemUpdated signal
Change-Id: I497d46866146600a1ed9162bd720c574ee4d4769 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "androidmanager.h"
|
||||
#include "adbcommandswidget.h"
|
||||
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/target.h>
|
||||
@@ -132,7 +133,7 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Core::Id id)
|
||||
postStartShellCmdAspect->setSettingsKey("Android.PostStartShellCmdListKey");
|
||||
postStartShellCmdAspect->setLabel(tr("Shell commands to run on Android device after application quits."));
|
||||
|
||||
connect(target, &Target::parsingFinished, this, [this] {
|
||||
connect(target, &Target::buildSystemUpdated, this, [this] {
|
||||
updateTargetInformation();
|
||||
AndroidManager::updateGradleProperties(this->target(), buildKey());
|
||||
});
|
||||
|
@@ -153,6 +153,8 @@ void AutotoolsBuildSystem::makefileParsingFinished()
|
||||
|
||||
m_makefileParserThread->deleteLater();
|
||||
m_makefileParserThread = nullptr;
|
||||
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
static QStringList filterIncludes(const QString &absSrc, const QString &absBuild,
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "baremetalconstants.h"
|
||||
#include "baremetalrunconfiguration.h"
|
||||
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/buildtargetinfo.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
@@ -49,13 +50,9 @@ BareMetalRunConfiguration::BareMetalRunConfiguration(Target *target, Core::Id id
|
||||
addAspect<ArgumentsAspect>();
|
||||
addAspect<WorkingDirectoryAspect>();
|
||||
|
||||
connect(target, &Target::deploymentDataChanged,
|
||||
this, &BareMetalRunConfiguration::updateTargetInformation);
|
||||
connect(target, &Target::applicationTargetsChanged,
|
||||
this, &BareMetalRunConfiguration::updateTargetInformation);
|
||||
connect(target, &Target::kitChanged,
|
||||
this, &BareMetalRunConfiguration::updateTargetInformation); // Handles device changes, etc.
|
||||
connect(target, &Target::parsingFinished,
|
||||
connect(target, &Target::buildSystemUpdated,
|
||||
this, &BareMetalRunConfiguration::updateTargetInformation);
|
||||
}
|
||||
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "qdbconstants.h"
|
||||
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/buildtargetinfo.h>
|
||||
#include <projectexplorer/deploymentdata.h>
|
||||
#include <projectexplorer/project.h>
|
||||
@@ -85,13 +86,9 @@ QdbRunConfiguration::QdbRunConfiguration(Target *target, Core::Id id)
|
||||
addAspect<WorkingDirectoryAspect>();
|
||||
addAspect<FullCommandLineAspect>(this);
|
||||
|
||||
connect(target, &Target::deploymentDataChanged,
|
||||
this, &QdbRunConfiguration::updateTargetInformation);
|
||||
connect(target, &Target::applicationTargetsChanged,
|
||||
this, &QdbRunConfiguration::updateTargetInformation);
|
||||
connect(target, &Target::kitChanged,
|
||||
this, &QdbRunConfiguration::updateTargetInformation);
|
||||
connect(target, &Target::parsingFinished,
|
||||
connect(target, &Target::buildSystemUpdated,
|
||||
this, &QdbRunConfiguration::updateTargetInformation);
|
||||
|
||||
setDefaultDisplayName(tr("Run on Boot2Qt Device"));
|
||||
|
@@ -362,6 +362,8 @@ void CMakeBuildSystem::combineScanAndParse()
|
||||
}
|
||||
|
||||
m_currentGuard = {};
|
||||
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
void CMakeBuildSystem::checkAndReportError(QString &errorMessage)
|
||||
|
@@ -502,6 +502,8 @@ void CompilationDatabaseBuildSystem::updateDeploymentData()
|
||||
m_deployFileWatcher->addFile(deploymentFilePath.toString(),
|
||||
FileSystemWatcher::WatchModifiedDate);
|
||||
}
|
||||
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
static TextEditor::TextDocument *createCompilationDatabaseDocument()
|
||||
|
@@ -498,6 +498,8 @@ void GenericBuildSystem::refresh(RefreshOptions options)
|
||||
refreshCppCodeModel();
|
||||
updateDeploymentData();
|
||||
guard.markAsSuccess();
|
||||
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -179,7 +179,8 @@ void NimbleBuildSystem::setTasks(std::vector<NimbleTask> tasks)
|
||||
return;
|
||||
m_tasks = std::move(tasks);
|
||||
emit tasksChanged();
|
||||
emit target()->targetPropertiesChanged();
|
||||
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
void NimbleBuildSystem::setMetadata(NimbleMetadata metadata)
|
||||
|
@@ -49,9 +49,7 @@ NimbleRunConfiguration::NimbleRunConfiguration(ProjectExplorer::Target *target,
|
||||
addAspect<WorkingDirectoryAspect>();
|
||||
addAspect<TerminalAspect>();
|
||||
|
||||
connect(target, &Target::parsingFinished,
|
||||
this, &NimbleRunConfiguration::updateTargetInformation);
|
||||
connect(target, &Target::targetPropertiesChanged,
|
||||
connect(target, &Target::buildSystemUpdated,
|
||||
this, &NimbleRunConfiguration::updateTargetInformation);
|
||||
|
||||
updateTargetInformation();
|
||||
|
@@ -160,6 +160,8 @@ void NimBuildSystem::updateProject()
|
||||
// Complete scan
|
||||
m_guard.markAsSuccess();
|
||||
m_guard = {}; // Trigger destructor of previous object, emitting parsingFinished()
|
||||
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
bool NimBuildSystem::supportsAction(Node *context, ProjectAction action, const Node *node) const
|
||||
|
@@ -274,7 +274,6 @@ void BuildSystem::setDeploymentData(const DeploymentData &deploymentData)
|
||||
emit deploymentDataChanged();
|
||||
emit applicationTargetsChanged();
|
||||
emit target()->deploymentDataChanged();
|
||||
emit target()->applicationTargetsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +287,6 @@ void BuildSystem::setApplicationTargets(const QList<BuildTargetInfo> &appTargets
|
||||
if (Utils::toSet(appTargets) != Utils::toSet(d->m_appTargets)) {
|
||||
d->m_appTargets = appTargets;
|
||||
emit applicationTargetsChanged();
|
||||
emit target()->applicationTargetsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,6 +307,11 @@ void BuildSystem::setRootProjectNode(std::unique_ptr<ProjectNode> &&root)
|
||||
d->m_target->project()->setRootProjectNode(std::move(root));
|
||||
}
|
||||
|
||||
void BuildSystem::emitBuildSystemUpdated()
|
||||
{
|
||||
target()->buildSystemUpdated(this);
|
||||
}
|
||||
|
||||
QString BuildSystem::disabledReason(const QString &buildKey) const
|
||||
{
|
||||
if (hasParsingData()) {
|
||||
|
@@ -114,6 +114,8 @@ public:
|
||||
mutable bool m_success = false;
|
||||
};
|
||||
|
||||
void emitBuildSystemUpdated();
|
||||
|
||||
public:
|
||||
// FIXME: Make this private and the BuildSystem a friend
|
||||
ParseGuard guardParsingRun() { return ParseGuard(this); }
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "desktoprunconfiguration.h"
|
||||
|
||||
#include "buildsystem.h"
|
||||
#include "localenvironmentaspect.h"
|
||||
#include "project.h"
|
||||
#include "runconfigurationaspects.h"
|
||||
@@ -78,13 +79,6 @@ DesktopRunConfiguration::DesktopRunConfiguration(Target *target, Core::Id id, Ki
|
||||
|
||||
if (kind == Qbs) {
|
||||
|
||||
connect(target, &Target::parsingFinished,
|
||||
envAspect, &EnvironmentAspect::environmentChanged);
|
||||
|
||||
connect(target, &Target::deploymentDataChanged,
|
||||
this, &DesktopRunConfiguration::updateTargetInformation);
|
||||
connect(target, &Target::applicationTargetsChanged,
|
||||
this, &DesktopRunConfiguration::updateTargetInformation);
|
||||
// Handles device changes, etc.
|
||||
connect(target, &Target::kitChanged,
|
||||
this, &DesktopRunConfiguration::updateTargetInformation);
|
||||
@@ -95,7 +89,7 @@ DesktopRunConfiguration::DesktopRunConfiguration(Target *target, Core::Id id, Ki
|
||||
|
||||
}
|
||||
|
||||
connect(target, &Target::parsingFinished,
|
||||
connect(target, &Target::buildSystemUpdated,
|
||||
this, &DesktopRunConfiguration::updateTargetInformation);
|
||||
}
|
||||
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "appoutputpane.h"
|
||||
#include "buildsteplist.h"
|
||||
#include "buildsystem.h"
|
||||
#include "compileoutputwindow.h"
|
||||
#include "configtaskhandler.h"
|
||||
#include "customexecutablerunconfiguration.h"
|
||||
@@ -653,6 +654,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
|
||||
dd = new ProjectExplorerPluginPrivate;
|
||||
|
||||
qRegisterMetaType<ProjectExplorer::BuildSystem *>();
|
||||
qRegisterMetaType<ProjectExplorer::RunControl *>();
|
||||
qRegisterMetaType<ProjectExplorer::DeployableFile>("ProjectExplorer::DeployableFile");
|
||||
|
||||
|
@@ -124,8 +124,10 @@ signals:
|
||||
void overlayIconChanged();
|
||||
|
||||
void kitChanged();
|
||||
|
||||
void parsingStarted();
|
||||
void parsingFinished(bool);
|
||||
void buildSystemUpdated(ProjectExplorer::BuildSystem *bs);
|
||||
|
||||
// TODO clean up signal names
|
||||
// might be better to also have aboutToRemove signals
|
||||
@@ -143,8 +145,6 @@ signals:
|
||||
void activeDeployConfigurationChanged(ProjectExplorer::DeployConfiguration *dc);
|
||||
|
||||
void deploymentDataChanged();
|
||||
void applicationTargetsChanged();
|
||||
void targetPropertiesChanged();
|
||||
|
||||
private:
|
||||
bool fromMap(const QVariantMap &map);
|
||||
|
@@ -227,6 +227,8 @@ void PythonBuildSystem::triggerParsing()
|
||||
setApplicationTargets(appTargets);
|
||||
|
||||
guard.markAsSuccess();
|
||||
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
bool PythonBuildSystem::saveRawFileList(const QStringList &rawFileList)
|
||||
|
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <languageclient/languageclientmanager.h>
|
||||
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/localenvironmentaspect.h>
|
||||
#include <projectexplorer/projectconfigurationaspects.h>
|
||||
#include <projectexplorer/runconfigurationaspects.h>
|
||||
@@ -277,9 +278,7 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Core::Id id)
|
||||
return cmd;
|
||||
});
|
||||
|
||||
connect(target, &Target::applicationTargetsChanged,
|
||||
this, &PythonRunConfiguration::updateTargetInformation);
|
||||
connect(target, &Target::parsingFinished,
|
||||
connect(target, &Target::buildSystemUpdated,
|
||||
this, &PythonRunConfiguration::updateTargetInformation);
|
||||
}
|
||||
|
||||
|
@@ -620,6 +620,7 @@ void QbsBuildSystem::updateAfterParse()
|
||||
updateQmlJsCodeModel();
|
||||
emit project()->fileListChanged();
|
||||
m_envCache.clear();
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
void QbsBuildSystem::delayedUpdateAfterParse()
|
||||
@@ -688,6 +689,11 @@ void QbsBuildSystem::handleQbsParsingDone(bool success)
|
||||
updateCppCodeModel();
|
||||
m_guard.markAsSuccess();
|
||||
m_guard = {};
|
||||
|
||||
// This one used to change the executable path of a Qbs desktop run configuration
|
||||
// in case the "install" check box in the build step is unchecked and then build
|
||||
// is triggered (which is otherwise a no-op).
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
void QbsBuildSystem::rebuildProjectTree()
|
||||
@@ -800,6 +806,7 @@ void QbsBuildSystem::updateAfterBuild()
|
||||
DeploymentData deploymentDataTmp = deploymentData();
|
||||
deploymentDataTmp.setLocalInstallRoot(installRoot());
|
||||
setDeploymentData(deploymentDataTmp);
|
||||
emitBuildSystemUpdated();
|
||||
return;
|
||||
}
|
||||
qCDebug(qbsPmLog) << "Updating data after build";
|
||||
@@ -1274,6 +1281,9 @@ void QbsBuildSystem::updateBuildTargetData()
|
||||
OpTimer optimer("updateBuildTargetData");
|
||||
updateApplicationTargets();
|
||||
updateDeploymentInfo();
|
||||
|
||||
// This one used after a normal build.
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -512,6 +512,8 @@ void QmakeBuildSystem::decrementPendingEvaluateFutures()
|
||||
target()->updateDefaultDeployConfigurations();
|
||||
m_guard.markAsSuccess(); // Qmake always returns (some) data, even when it failed:-)
|
||||
m_guard = {}; // This triggers emitParsingFinished by destroying the previous guard.
|
||||
|
||||
emitBuildSystemUpdated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "qnxconstants.h"
|
||||
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/deployablefile.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/runcontrol.h>
|
||||
@@ -80,9 +81,7 @@ QnxRunConfiguration::QnxRunConfiguration(Target *target, Core::Id id)
|
||||
emit enabledChanged();
|
||||
};
|
||||
|
||||
connect(target, &Target::deploymentDataChanged, this, updateTargetInformation);
|
||||
connect(target, &Target::applicationTargetsChanged, this, updateTargetInformation);
|
||||
connect(target, &Target::parsingFinished, this, updateTargetInformation);
|
||||
connect(target, &Target::buildSystemUpdated, this, updateTargetInformation);
|
||||
connect(target, &Target::kitChanged, this, updateTargetInformation);
|
||||
}
|
||||
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "remotelinuxx11forwardingaspect.h"
|
||||
#include "remotelinuxenvironmentaspect.h"
|
||||
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
#include <projectexplorer/buildtargetinfo.h>
|
||||
#include <projectexplorer/deploymentdata.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
@@ -68,11 +69,7 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Core::I
|
||||
if (HostOsInfo::isAnyUnixHost())
|
||||
addAspect<X11ForwardingAspect>();
|
||||
|
||||
connect(target, &Target::deploymentDataChanged,
|
||||
this, &RemoteLinuxRunConfiguration::updateTargetInformation);
|
||||
connect(target, &Target::applicationTargetsChanged,
|
||||
this, &RemoteLinuxRunConfiguration::updateTargetInformation);
|
||||
connect(target, &Target::parsingFinished,
|
||||
connect(target, &Target::buildSystemUpdated,
|
||||
this, &RemoteLinuxRunConfiguration::updateTargetInformation);
|
||||
connect(target, &Target::kitChanged,
|
||||
this, &RemoteLinuxRunConfiguration::updateTargetInformation);
|
||||
|
Reference in New Issue
Block a user