aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2018-01-31 08:10:25 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2018-01-31 13:50:32 +0000
commit3953e11a8491323bed6d45d3ced59f15b87a96a8 (patch)
tree41472c61fdc9da3ddf3d62410f908198fb696091
parent1474042d931922b81d3a09e95c738e7feafa1a44 (diff)
Fix parameter extraction for Depends items within Export/Module items
Parameters of Depends items within Export items were ignored. Project { Product { name: "foo" Export { Depends { name: "dep"; cpp.link: false } // dep } } Product { name: "bar" Depends { name: "foo" } } } The instance of foo in bar has an Depends child depinst. The item depinst was created by createChildInstances and is an empty item with the prototype dep, which is the Depends item in foo's Export item. Thus, extractParameters must look up properties in the deepest prototype (dep), not in the Depends item itself (depinst). Unfortunately, this fix triggers SOFT ASSERT: varValue in ../../../../1.10/src/lib/corelib/language/evaluatorscriptclass.cpp:574 which will be fixed separately. Task-number: QBS-1287 Change-Id: I56b5464aad2578bb5ddab2e831fc607d6634ac8d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--changelogs/changes-1.10.1.md1
-rw-r--r--src/lib/corelib/language/moduleloader.cpp3
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp3
3 files changed, 5 insertions, 2 deletions
diff --git a/changelogs/changes-1.10.1.md b/changelogs/changes-1.10.1.md
index d3be09e65..d0f68a898 100644
--- a/changelogs/changes-1.10.1.md
+++ b/changelogs/changes-1.10.1.md
@@ -8,3 +8,4 @@
* Fix access to module instances in dependency parameters (QBS-1253).
* Fix race condition when creating Inno Setup, NSIS, or WiX installers.
* Fix release builds for Android with NDK r12 and above (QBS-1256).
+* Fix parametrized dependencies in Export and Module items (QBS-1287).
diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp
index 1feac1be1..f2dae2cf9 100644
--- a/src/lib/corelib/language/moduleloader.cpp
+++ b/src/lib/corelib/language/moduleloader.cpp
@@ -2274,7 +2274,8 @@ static QVariantMap safeToVariant(const QScriptValue &v)
QVariantMap ModuleLoader::extractParameters(Item *dependsItem) const
{
QVariantMap result;
- const Item::PropertyMap &itemProperties = filterItemProperties(dependsItem->properties());
+ const Item::PropertyMap &itemProperties = filterItemProperties(
+ rootPrototype(dependsItem)->properties());
if (itemProperties.isEmpty())
return result;
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index fdccf7467..c952f2bff 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -2371,13 +2371,14 @@ void TestBlackbox::pluginDependency()
QVERIFY(m_qbsStdout.contains("plugin3"));
QVERIFY(m_qbsStdout.contains("plugin4"));
QVERIFY(m_qbsStdout.contains("helper2"));
+ QEXPECT_FAIL("", "FIXME", Continue);
+ QVERIFY(!m_qbsStderr.contains("SOFT ASSERT"));
// Build the app. Plugins 1 and 2 must not be linked. Plugin 3 must be linked.
QCOMPARE(runQbs(QStringList{"--command-echo-mode", "command-line"}), 0);
QByteArray output = m_qbsStdout + '\n' + m_qbsStderr;
QVERIFY(!output.contains("plugin1"));
QVERIFY(!output.contains("plugin2"));
- QEXPECT_FAIL("", "QBS-1287", Continue);
QVERIFY(!output.contains("helper2"));
// Check that the build dependency still works.