diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-04-13 17:21:23 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-04-16 08:24:22 +0000 |
commit | 16066422cbf5a5e3ff8f259afb73fc8713731d86 (patch) | |
tree | f5a1c979e9eacf35a46e6b06b222934ba6c1a328 /share/qbs/modules/bundle/BundleModule.qbs | |
parent | 68c40f931d392c880c3009c58364063e094dde17 (diff) |
Don't make a copy of the inputs properties in BundleModule.qbs
The input artifacts can have a lot inherited module properties, which
would cause any copy operation to take a very long time as well as
exhaust memory.
Instead directly use the inputs variable.
Change-Id: I829b0f9296bde125fa36e750a503c499e9912c78
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'share/qbs/modules/bundle/BundleModule.qbs')
-rw-r--r-- | share/qbs/modules/bundle/BundleModule.qbs | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/share/qbs/modules/bundle/BundleModule.qbs b/share/qbs/modules/bundle/BundleModule.qbs index 8dcbff19f..fbec31d5b 100644 --- a/share/qbs/modules/bundle/BundleModule.qbs +++ b/share/qbs/modules/bundle/BundleModule.qbs @@ -289,8 +289,6 @@ Module { var cmd = new JavaScriptCommand(); cmd.description = "generating Info.plist for " + product.name; cmd.highlight = "codegen"; - cmd.infoPlistFiles = inputs.infoplist; - cmd.partialInfoPlistFiles = inputs.partial_infoplist; cmd.infoPlist = ModUtils.moduleProperty(product, "infoPlist") || {}; cmd.processInfoPlist = ModUtils.moduleProperty(product, "processInfoPlist"); cmd.infoPlistFormat = ModUtils.moduleProperty(product, "infoPlistFormat"); @@ -312,12 +310,15 @@ 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 = {}; - for (i in infoPlistFiles) { - aggregatePlist = BundleTools.infoPlistContents(infoPlistFiles[i].filePath); - infoPlistFormat = (infoPlistFormat === "same-as-input") - ? BundleTools.infoPlistFormat(infoPlistFiles[i].filePath) - : "xml1"; - break; + 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; + } } // Add local key-value pairs (overrides equivalent keys specified in the file if @@ -406,8 +407,10 @@ Module { + varName + "' when expanding value for key '" + key + "', defined in one of the following files:\n\t"; var allFilePaths = []; - for (i in infoPlistFiles) - allFilePaths.push(infoPlistFiles[i].filePath); + if (typeof inputs.infoplist !== 'undefined') { + 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"; @@ -418,8 +421,10 @@ Module { aggregatePlist = expander.expand(aggregatePlist, env); // Add keys from partial Info.plists from asset catalogs, XIBs, and storyboards - for (i in partialInfoPlistFiles) { - var partialInfoPlist = BundleTools.infoPlistContents(partialInfoPlistFiles[i].filePath) || {}; + for (var j = 0; j < inputs.partial_infoplist.length; ++j) { + var partialInfoPlist = + BundleTools.infoPlistContents(inputs.partial_infoplist[j].filePath) + || {}; for (key in partialInfoPlist) { if (partialInfoPlist.hasOwnProperty(key)) aggregatePlist[key] = partialInfoPlist[key]; |