summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-10-02 16:03:25 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2019-10-04 14:05:04 +0000
commitad11bb7383bf730ca0241af24a8b4179af157c7f (patch)
tree8042111cbcf446eb2f824f73f86a3b8d394dd11e
parent7822a01904d60a883cc089175d1ca5400663040c (diff)
Darwin: Adapt to Xcode 11
- xcspec files can now refer to variables in variable names, as in the following line: CONTENTS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH_SHALLOW_BUNDLE_$ (SHALLOW_BUNDLE)) - Some new environment variables have been introduced and need to be set when running our probes; e.g. "SWIFT_PLATFORM_TARGET_PREFIX". - The symbolLinkMode autotest made an invalid assumption about order of output. Change-Id: Ic845c2c4a8eafb4ece0f0bb04e6e492681a02979 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--share/qbs/imports/qbs/DarwinTools/darwin-tools.js31
-rw-r--r--share/qbs/modules/bundle/BundleModule.qbs6
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp3
3 files changed, 21 insertions, 19 deletions
diff --git a/share/qbs/imports/qbs/DarwinTools/darwin-tools.js b/share/qbs/imports/qbs/DarwinTools/darwin-tools.js
index 889720fcd..5f9076004 100644
--- a/share/qbs/imports/qbs/DarwinTools/darwin-tools.js
+++ b/share/qbs/imports/qbs/DarwinTools/darwin-tools.js
@@ -162,17 +162,17 @@ var PropertyListVariableExpander = (function () {
* Finds the first index of a replacement starting with one of the supported syntaxes
* This is needed so we don't do recursive substitutions
*/
- function indexOfReplacementStart(syntaxes, str, offset) {
+ function indexOfReplacementStart(syntaxes, str) {
var syntax;
- var idx = str.length;
+ var idx = -1;
for (var i in syntaxes) {
- var j = str.indexOf(syntaxes[i].open, offset);
- if (j !== -1 && j < idx) {
+ var j = str.lastIndexOf(syntaxes[i].open);
+ if (j > idx) {
syntax = syntaxes[i];
idx = j;
}
}
- return { "syntax": syntax, "index": idx === str.length ? -1 : idx };
+ return { "syntax": syntax, "index": idx };
}
function expandRecursive(obj, env, checked) {
@@ -202,19 +202,16 @@ var PropertyListVariableExpander = (function () {
// skip replacement
if ($this.undefinedVariableFunction)
$this.undefinedVariableFunction(key, varName);
- i = j + repl.syntax.close.length;
- } else {
- changes = true;
- varValue = String(varValue);
- if (varFormatter !== undefined)
- varFormatter = varFormatter.toLowerCase();
- if (varFormatter === "rfc1034identifier")
- varValue = Utilities.rfc1034Identifier(varValue);
- value = value.slice(0, i) + varValue + value.slice(j + repl.syntax.close.length);
- // avoid recursive substitutions to avoid potentially infinite loops
- i += varValue.length;
+ varValue = "";
}
- repl = indexOfReplacementStart(syntaxes, value, i);
+ varValue = String(varValue);
+ if (varFormatter !== undefined)
+ varFormatter = varFormatter.toLowerCase();
+ if (varFormatter === "rfc1034identifier")
+ varValue = Utilities.rfc1034Identifier(varValue);
+ value = value.slice(0, i) + varValue + value.slice(j + repl.syntax.close.length);
+ changes = true;
+ repl = indexOfReplacementStart(syntaxes, value);
i = repl.index;
}
if (changes)
diff --git a/share/qbs/modules/bundle/BundleModule.qbs b/share/qbs/modules/bundle/BundleModule.qbs
index f1845fe30..1e83dc458 100644
--- a/share/qbs/modules/bundle/BundleModule.qbs
+++ b/share/qbs/modules/bundle/BundleModule.qbs
@@ -63,9 +63,13 @@ Module {
"GENERATE_PKGINFO_FILE": generatePackageInfo !== undefined
? (generatePackageInfo ? "YES" : "NO")
: undefined,
+ "IS_MACCATALYST": "NO",
+ "LD_RUNPATH_SEARCH_PATHS_NO": [],
"PRODUCT_NAME": product.targetName,
"LOCAL_APPS_DIR": Environment.getEnv("HOME") + "/Applications",
"LOCAL_LIBRARY_DIR": Environment.getEnv("HOME") + "/Library",
+ "SWIFT_PLATFORM_TARGET_PREFIX": isMacOs ? "macos"
+ : qbs.targetOS.contains("ios") ? "ios" : "",
"TARGET_BUILD_DIR": product.buildDirectory,
"WRAPPER_NAME": bundleName,
"WRAPPER_EXTENSION": extension
@@ -427,7 +431,7 @@ Module {
|| {};
for (key in partialInfoPlist) {
if (partialInfoPlist.hasOwnProperty(key)
- && !aggregatePlist.hasOwnProperty(key))
+ && aggregatePlist[key] === undefined)
aggregatePlist[key] = partialInfoPlist[key];
}
}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 19676d050..e612e9a3c 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -4262,7 +4262,8 @@ void TestBlackbox::symbolLinkMode()
rmDirR(relativeBuildDir());
params.arguments = QStringList() << commonArgs << "project.lazy:true";
QCOMPARE(runQbs(params), 0);
- QVERIFY2(m_qbsStdout.contains("meow\nLib was loaded!\n"), m_qbsStdout.constData());
+ QVERIFY2(m_qbsStdout.contains("meow\n") && m_qbsStdout.contains("Lib was loaded!\n"),
+ m_qbsStdout.constData());
}
}