forked from qt-creator/qt-creator
ProjectExplorer: Add a BuildConfiguration::regenerateBuildFiles
That's effectively a generic hook for "re-run qmake" without the qmake/QmakeProjectManager dependency. Change-Id: I236d40690cde9047831422b2651ed2284b220959 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -271,6 +271,12 @@ QString BuildConfiguration::disabledReason() const
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BuildConfiguration::regenerateBuildFiles(Node *node)
|
||||||
|
{
|
||||||
|
Q_UNUSED(node);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QString BuildConfiguration::buildTypeName(BuildConfiguration::BuildType type)
|
QString BuildConfiguration::buildTypeName(BuildConfiguration::BuildType type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ namespace ProjectExplorer {
|
|||||||
class BuildInfo;
|
class BuildInfo;
|
||||||
class NamedWidget;
|
class NamedWidget;
|
||||||
class BuildStepList;
|
class BuildStepList;
|
||||||
|
class Node;
|
||||||
class Kit;
|
class Kit;
|
||||||
class Target;
|
class Target;
|
||||||
class IOutputParser;
|
class IOutputParser;
|
||||||
@@ -79,6 +80,8 @@ public:
|
|||||||
virtual bool isEnabled() const;
|
virtual bool isEnabled() const;
|
||||||
virtual QString disabledReason() const;
|
virtual QString disabledReason() const;
|
||||||
|
|
||||||
|
virtual bool regenerateBuildFiles(Node *node);
|
||||||
|
|
||||||
enum BuildType {
|
enum BuildType {
|
||||||
Unknown,
|
Unknown,
|
||||||
Debug,
|
Debug,
|
||||||
|
|||||||
@@ -31,9 +31,7 @@
|
|||||||
#include <android/androidmanager.h>
|
#include <android/androidmanager.h>
|
||||||
#include <android/androidpackageinstallationstep.h>
|
#include <android/androidpackageinstallationstep.h>
|
||||||
|
|
||||||
#include <projectexplorer/buildmanager.h>
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
@@ -43,7 +41,6 @@
|
|||||||
|
|
||||||
using namespace Android;
|
using namespace Android;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace QmakeProjectManager;
|
|
||||||
|
|
||||||
namespace QmakeAndroidSupport {
|
namespace QmakeAndroidSupport {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -93,15 +90,7 @@ void AndroidQmakeBuildConfiguration::manifestSaved()
|
|||||||
|
|
||||||
updateCacheAndEmitEnvironmentChanged();
|
updateCacheAndEmitEnvironmentChanged();
|
||||||
|
|
||||||
QMakeStep *qs = qmakeStep();
|
regenerateBuildFiles();
|
||||||
if (!qs)
|
|
||||||
return;
|
|
||||||
|
|
||||||
qs->setForced(true);
|
|
||||||
|
|
||||||
BuildManager::buildList(stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
|
|
||||||
BuildManager::appendStep(qs, ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
|
|
||||||
setSubNodeBuild(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -38,20 +38,23 @@
|
|||||||
#include <coreplugin/documentmanager.h>
|
#include <coreplugin/documentmanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <projectexplorer/buildmanager.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/kit.h>
|
#include <projectexplorer/kit.h>
|
||||||
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/projectmacroexpander.h>
|
#include <projectexplorer/projectmacroexpander.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <projectexplorer/toolchainmanager.h>
|
#include <projectexplorer/toolchainmanager.h>
|
||||||
|
|
||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtversionmanager.h>
|
#include <qtsupport/qtversionmanager.h>
|
||||||
|
|
||||||
#include <utils/mimetypes/mimedatabase.h>
|
#include <utils/mimetypes/mimedatabase.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <android/androidmanager.h>
|
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
@@ -696,4 +699,24 @@ bool QmakeBuildConfiguration::LastKitState::operator !=(const LastKitState &othe
|
|||||||
return !operator ==(other);
|
return !operator ==(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QmakeBuildConfiguration::regenerateBuildFiles(Node *node)
|
||||||
|
{
|
||||||
|
QMakeStep *qs = qmakeStep();
|
||||||
|
if (!qs)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
qs->setForced(true);
|
||||||
|
|
||||||
|
BuildManager::buildList(stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
|
||||||
|
BuildManager::appendStep(qs, ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
|
||||||
|
|
||||||
|
QmakeProFileNode *proFile = nullptr;
|
||||||
|
if (node && node != target()->project()->rootProjectNode())
|
||||||
|
proFile = dynamic_cast<QmakeProFileNode *>(node);
|
||||||
|
|
||||||
|
setSubNodeBuild(proFile);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace QmakeProjectManager
|
} // namespace QmakeProjectManager
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool fromMap(const QVariantMap &map) override;
|
bool fromMap(const QVariantMap &map) override;
|
||||||
|
bool regenerateBuildFiles(ProjectExplorer::Node *node = nullptr) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void kitChanged();
|
void kitChanged();
|
||||||
|
|||||||
Reference in New Issue
Block a user