summaryrefslogtreecommitdiff
path: root/share/qbs/imports/qbs/DarwinTools
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2014-08-20 23:49:50 -0400
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-08-21 15:16:38 +0200
commit4768f662851ae907ec847397405ea930231f4e2c (patch)
tree55fc04ae38ed0b16a22640bd255c39f1dc9dfe4c /share/qbs/imports/qbs/DarwinTools
parent92ce7c3a2a0c47c983514c235c93b4428bef1cec (diff)
downloadqbs-4768f662851ae907ec847397405ea930231f4e2c.tar.gz
Clean empty values from Info.plist before serializing.
Follows Xcode behavior, and prevents potential build failures due to slight behavior change in a following commit. Change-Id: Id0afa15c4493e460faa029fd914a19d9c3140d84 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'share/qbs/imports/qbs/DarwinTools')
-rw-r--r--share/qbs/imports/qbs/DarwinTools/darwin-tools.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/share/qbs/imports/qbs/DarwinTools/darwin-tools.js b/share/qbs/imports/qbs/DarwinTools/darwin-tools.js
index 56a727399..59ea8f87f 100644
--- a/share/qbs/imports/qbs/DarwinTools/darwin-tools.js
+++ b/share/qbs/imports/qbs/DarwinTools/darwin-tools.js
@@ -133,3 +133,18 @@ function expandPlistEnvironmentVariables(obj, env, warn) {
expandRecursive(obj, env, []);
return obj;
}
+
+/**
+ * Recursively removes any undefined, null, or empty string values from the property list.
+ */
+function cleanPropertyList(plist) {
+ if (typeof(plist) !== "object")
+ return;
+
+ for (var key in plist) {
+ if (plist[key] === undefined || plist[key] === null || plist[key] === "")
+ delete plist[key];
+ else
+ cleanPropertyList(plist[key]);
+ }
+}