aboutsummaryrefslogtreecommitdiffstats
path: root/share/qbs/modules/bundle
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2023-02-17 17:03:21 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2023-02-20 09:03:31 +0000
commit9937e3b3548fd3d6caf573723ecacd2ad925f1a1 (patch)
treed55beea56ce29d893f70f72234568b7a1afa6dae /share/qbs/modules/bundle
parentd8523b5b2568a14fc9dc5fb4de09895c6ca02a01 (diff)
Prefer built-in JS function in modules
contains -> includes Change-Id: Id893c2ea0659d9bded4f5cec1a3160ccd802118b Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share/qbs/modules/bundle')
-rw-r--r--share/qbs/modules/bundle/BundleModule.qbs30
-rw-r--r--share/qbs/modules/bundle/bundle.js2
2 files changed, 16 insertions, 16 deletions
diff --git a/share/qbs/modules/bundle/BundleModule.qbs b/share/qbs/modules/bundle/BundleModule.qbs
index d43be5116..0d8452a7e 100644
--- a/share/qbs/modules/bundle/BundleModule.qbs
+++ b/share/qbs/modules/bundle/BundleModule.qbs
@@ -47,13 +47,13 @@ Module {
Probe {
id: bundleSettingsProbe
- condition: qbs.targetOS.contains("darwin")
+ condition: qbs.targetOS.includes("darwin")
property string xcodeDeveloperPath: xcode.developerPath
property var xcodeArchSettings: xcode._architectureSettings
property string productTypeIdentifier: _productTypeIdentifier
property bool useXcodeBuildSpecs: !useBuiltinXcodeBuildSpecs
- property bool isMacOs: qbs.targetOS.contains("macos")
+ property bool isMacOs: qbs.targetOS.includes("macos")
property bool xcodePresent: xcode.present
property string xcodeVersion: xcode.version
@@ -74,9 +74,9 @@ Module {
"LOCAL_LIBRARY_DIR": Environment.getEnv("HOME") + "/Library",
// actually, this is cpp.targetAbi, but XCode does not set it for non-simulator builds
// while Qbs set it to "macho".
- "LLVM_TARGET_TRIPLE_SUFFIX": qbs.targetOS.contains("simulator") ? "-simulator" : "",
+ "LLVM_TARGET_TRIPLE_SUFFIX": qbs.targetOS.includes("simulator") ? "-simulator" : "",
"SWIFT_PLATFORM_TARGET_PREFIX": isMacOs ? "macos"
- : qbs.targetOS.contains("ios") ? "ios" : "",
+ : qbs.targetOS.includes("ios") ? "ios" : "",
"TARGET_BUILD_DIR": product.buildDirectory,
"WRAPPER_NAME": bundleName,
"WRAPPER_EXTENSION": extension
@@ -118,7 +118,7 @@ Module {
additionalProductTypes: !(product.multiplexed || product.aggregate)
|| !product.multiplexConfigurationId ? ["bundle.content"] : []
- property bool isBundle: !product.consoleApplication && qbs.targetOS.contains("darwin")
+ property bool isBundle: !product.consoleApplication && qbs.targetOS.includes("darwin")
readonly property bool isShallow: bundleSettingsProbe.xcodeSettings["SHALLOW_BUNDLE"] === "YES"
@@ -152,7 +152,7 @@ Module {
property var infoPlist
property bool processInfoPlist: true
property bool embedInfoPlist: product.consoleApplication && !isBundle
- property string infoPlistFormat: qbs.targetOS.contains("macos") ? "same-as-input" : "binary1"
+ property string infoPlistFormat: qbs.targetOS.includes("macos") ? "same-as-input" : "binary1"
property string localizedResourcesFolderSuffix: ".lproj"
@@ -227,7 +227,7 @@ Module {
}
validate: {
- if (!qbs.targetOS.contains("darwin"))
+ if (!qbs.targetOS.includes("darwin"))
return;
if (!bundleSettingsProbe.found) {
var error = "Bundle product type " + _productTypeIdentifier + " is not supported.";
@@ -273,7 +273,7 @@ Module {
}
Rule {
- condition: qbs.targetOS.contains("darwin")
+ condition: qbs.targetOS.includes("darwin")
multiplex: true
requiresInputs: false // TODO: The resources property should probably be a tag instead.
inputs: ["infoplist", "partial_infoplist"]
@@ -455,7 +455,7 @@ Module {
infoPlistFormat = "xml1";
var validFormats = [ "xml1", "binary1", "json" ];
- if (!validFormats.contains(infoPlistFormat))
+ if (!validFormats.includes(infoPlistFormat))
throw("Invalid Info.plist format " + infoPlistFormat + ". " +
"Must be in [xml1, binary1, json].");
@@ -473,7 +473,7 @@ Module {
}
Rule {
- condition: qbs.targetOS.contains("darwin")
+ condition: qbs.targetOS.includes("darwin")
multiplex: true
inputs: ["aggregate_infoplist"]
@@ -514,7 +514,7 @@ Module {
}
Rule {
- condition: qbs.targetOS.contains("darwin")
+ condition: qbs.targetOS.includes("darwin")
multiplex: true
inputs: ["bundle.input",
"aggregate_infoplist", "pkginfo", "hpp",
@@ -540,7 +540,7 @@ Module {
var fp = inputs["bundle.input"][i].moduleProperty("bundle", "_bundleFilePath");
if (!fp)
throw("Artifact " + inputs["bundle.input"][i].filePath + " has no associated bundle file path");
- var extraTags = inputs["bundle.input"][i].fileTags.contains("application")
+ var extraTags = inputs["bundle.input"][i].fileTags.includes("application")
? ["bundle.application-executable"] : [];
artifacts.push({
filePath: fp,
@@ -621,7 +621,7 @@ Module {
for (var i = 0; i < artifacts.length; ++i)
artifacts[i].bundle = { wrapperPath: wrapperPath };
- if (Host.os().contains("darwin") && product.codesign
+ if (Host.os().includes("darwin") && product.codesign
&& product.codesign.enableCodeSigning) {
artifacts.push({
filePath: FileInfo.joinPaths(product.bundle.contentsFolderPath, "_CodeSignature/CodeResources"),
@@ -772,12 +772,12 @@ Module {
if (cmd.sources && cmd.sources.length)
commands.push(cmd);
- if (product.moduleProperty("qbs", "hostOS").contains("darwin")) {
+ if (product.moduleProperty("qbs", "hostOS").includes("darwin")) {
Array.prototype.push.apply(commands, Codesign.prepareSign(
project, product, inputs, outputs, input, output));
if (bundleType === "application"
- && product.moduleProperty("qbs", "targetOS").contains("macos")) {
+ && product.moduleProperty("qbs", "targetOS").includes("macos")) {
var bundlePath = FileInfo.joinPaths(
product.destinationDirectory, product.bundle.bundleName);
cmd = new Command(ModUtils.moduleProperty(product, "lsregisterPath"),
diff --git a/share/qbs/modules/bundle/bundle.js b/share/qbs/modules/bundle/bundle.js
index 7fb89974a..ec0e30054 100644
--- a/share/qbs/modules/bundle/bundle.js
+++ b/share/qbs/modules/bundle/bundle.js
@@ -83,7 +83,7 @@ var _productTypeIdentifiers = {
function productTypeIdentifier(productType) {
for (var k in _productTypeIdentifiers) {
- if (productType.contains(k))
+ if (productType.includes(k))
return _productTypeIdentifiers[k];
}
return "com.apple.package-type.wrapper";