forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.14'
Change-Id: Ie52e046f8e280e8c39f0cc5e9e710b4f885010a6
This commit is contained in:
@@ -151,6 +151,33 @@ QString QbsProductNode::getBuildKey(const QJsonObject &product)
|
||||
+ product.value("multiplex-configuration-id").toString();
|
||||
}
|
||||
|
||||
bool QbsProductNode::isAggregated() const
|
||||
{
|
||||
return m_productData.value("is-multiplexed").toBool()
|
||||
&& m_productData.value("multiplex-configuration-id").toString().isEmpty();
|
||||
}
|
||||
|
||||
const QList<const QbsProductNode*> QbsProductNode::aggregatedProducts() const
|
||||
{
|
||||
if (!isAggregated())
|
||||
return {};
|
||||
const ProjectNode *parentNode = managingProject();
|
||||
QTC_ASSERT(parentNode != nullptr && parentNode != this, return {});
|
||||
|
||||
QSet<QString> dependencies;
|
||||
for (const auto &a : m_productData.value("dependencies").toArray())
|
||||
dependencies << a.toString();
|
||||
|
||||
QList<const QbsProductNode*> qbsProducts;
|
||||
parentNode->forEachProjectNode([&qbsProducts, dependencies](const ProjectNode *node) {
|
||||
if (const auto qbsChildNode = dynamic_cast<const QbsProductNode *>(node)) {
|
||||
if (dependencies.contains(qbsChildNode->fullDisplayName()))
|
||||
qbsProducts << qbsChildNode;
|
||||
}
|
||||
});
|
||||
return qbsProducts;
|
||||
}
|
||||
|
||||
QVariant QbsProductNode::data(Id role) const
|
||||
{
|
||||
if (role == Android::Constants::AndroidDeploySettingsFile) {
|
||||
@@ -164,10 +191,16 @@ QVariant QbsProductNode::data(Id role) const
|
||||
|
||||
if (role == Android::Constants::AndroidSoLibPath) {
|
||||
QStringList ret{m_productData.value("build-directory").toString()};
|
||||
forAllArtifacts(m_productData, ArtifactType::Generated, [&ret](const QJsonObject &artifact) {
|
||||
if (artifact.value("file-tags").toArray().contains("dynamiclibrary"))
|
||||
ret << QFileInfo(artifact.value("file-path").toString()).path();
|
||||
});
|
||||
if (!isAggregated()) {
|
||||
forAllArtifacts(m_productData, ArtifactType::Generated,
|
||||
[&ret](const QJsonObject &artifact) {
|
||||
if (artifact.value("file-tags").toArray().contains("dynamiclibrary"))
|
||||
ret << QFileInfo(artifact.value("file-path").toString()).path();
|
||||
});
|
||||
} else {
|
||||
for (const auto &a : aggregatedProducts())
|
||||
ret += a->data(Android::Constants::AndroidSoLibPath).toStringList();
|
||||
}
|
||||
ret.removeDuplicates();
|
||||
return ret;
|
||||
}
|
||||
@@ -188,6 +221,28 @@ QVariant QbsProductNode::data(Id role) const
|
||||
return m_productData.value("module-properties").toObject()
|
||||
.value("Qt.core.enableKeywords").toBool();
|
||||
|
||||
if (role == Android::Constants::ANDROID_ABIS) {
|
||||
// Try using qbs.architectures
|
||||
QStringList qbsAbis;
|
||||
QMap<QString, QString> archToAbi {
|
||||
{"armv7a", ProjectExplorer::Constants::ANDROID_ABI_ARMEABI_V7A},
|
||||
{"arm64", ProjectExplorer::Constants::ANDROID_ABI_ARM64_V8A},
|
||||
{"x86", ProjectExplorer::Constants::ANDROID_ABI_X86},
|
||||
{"x86_64", ProjectExplorer::Constants::ANDROID_ABI_X86_64}};
|
||||
for (const auto &a : m_productData.value("module-properties").toObject()
|
||||
.value(Constants::QBS_ARCHITECTURES).toArray()) {
|
||||
if (archToAbi.contains(a.toString()))
|
||||
qbsAbis << archToAbi[a.toString()];
|
||||
}
|
||||
if (!qbsAbis.empty())
|
||||
return qbsAbis;
|
||||
// Try using qbs.architecture
|
||||
QString architecture = m_productData.value("module-properties").toObject()
|
||||
.value(Constants::QBS_ARCHITECTURE).toString();
|
||||
if (archToAbi.contains(architecture))
|
||||
qbsAbis << archToAbi[architecture];
|
||||
return qbsAbis;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,9 @@ public:
|
||||
|
||||
static QString getBuildKey(const QJsonObject &product);
|
||||
|
||||
bool isAggregated() const;
|
||||
const QList<const QbsProductNode*> aggregatedProducts() const;
|
||||
|
||||
const QJsonObject productData() const { return m_productData; }
|
||||
QJsonObject mainGroup() const;
|
||||
QVariant data(Utils::Id role) const override;
|
||||
|
||||
@@ -376,6 +376,8 @@ RunEnvironmentResult QbsSession::getRunEnvironment(
|
||||
void QbsSession::insertRequestedModuleProperties(QJsonObject &request)
|
||||
{
|
||||
request.insert("module-properties", QJsonArray::fromStringList({
|
||||
"qbs.architecture",
|
||||
"qbs.architectures",
|
||||
"cpp.commonCompilerFlags",
|
||||
"cpp.compilerVersionMajor",
|
||||
"cpp.compilerVersionMinor",
|
||||
|
||||
Reference in New Issue
Block a user