forked from qt-creator/qt-creator
ProjectExplorer: Provide the option to build only the app to be run
... instead of the entire project. This can speed up the development cycle by ignoring irrelevant changes in the project, potentially at the cost of missing parts that actually should be re-built (in particular with build systems where a product does not have full knowledge of its dependencies). Supported by qmake and qbs for now. Change-Id: Ic7101aa243e92ba139798d13366d256c1919dcc3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -191,6 +191,17 @@ bool QbsBuildConfiguration::fromMap(const QVariantMap &map)
|
||||
return true;
|
||||
}
|
||||
|
||||
void QbsBuildConfiguration::restrictNextBuild(const RunConfiguration *rc)
|
||||
{
|
||||
if (!rc) {
|
||||
setProducts({});
|
||||
return;
|
||||
}
|
||||
const auto productNode = dynamic_cast<QbsProductNode *>(rc->productNode());
|
||||
QTC_ASSERT(productNode, return);
|
||||
setProducts({productNode->fullDisplayName()});
|
||||
}
|
||||
|
||||
QbsBuildStep *QbsBuildConfiguration::qbsStep() const
|
||||
{
|
||||
return stepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD)->firstOfType<QbsBuildStep>();
|
||||
|
||||
@@ -86,6 +86,7 @@ signals:
|
||||
|
||||
private:
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
void restrictNextBuild(const ProjectExplorer::RunConfiguration *rc) override;
|
||||
void triggerReparseIfActive();
|
||||
|
||||
QStringList m_changedFiles;
|
||||
|
||||
@@ -135,11 +135,16 @@ QStringList QbsProductNode::targetApplications() const
|
||||
return QStringList{m_productData.value("target-executable").toString()};
|
||||
}
|
||||
|
||||
QString QbsProductNode::buildKey() const
|
||||
QString QbsProductNode::fullDisplayName() const
|
||||
{
|
||||
return m_productData.value("full-display-name").toString();
|
||||
}
|
||||
|
||||
QString QbsProductNode::buildKey() const
|
||||
{
|
||||
return fullDisplayName();
|
||||
}
|
||||
|
||||
QVariant QbsProductNode::data(Core::Id role) const
|
||||
{
|
||||
if (role == Android::Constants::AndroidDeploySettingsFile) {
|
||||
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
void build() override;
|
||||
QStringList targetApplications() const override;
|
||||
|
||||
QString fullDisplayName() const;
|
||||
QString buildKey() const override;
|
||||
|
||||
const QJsonObject productData() const { return m_productData; }
|
||||
|
||||
Reference in New Issue
Block a user