diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2014-08-20 23:49:50 -0400 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-08-21 15:16:38 +0200 |
commit | 4768f662851ae907ec847397405ea930231f4e2c (patch) | |
tree | 55fc04ae38ed0b16a22640bd255c39f1dc9dfe4c /share/qbs/imports/qbs/DarwinTools | |
parent | 92ce7c3a2a0c47c983514c235c93b4428bef1cec (diff) | |
download | qbs-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.js | 15 |
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]); + } +} |