aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2016-11-08 14:19:22 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2016-11-08 15:28:45 +0000
commit9596e734b3f251a8ab3b74910ba0614fffe72f8f (patch)
tree3b179039d379f2c950d5323435ad976623b5dbe7
parent80a69c09062f462f65dfd07c32bd72920f250daa (diff)
Allow JavaScript expressions when overriding properties
I mistakenly believed that already worked, but we had only implemented it for qbs-config. Change-Id: Ifb8bfabf2e4f5d6bfa2accb8a120a35c3c863936 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/app/qbs/parser/commandlineparser.cpp4
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp6
-rw-r--r--tests/auto/blackbox/tst_blackboxjava.cpp2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/app/qbs/parser/commandlineparser.cpp b/src/app/qbs/parser/commandlineparser.cpp
index 3505d5fad..6448d04a3 100644
--- a/src/app/qbs/parser/commandlineparser.cpp
+++ b/src/app/qbs/parser/commandlineparser.cpp
@@ -55,6 +55,7 @@
#include <tools/installoptions.h>
#include <tools/preferences.h>
#include <tools/settings.h>
+#include <tools/settingsmodel.h>
#include <QCoreApplication>
#include <QDir>
@@ -312,7 +313,8 @@ QList<QVariantMap> CommandLineParser::buildConfigurations() const
qbsWarning() << Tr::tr("Refusing to overwrite special property '%1'.")
.arg(configurationNameKey);
} else {
- currentProperties.insert(property, arg.mid(sepPos + 1));
+ const QString rawString = arg.mid(sepPos + 1);
+ currentProperties.insert(property, representationToSettingsValue(rawString));
}
}
propertiesPerConfiguration << qMakePair(currentConfigurationName, currentProperties);
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 1deccb3a6..6e4a78f7b 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -773,9 +773,9 @@ void TestBlackbox::versionCheck()
QFETCH(QString, errorMessage);
QbsRunParameters params;
params.expectFailure = !errorMessage.isEmpty();
- params.arguments << "-n" << ("versioncheck.requestedMinVersion:" + requestedMinVersion)
- << ("versioncheck.requestedMaxVersion:" + requestedMaxVersion)
- << ("lower.version:" + actualVersion);
+ params.arguments << "-n" << ("versioncheck.requestedMinVersion:'" + requestedMinVersion + "'")
+ << ("versioncheck.requestedMaxVersion:'" + requestedMaxVersion + "'")
+ << ("lower.version:'" + actualVersion + "'");
QCOMPARE(runQbs(params) == 0, errorMessage.isEmpty());
if (params.expectFailure)
QVERIFY2(QString(m_qbsStderr).contains(errorMessage), m_qbsStderr.constData());
diff --git a/tests/auto/blackbox/tst_blackboxjava.cpp b/tests/auto/blackbox/tst_blackboxjava.cpp
index 4bba50bf7..ba00de997 100644
--- a/tests/auto/blackbox/tst_blackboxjava.cpp
+++ b/tests/auto/blackbox/tst_blackboxjava.cpp
@@ -255,7 +255,7 @@ void TestBlackboxJava::javaDependencyTracking()
if (!jdkPath.isEmpty())
rp.arguments << ("java.jdkPath:" + jdkPath);
if (!javaVersion.isEmpty())
- rp.arguments << ("java.languageVersion:" + javaVersion);
+ rp.arguments << ("java.languageVersion:'" + javaVersion + "'");
rmDirR(relativeBuildDir());
QCOMPARE(runQbs(rp), 0);
};