forked from qt-creator/qt-creator
Qbs: Add convenience methods to retrieve qbs information to QbsProject
... and use them. Change-Id: Ic8e3fdaffa2bc41ccbbc39baa4ef07edb5d9241d Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -175,7 +175,7 @@ void QbsProject::invalidate()
|
|||||||
|
|
||||||
qbs::BuildJob *QbsProject::build(const qbs::BuildOptions &opts)
|
qbs::BuildJob *QbsProject::build(const qbs::BuildOptions &opts)
|
||||||
{
|
{
|
||||||
if (!m_rootProjectNode || !m_rootProjectNode->project())
|
if (!qbsProject())
|
||||||
return 0;
|
return 0;
|
||||||
if (!activeTarget() || !activeTarget()->kit())
|
if (!activeTarget() || !activeTarget()->kit())
|
||||||
return 0;
|
return 0;
|
||||||
@@ -185,14 +185,14 @@ qbs::BuildJob *QbsProject::build(const qbs::BuildOptions &opts)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
QProcessEnvironment env = bc->environment().toProcessEnvironment();
|
QProcessEnvironment env = bc->environment().toProcessEnvironment();
|
||||||
return m_rootProjectNode->project()->buildAllProducts(opts, env);
|
return qbsProject()->buildAllProducts(opts, env);
|
||||||
}
|
}
|
||||||
|
|
||||||
qbs::CleanJob *QbsProject::clean(const qbs::CleanOptions &opts)
|
qbs::CleanJob *QbsProject::clean(const qbs::CleanOptions &opts)
|
||||||
{
|
{
|
||||||
if (!m_rootProjectNode || !m_rootProjectNode->project())
|
if (!qbsProject())
|
||||||
return 0;
|
return 0;
|
||||||
return m_rootProjectNode->project()->cleanAllProducts(opts);
|
return qbsProject()->cleanAllProducts(opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QbsProject::profileForTarget(const ProjectExplorer::Target *t) const
|
QString QbsProject::profileForTarget(const ProjectExplorer::Target *t) const
|
||||||
@@ -207,7 +207,7 @@ bool QbsProject::isParsing() const
|
|||||||
|
|
||||||
bool QbsProject::hasParseResult() const
|
bool QbsProject::hasParseResult() const
|
||||||
{
|
{
|
||||||
return m_rootProjectNode->project();
|
return qbsProject();
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName QbsProject::defaultBuildDirectory() const
|
Utils::FileName QbsProject::defaultBuildDirectory() const
|
||||||
@@ -217,6 +217,20 @@ Utils::FileName QbsProject::defaultBuildDirectory() const
|
|||||||
return Utils::FileName::fromString(buildDir);
|
return Utils::FileName::fromString(buildDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const qbs::Project *QbsProject::qbsProject() const
|
||||||
|
{
|
||||||
|
if (!m_rootProjectNode)
|
||||||
|
return 0;
|
||||||
|
return m_rootProjectNode->project();
|
||||||
|
}
|
||||||
|
|
||||||
|
const qbs::ProjectData *QbsProject::qbsProjectData() const
|
||||||
|
{
|
||||||
|
if (!m_rootProjectNode)
|
||||||
|
return 0;
|
||||||
|
return m_rootProjectNode->projectData();
|
||||||
|
}
|
||||||
|
|
||||||
void QbsProject::handleQbsParsingDone(bool success)
|
void QbsProject::handleQbsParsingDone(bool success)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_qbsSetupProjectJob, return);
|
QTC_ASSERT(m_qbsSetupProjectJob, return);
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ public:
|
|||||||
|
|
||||||
Utils::FileName defaultBuildDirectory() const;
|
Utils::FileName defaultBuildDirectory() const;
|
||||||
|
|
||||||
|
const qbs::Project *qbsProject() const;
|
||||||
|
const qbs::ProjectData *qbsProjectData() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void invalidate();
|
void invalidate();
|
||||||
void parseCurrentBuildConfiguration();
|
void parseCurrentBuildConfiguration();
|
||||||
|
|||||||
Reference in New Issue
Block a user