diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-04-16 14:32:32 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-04-16 13:28:54 +0000 |
commit | 1f2a475ee367cb7ee905b2e04ff99465a3527f9b (patch) | |
tree | 67cb6a1e4bab8589fb100b62dc764c0420fb6226 /share/qbs/modules/bundle/BundleModule.qbs | |
parent | 16066422cbf5a5e3ff8f259afb73fc8713731d86 (diff) |
Check that inputs.partial_infoplists is not empty
Also change the style of checking for the rest of the inputs.
Amends regression introduced by
74e518ef6f6b89dd783ec8ffc8cf1d0c713cf14a .
Change-Id: Iddd9b4f1d1688f09e10add41a55e4b4ae6ca7bbc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qbs/modules/bundle/BundleModule.qbs')
-rw-r--r-- | share/qbs/modules/bundle/BundleModule.qbs | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/share/qbs/modules/bundle/BundleModule.qbs b/share/qbs/modules/bundle/BundleModule.qbs index fbec31d5b..7752ee65e 100644 --- a/share/qbs/modules/bundle/BundleModule.qbs +++ b/share/qbs/modules/bundle/BundleModule.qbs @@ -310,15 +310,14 @@ Module { // Contains the combination of default, file, and in-source keys and values // Start out with the contents of this file as the "base", if given var aggregatePlist = {}; - if (typeof inputs.infoplist !== 'undefined') { - for (i = 0; i < inputs.infoplist.length; ++i) { - aggregatePlist = - BundleTools.infoPlistContents(inputs.infoplist[i].filePath); - infoPlistFormat = (infoPlistFormat === "same-as-input") - ? BundleTools.infoPlistFormat(inputs.infoplist[i].filePath) - : "xml1"; - break; - } + + for (i = 0; i < (inputs.infoplist || []).length; ++i) { + aggregatePlist = + BundleTools.infoPlistContents(inputs.infoplist[i].filePath); + infoPlistFormat = (infoPlistFormat === "same-as-input") + ? BundleTools.infoPlistFormat(inputs.infoplist[i].filePath) + : "xml1"; + break; } // Add local key-value pairs (overrides equivalent keys specified in the file if @@ -407,10 +406,10 @@ Module { + varName + "' when expanding value for key '" + key + "', defined in one of the following files:\n\t"; var allFilePaths = []; - if (typeof inputs.infoplist !== 'undefined') { - for (i = 0; i < inputs.infoplist.length; ++i) - allFilePaths.push(inputs.infoplist[i].filePath); - } + + for (i = 0; i < (inputs.infoplist || []).length; ++i) + allFilePaths.push(inputs.infoplist[i].filePath); + if (platformInfoPlist) allFilePaths.push(platformInfoPlist); msg += allFilePaths.join("\n\t") + "\n"; @@ -420,16 +419,18 @@ Module { }; aggregatePlist = expander.expand(aggregatePlist, env); - // Add keys from partial Info.plists from asset catalogs, XIBs, and storyboards - for (var j = 0; j < inputs.partial_infoplist.length; ++j) { + // Add keys from partial Info.plists from asset catalogs, XIBs, and storyboards. + for (var j = 0; j < (inputs.partial_infoplist || []).length; ++j) { var partialInfoPlist = - BundleTools.infoPlistContents(inputs.partial_infoplist[j].filePath) + BundleTools.infoPlistContents( + inputs.partial_infoplist[j].filePath) || {}; for (key in partialInfoPlist) { if (partialInfoPlist.hasOwnProperty(key)) aggregatePlist[key] = partialInfoPlist[key]; } } + } // Anything with an undefined or otherwise empty value should be removed |