forked from qt-creator/qt-creator
let "build file" only run one build step
For example, C++ source files will be compiled but the build stops before linking. Task-number: QBS-283 Change-Id: If0573ea58b9a047980aab0fd8e4828f3d0c315b8 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -193,6 +193,16 @@ QStringList QbsBuildConfiguration::changedFiles() const
|
|||||||
return m_changedFiles;
|
return m_changedFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QbsBuildConfiguration::setActiveFileTags(const QStringList &fileTags)
|
||||||
|
{
|
||||||
|
m_activeFileTags = fileTags;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList QbsBuildConfiguration::activeFileTags() const
|
||||||
|
{
|
||||||
|
return m_activeFileTags;
|
||||||
|
}
|
||||||
|
|
||||||
void QbsBuildConfiguration::setProducts(const QStringList &products)
|
void QbsBuildConfiguration::setProducts(const QStringList &products)
|
||||||
{
|
{
|
||||||
m_products = products;
|
m_products = products;
|
||||||
|
@@ -73,6 +73,9 @@ public:
|
|||||||
void setChangedFiles(const QStringList &files);
|
void setChangedFiles(const QStringList &files);
|
||||||
QStringList changedFiles() const;
|
QStringList changedFiles() const;
|
||||||
|
|
||||||
|
void setActiveFileTags(const QStringList &fileTags);
|
||||||
|
QStringList activeFileTags() const;
|
||||||
|
|
||||||
void setProducts(const QStringList &products);
|
void setProducts(const QStringList &products);
|
||||||
QStringList products() const;
|
QStringList products() const;
|
||||||
|
|
||||||
@@ -99,6 +102,7 @@ private:
|
|||||||
bool m_parsingError;
|
bool m_parsingError;
|
||||||
Utils::FileName m_buildDirectory;
|
Utils::FileName m_buildDirectory;
|
||||||
QStringList m_changedFiles;
|
QStringList m_changedFiles;
|
||||||
|
QStringList m_activeFileTags;
|
||||||
QStringList m_products;
|
QStringList m_products;
|
||||||
|
|
||||||
friend class QbsBuildConfigurationFactory;
|
friend class QbsBuildConfigurationFactory;
|
||||||
|
@@ -107,6 +107,7 @@ bool QbsBuildStep::init()
|
|||||||
m_parser->appendOutputParser(parser);
|
m_parser->appendOutputParser(parser);
|
||||||
|
|
||||||
m_changedFiles = bc->changedFiles();
|
m_changedFiles = bc->changedFiles();
|
||||||
|
m_activeFileTags = bc->activeFileTags();
|
||||||
m_products = bc->products();
|
m_products = bc->products();
|
||||||
|
|
||||||
connect(m_parser, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)),
|
connect(m_parser, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)),
|
||||||
@@ -124,6 +125,7 @@ void QbsBuildStep::run(QFutureInterface<bool> &fi)
|
|||||||
QbsProject *pro = static_cast<QbsProject *>(project());
|
QbsProject *pro = static_cast<QbsProject *>(project());
|
||||||
qbs::BuildOptions options(m_qbsBuildOptions);
|
qbs::BuildOptions options(m_qbsBuildOptions);
|
||||||
options.setChangedFiles(m_changedFiles);
|
options.setChangedFiles(m_changedFiles);
|
||||||
|
options.setActiveFileTags(m_activeFileTags);
|
||||||
|
|
||||||
m_job = pro->build(options, m_products);
|
m_job = pro->build(options, m_products);
|
||||||
|
|
||||||
|
@@ -100,6 +100,7 @@ private:
|
|||||||
|
|
||||||
// Temporary data:
|
// Temporary data:
|
||||||
QStringList m_changedFiles;
|
QStringList m_changedFiles;
|
||||||
|
QStringList m_activeFileTags;
|
||||||
QStringList m_products;
|
QStringList m_products;
|
||||||
|
|
||||||
QFutureInterface<bool> *m_fi;
|
QFutureInterface<bool> *m_fi;
|
||||||
|
@@ -301,7 +301,7 @@ void QbsProjectManagerPlugin::buildFileContextMenu()
|
|||||||
QTC_ASSERT(m_currentNode, return);
|
QTC_ASSERT(m_currentNode, return);
|
||||||
QTC_ASSERT(m_currentProject, return);
|
QTC_ASSERT(m_currentProject, return);
|
||||||
|
|
||||||
buildFiles(m_currentProject, QStringList(m_currentNode->path()));
|
buildSingleFile(m_currentProject, m_currentNode->path());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsProjectManagerPlugin::buildFile()
|
void QbsProjectManagerPlugin::buildFile()
|
||||||
@@ -316,7 +316,7 @@ void QbsProjectManagerPlugin::buildFile()
|
|||||||
if (!project || file.isEmpty())
|
if (!project || file.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
buildFiles(project, QStringList(file));
|
buildSingleFile(project, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsProjectManagerPlugin::buildProductContextMenu()
|
void QbsProjectManagerPlugin::buildProductContextMenu()
|
||||||
@@ -345,7 +345,8 @@ void QbsProjectManagerPlugin::buildProduct()
|
|||||||
buildProducts(project, QStringList(product->displayName()));
|
buildProducts(project, QStringList(product->displayName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList &files)
|
void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList &files,
|
||||||
|
const QStringList &activeFileTags)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(project, return);
|
QTC_ASSERT(project, return);
|
||||||
QTC_ASSERT(!files.isEmpty(), return);
|
QTC_ASSERT(!files.isEmpty(), return);
|
||||||
@@ -362,6 +363,7 @@ void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
bc->setChangedFiles(files);
|
bc->setChangedFiles(files);
|
||||||
|
bc->setActiveFileTags(activeFileTags);
|
||||||
bc->setProducts(QStringList());
|
bc->setProducts(QStringList());
|
||||||
|
|
||||||
const Core::Id buildStep = Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
const Core::Id buildStep = Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||||
@@ -372,6 +374,12 @@ void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList
|
|||||||
bc->setChangedFiles(QStringList());
|
bc->setChangedFiles(QStringList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QbsProjectManagerPlugin::buildSingleFile(QbsProject *project, const QString &file)
|
||||||
|
{
|
||||||
|
buildFiles(project, QStringList(file), QStringList()
|
||||||
|
<< QLatin1String("obj") << QLatin1String("hpp"));
|
||||||
|
}
|
||||||
|
|
||||||
void QbsProjectManagerPlugin::buildProducts(QbsProject *project, const QStringList &products)
|
void QbsProjectManagerPlugin::buildProducts(QbsProject *project, const QStringList &products)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(project, return);
|
QTC_ASSERT(project, return);
|
||||||
|
@@ -80,7 +80,9 @@ private slots:
|
|||||||
void reparseCurrentProject();
|
void reparseCurrentProject();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void buildFiles(QbsProject *project, const QStringList &files);
|
void buildFiles(QbsProject *project, const QStringList &files,
|
||||||
|
const QStringList &activeFileTags);
|
||||||
|
void buildSingleFile(QbsProject *project, const QString &file);
|
||||||
void buildProducts(QbsProject *project, const QStringList &products);
|
void buildProducts(QbsProject *project, const QStringList &products);
|
||||||
|
|
||||||
QbsManager *m_manager;
|
QbsManager *m_manager;
|
||||||
|
Reference in New Issue
Block a user