summaryrefslogtreecommitdiff
path: root/qbs-resources
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-05-30 18:05:24 -0700
committerJake Petroules <jake.petroules@qt.io>2017-05-31 14:27:00 +0000
commit822fc32fb844c7e3f324ffbd4b119536c9f4e02e (patch)
treedc3f25ba06e6ba73a0f0a66bd5b0530701c32263 /qbs-resources
parentce4ffe10905b4baf539c1b40d841ffe6964f8eca (diff)
downloadqbs-822fc32fb844c7e3f324ffbd4b119536c9f4e02e.tar.gz
Replace QbsFunctions.versionIsAtLeast with Utilities.versionCompare
This more general function was introduced in Qbs 1.6.0, which happens to be the self-hosted build's minimum Qbs version requirement. Change-Id: I3b9c2cf7c1cf7c30a966df9011959d89cac05950 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'qbs-resources')
-rw-r--r--qbs-resources/imports/QbsFunctions/functions.js17
-rw-r--r--qbs-resources/imports/QbsProduct.qbs4
2 files changed, 2 insertions, 19 deletions
diff --git a/qbs-resources/imports/QbsFunctions/functions.js b/qbs-resources/imports/QbsFunctions/functions.js
index fd7c3bbd5..b4f6706f7 100644
--- a/qbs-resources/imports/QbsFunctions/functions.js
+++ b/qbs-resources/imports/QbsFunctions/functions.js
@@ -1,18 +1 @@
function qbsVersion() { return "1.9.0"; }
-
-function versionIsAtLeast(actualVersion, expectedVersion)
-{
- var actualVersionParts = actualVersion.split('.').map(function(item) {
- return parseInt(item, 10);
- });
- var expectedVersionParts = expectedVersion.split('.').map(function(item) {
- return parseInt(item, 10);
- });
- for (var i = 0; i < expectedVersionParts.length; ++i) {
- if (actualVersionParts[i] > expectedVersionParts[i])
- return true;
- if (actualVersionParts[i] < expectedVersionParts[i])
- return false;
- }
- return i === expectedVersionParts.length || expectedVersionParts[i] === 0;
-}
diff --git a/qbs-resources/imports/QbsProduct.qbs b/qbs-resources/imports/QbsProduct.qbs
index fae3336b3..5fb0bed1e 100644
--- a/qbs-resources/imports/QbsProduct.qbs
+++ b/qbs-resources/imports/QbsProduct.qbs
@@ -1,5 +1,5 @@
import qbs
-import QbsFunctions
+import qbs.Utilities
Product {
Depends { name: "qbsbuildconfig" }
@@ -15,5 +15,5 @@ Product {
return res;
}
cpp.enableExceptions: true
- condition: QbsFunctions.versionIsAtLeast(Qt.core.version, minimumQtVersion)
+ condition: Utilities.versionCompare(Qt.core.version, minimumQtVersion) >= 0
}