summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Cotty <raphael.cotty@gmail.com>2022-01-28 11:46:05 +0100
committerraphaelcotty <raphaelcotty@codereview.qt-project.org>2022-01-31 22:26:39 +0000
commitaa2094761aec16001ac0d19bf85483fdc2c78611 (patch)
treee2fcc1a97d4ba0ce6a2d57069d700da8c7ef74ec
parentf726d465ff6365846e5a78f61e2cedd6e9ff6609 (diff)
downloadqbs-aa2094761aec16001ac0d19bf85483fdc2c78611.tar.gz
Use Host and FileInfo service
Replace all the possible use of the qbs module that can be replaced by the Host and FileInfo services. Change-Id: I0d6f820bb2577eacd9081ec2df1eb53adf94d50e Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r--examples/capnproto/calculator_cpp/calculator_cpp.qbs6
-rw-r--r--examples/protobuf/addressbook_cpp/addressbook_cpp.qbs4
-rw-r--r--share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs14
-rw-r--r--share/qbs/imports/qbs/Probes/AndroidSdkProbe.qbs7
-rw-r--r--share/qbs/imports/qbs/Probes/BinaryProbe.qbs6
-rw-r--r--share/qbs/imports/qbs/Probes/ClBinaryProbe.qbs2
-rw-r--r--share/qbs/imports/qbs/Probes/ClangClBinaryProbe.qbs2
-rw-r--r--share/qbs/imports/qbs/Probes/ClangClProbe.qbs7
-rw-r--r--share/qbs/imports/qbs/Probes/ConanfileProbe.qbs3
-rw-r--r--share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs6
-rw-r--r--share/qbs/imports/qbs/Probes/GccProbe.qbs11
-rw-r--r--share/qbs/imports/qbs/Probes/GccVersionProbe.qbs4
-rw-r--r--share/qbs/imports/qbs/Probes/IarProbe.qbs2
-rw-r--r--share/qbs/imports/qbs/Probes/JdkProbe.qbs7
-rw-r--r--share/qbs/imports/qbs/Probes/KeilProbe.qbs7
-rw-r--r--share/qbs/imports/qbs/Probes/NodeJsProbe.qbs3
-rw-r--r--share/qbs/imports/qbs/Probes/NpmProbe.qbs9
-rw-r--r--share/qbs/imports/qbs/Probes/PathProbe.qbs7
-rw-r--r--share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs4
-rw-r--r--share/qbs/imports/qbs/Probes/TypeScriptProbe.qbs8
-rw-r--r--share/qbs/imports/qbs/Probes/path-probe.js6
-rw-r--r--share/qbs/module-providers/Qt/setup-qt.js7
-rw-r--r--share/qbs/module-providers/Qt/templates/qml.qbs3
-rw-r--r--share/qbs/module-providers/Qt/templates/qmlcache.qbs3
-rw-r--r--share/qbs/module-providers/qbspkgconfig.qbs7
-rw-r--r--share/qbs/modules/archiver/archiver.qbs3
-rw-r--r--share/qbs/modules/bundle/BundleModule.qbs3
-rw-r--r--share/qbs/modules/cli/CLIModule.qbs5
-rw-r--r--share/qbs/modules/cli/mono.qbs5
-rw-r--r--share/qbs/modules/codesign/android.qbs3
-rw-r--r--share/qbs/modules/codesign/apple.qbs3
-rw-r--r--share/qbs/modules/codesign/signtool.qbs5
-rw-r--r--share/qbs/modules/cpp/CppModule.qbs3
-rw-r--r--share/qbs/modules/cpp/GenericGCC.qbs3
-rw-r--r--share/qbs/modules/cpp/LinuxGCC.qbs3
-rw-r--r--share/qbs/modules/cpp/dmc.qbs3
-rw-r--r--share/qbs/modules/cpp/freebsd-gcc.qbs3
-rw-r--r--share/qbs/modules/cpp/gcc.js3
-rw-r--r--share/qbs/modules/cpp/ios-gcc.qbs3
-rw-r--r--share/qbs/modules/cpp/keil.qbs3
-rw-r--r--share/qbs/modules/cpp/sdcc.js3
-rw-r--r--share/qbs/modules/cpp/setuprunenv.js9
-rw-r--r--share/qbs/modules/cpp/windows-clang-cl.qbs3
-rw-r--r--share/qbs/modules/cpp/windows-clang-mingw.qbs9
-rw-r--r--share/qbs/modules/cpp/windows-mingw.qbs4
-rw-r--r--share/qbs/modules/cpp/windows-msvc.qbs3
-rw-r--r--share/qbs/modules/dmg/DMGModule.qbs3
-rw-r--r--share/qbs/modules/ib/IBModule.qbs3
-rw-r--r--share/qbs/modules/java/JavaModule.qbs5
-rw-r--r--share/qbs/modules/java/utils.js4
-rw-r--r--share/qbs/modules/nodejs/NodeJS.qbs5
-rw-r--r--share/qbs/modules/nsis/NSISModule.qbs3
-rw-r--r--share/qbs/modules/qnx/qnx.qbs11
-rw-r--r--share/qbs/modules/typescript/TypeScriptModule.qbs3
-rw-r--r--share/qbs/modules/typescript/typescript.js2
-rw-r--r--share/qbs/modules/wix/WiXModule.qbs5
-rw-r--r--share/qbs/modules/xcode/xcode.qbs2
-rw-r--r--tests/auto/api/testdata/explicitly-depends-on/explicitly-depends-on.qbs3
-rw-r--r--tests/auto/api/testdata/infinite-loop-process/infinite-loop.qbs4
-rw-r--r--tests/auto/api/testdata/process-result/process-result.qbs4
-rw-r--r--tests/auto/api/testdata/timeout-process/timeout.qbs6
-rw-r--r--tests/auto/api/testdata/tool-in-module/use-outside-project/modules/thetool/thetool.qbs3
-rw-r--r--tests/auto/api/testdata/tool-in-module/use-within-project/use-within-project.qbs4
-rw-r--r--tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs5
-rw-r--r--tests/auto/blackbox/testdata-java/java/vehicles.qbs3
-rw-r--r--tests/auto/blackbox/testdata-joblimits/job-limits-init/job-limits-init.qbs4
-rw-r--r--tests/auto/blackbox/testdata-qt/auto-qrc/auto-qrc.qbs4
-rw-r--r--tests/auto/blackbox/testdata-qt/forced-moc/forced-moc.qbs3
-rw-r--r--tests/auto/blackbox/testdata-qt/pkgconfig/pkgconfig.qbs3
-rw-r--r--tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs3
-rw-r--r--tests/auto/blackbox/testdata-qt/qrc/i.qbs3
-rw-r--r--tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs9
-rw-r--r--tests/auto/blackbox/testdata-windows/wix/WiXInstallers.qbs3
-rw-r--r--tests/auto/blackbox/testdata/autotest-timeout/autotests-timeout.qbs6
-rw-r--r--tests/auto/blackbox/testdata/autotest-with-dependencies/autotest-with-dependencies.qbs5
-rw-r--r--tests/auto/blackbox/testdata/autotests/autotests.qbs6
-rw-r--r--tests/auto/blackbox/testdata/badInterpreter/badInterpreter.qbs4
-rw-r--r--tests/auto/blackbox/testdata/capnproto/capnproto_absolute_import.qbs4
-rw-r--r--tests/auto/blackbox/testdata/capnproto/capnproto_cpp.qbs4
-rw-r--r--tests/auto/blackbox/testdata/capnproto/capnproto_cpp_pkgconfig.qbs6
-rw-r--r--tests/auto/blackbox/testdata/capnproto/capnproto_relative_import.qbs4
-rw-r--r--tests/auto/blackbox/testdata/capnproto/greeter_cpp.qbs4
-rw-r--r--tests/auto/blackbox/testdata/configure/configure.qbs3
-rw-r--r--tests/auto/blackbox/testdata/dynamic-library-in-module/theapp.qbs4
-rw-r--r--tests/auto/blackbox/testdata/env-merging/env-merging.qbs4
-rw-r--r--tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs3
-rw-r--r--tests/auto/blackbox/testdata/exports-qbs/consumer.qbs4
-rw-r--r--tests/auto/blackbox/testdata/groups-in-modules/groups-in-modules.qbs4
-rw-r--r--tests/auto/blackbox/testdata/grpc/grpc_cpp.qbs4
-rw-r--r--tests/auto/blackbox/testdata/host-os-properties/host-os-properties.qbs8
-rw-r--r--tests/auto/blackbox/testdata/includeLookup/includeLookup.qbs3
-rw-r--r--tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs3
-rw-r--r--tests/auto/blackbox/testdata/jsextensions-process/process.qbs7
-rw-r--r--tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs4
-rw-r--r--tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs4
-rw-r--r--tests/auto/blackbox/testdata/linker-module-definition/linker-module-definition.qbs4
-rw-r--r--tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs4
-rw-r--r--tests/auto/blackbox/testdata/localDeployment/localDeployment.qbs4
-rw-r--r--tests/auto/blackbox/testdata/makefile-generator/app.qbs4
-rw-r--r--tests/auto/blackbox/testdata/minimumSystemVersion/macappstore.qbs4
-rw-r--r--tests/auto/blackbox/testdata/minimumSystemVersion/specific.qbs4
-rw-r--r--tests/auto/blackbox/testdata/minimumSystemVersion/unspecified-forced.qbs4
-rw-r--r--tests/auto/blackbox/testdata/minimumSystemVersion/unspecified.qbs4
-rw-r--r--tests/auto/blackbox/testdata/module-providers/module-providers.qbs4
-rw-r--r--tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs4
-rw-r--r--tests/auto/blackbox/testdata/nodejs/hello.qbs4
-rw-r--r--tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs3
-rw-r--r--tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs4
-rw-r--r--tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs4
-rw-r--r--tests/auto/blackbox/testdata/protobuf-library-install/protobuf-library.qbs4
-rw-r--r--tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs4
-rw-r--r--tests/auto/blackbox/testdata/protobuf/addressbook_nanopb.qbs4
-rw-r--r--tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs4
-rw-r--r--tests/auto/blackbox/testdata/protobuf/create-proto-library.qbs4
-rw-r--r--tests/auto/blackbox/testdata/protobuf/import.qbs4
-rw-r--r--tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs4
-rw-r--r--tests/auto/blackbox/testdata/remove-duplicate-libs/remove-duplicate-libs.qbs3
-rw-r--r--tests/auto/blackbox/testdata/response-files/response-files.qbs3
-rw-r--r--tests/auto/blackbox/testdata/setup-run-environment/setup-run-environment.qbs5
-rw-r--r--tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs3
-rw-r--r--tests/auto/blackbox/testdata/trackAddFile/after/trackAddFile.qbs4
-rw-r--r--tests/auto/blackbox/testdata/trackAddFile/before/trackAddFile.qbs4
-rw-r--r--tests/auto/blackbox/testdata/trackFileTags/after/trackFileTags.qbs4
-rw-r--r--tests/auto/blackbox/testdata/trackFileTags/before/trackFileTags.qbs4
-rw-r--r--tests/auto/blackbox/testdata/vcs/vcstest.qbs4
-rw-r--r--tests/auto/language/testdata/getNativeSetting.qbs6
126 files changed, 357 insertions, 201 deletions
diff --git a/examples/capnproto/calculator_cpp/calculator_cpp.qbs b/examples/capnproto/calculator_cpp/calculator_cpp.qbs
index 862a237c6..a884117b2 100644
--- a/examples/capnproto/calculator_cpp/calculator_cpp.qbs
+++ b/examples/capnproto/calculator_cpp/calculator_cpp.qbs
@@ -1,8 +1,10 @@
+import qbs.Host
+
Project {
CppApplication {
Depends { name: "capnproto.cpp"; required: false }
name: "server"
- condition: capnproto.cpp.present && qbs.targetPlatform === qbs.hostPlatform
+ condition: capnproto.cpp.present && qbs.targetPlatform === Host.platform()
consoleApplication: true
capnproto.cpp.useRpc: true
@@ -14,7 +16,7 @@ Project {
CppApplication {
Depends { name: "capnproto.cpp"; required: false }
name: "client"
- condition: capnproto.cpp.present && qbs.targetPlatform === qbs.hostPlatform
+ condition: capnproto.cpp.present && qbs.targetPlatform === Host.platform()
consoleApplication: true
capnproto.cpp.useRpc: true
diff --git a/examples/protobuf/addressbook_cpp/addressbook_cpp.qbs b/examples/protobuf/addressbook_cpp/addressbook_cpp.qbs
index 51bc386d6..667b30223 100644
--- a/examples/protobuf/addressbook_cpp/addressbook_cpp.qbs
+++ b/examples/protobuf/addressbook_cpp/addressbook_cpp.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
CppApplication {
consoleApplication: true
- condition: protobuf.cpp.present && qbs.targetPlatform === qbs.hostPlatform
+ condition: protobuf.cpp.present && qbs.targetPlatform === Host.platform()
Depends { name: "cpp" }
cpp.cxxLanguageVersion: "c++11"
diff --git a/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs b/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs
index 4a86ee935..e45f24bca 100644
--- a/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs
@@ -32,12 +32,12 @@
import qbs.Environment
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.TextFile
import "../../../modules/Android/android-utils.js" as AndroidUtils
PathProbe {
// Inputs
- property stringList hostOS: qbs.hostOS
property path sdkPath
environmentPaths: Environment.getEnv("ANDROID_NDK_ROOT")
@@ -45,13 +45,13 @@ PathProbe {
var paths = [];
if (sdkPath)
paths.push(FileInfo.joinPaths(sdkPath, "ndk-bundle"));
- if (qbs.hostOS.contains("windows"))
+ if (Host.os().contains("windows"))
paths.push(FileInfo.joinPaths(Environment.getEnv("LOCALAPPDATA"),
"Android", "sdk", "ndk-bundle"));
- if (qbs.hostOS.contains("macos"))
+ if (qHost.os().contains("macos"))
paths.push(FileInfo.joinPaths(Environment.getEnv("HOME"),
"Library", "Android", "sdk", "ndk-bundle"));
- if (qbs.hostOS.contains("linux"))
+ if (Host.os().contains("linux"))
paths.push(FileInfo.joinPaths(Environment.getEnv("HOME"),
"Android", "Sdk", "ndk-bundle"));
return paths;
@@ -83,11 +83,11 @@ PathProbe {
candidatePaths = allPaths;
for (i in allPaths) {
var platforms = [];
- if (hostOS.contains("windows"))
+ if (Host.os().contains("windows"))
platforms.push("windows-x86_64", "windows");
- if (hostOS.contains("darwin"))
+ if (Host.os().contains("darwin"))
platforms.push("darwin-x86_64", "darwin-x86");
- if (hostOS.contains("linux"))
+ if (Host.os().contains("linux"))
platforms.push("linux-x86_64", "linux-x86");
for (j in platforms) {
if (File.exists(FileInfo.joinPaths(allPaths[i], "prebuilt", platforms[j]))) {
diff --git a/share/qbs/imports/qbs/Probes/AndroidSdkProbe.qbs b/share/qbs/imports/qbs/Probes/AndroidSdkProbe.qbs
index 38feecdfa..28375a469 100644
--- a/share/qbs/imports/qbs/Probes/AndroidSdkProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/AndroidSdkProbe.qbs
@@ -31,17 +31,18 @@
import qbs.Environment
import qbs.File
import qbs.FileInfo
+import qbs.Host
import "../../../modules/Android/sdk/utils.js" as SdkUtils
import "../../../modules/Android/android-utils.js" as AndroidUtils
BinaryProbe {
environmentPaths: Environment.getEnv("ANDROID_HOME")
platformSearchPaths: {
- if (qbs.hostOS.contains("windows"))
+ if (Host.os().contains("windows"))
return [FileInfo.joinPaths(Environment.getEnv("LOCALAPPDATA"), "Android", "sdk")];
- if (qbs.hostOS.contains("macos"))
+ if (Host.os().contains("macos"))
return [FileInfo.joinPaths(Environment.getEnv("HOME"), "Library", "Android", "sdk")];
- if (qbs.hostOS.contains("linux"))
+ if (Host.os().contains("linux"))
return [FileInfo.joinPaths(Environment.getEnv("HOME"), "Android", "Sdk")];
}
diff --git a/share/qbs/imports/qbs/Probes/BinaryProbe.qbs b/share/qbs/imports/qbs/Probes/BinaryProbe.qbs
index 0bb264bd6..52b78df03 100644
--- a/share/qbs/imports/qbs/Probes/BinaryProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/BinaryProbe.qbs
@@ -28,8 +28,10 @@
**
****************************************************************************/
+import qbs.Host
+
PathProbe {
- nameSuffixes: qbs.hostOS.contains("windows") ? [".com", ".exe", ".bat", ".cmd"] : undefined
- platformSearchPaths: hostOS.contains("unix") ? ["/usr/bin", "/usr/local/bin"] : []
+ nameSuffixes: Host.os().contains("windows") ? [".com", ".exe", ".bat", ".cmd"] : undefined
+ platformSearchPaths: Host.os().contains("unix") ? ["/usr/bin", "/usr/local/bin"] : []
platformEnvironmentPaths: [ "PATH" ]
}
diff --git a/share/qbs/imports/qbs/Probes/ClBinaryProbe.qbs b/share/qbs/imports/qbs/Probes/ClBinaryProbe.qbs
index b1b77ca36..3b3959017 100644
--- a/share/qbs/imports/qbs/Probes/ClBinaryProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/ClBinaryProbe.qbs
@@ -42,7 +42,7 @@ BinaryProbe {
var results = PathProbeConfigure.configure(_selectors, names, nameSuffixes, nameFilter,
candidateFilter, searchPaths, pathSuffixes,
platformSearchPaths, environmentPaths,
- platformEnvironmentPaths, pathListSeparator);
+ platformEnvironmentPaths);
if (!results.found) {
var msvcs = Utilities.installedMSVCs(preferredArchitecture);
if (msvcs.length >= 1) {
diff --git a/share/qbs/imports/qbs/Probes/ClangClBinaryProbe.qbs b/share/qbs/imports/qbs/Probes/ClangClBinaryProbe.qbs
index 3ead109a0..8dc01d376 100644
--- a/share/qbs/imports/qbs/Probes/ClangClBinaryProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/ClangClBinaryProbe.qbs
@@ -42,7 +42,7 @@ BinaryProbe {
var results = PathProbeConfigure.configure(_selectors, names, nameSuffixes, nameFilter,
candidateFilter, searchPaths, pathSuffixes,
platformSearchPaths, environmentPaths,
- platformEnvironmentPaths, pathListSeparator);
+ platformEnvironmentPaths);
var compilerPath;
if (results.found)
compilerPath = results.files[0].filePath;
diff --git a/share/qbs/imports/qbs/Probes/ClangClProbe.qbs b/share/qbs/imports/qbs/Probes/ClangClProbe.qbs
index 658da8a9f..f0d930be5 100644
--- a/share/qbs/imports/qbs/Probes/ClangClProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/ClangClProbe.qbs
@@ -30,6 +30,7 @@
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.Utilities
import "../../../modules/cpp/gcc.js" as Gcc
@@ -40,8 +41,6 @@ PathProbe {
property string vcvarsallFilePath
property stringList enableDefinesByLanguage
property string preferredArchitecture
- property string _nullDevice: qbs.nullDevice
- property string _pathListSeparator: qbs.pathListSeparator
property string winSdkVersion
// Outputs
@@ -95,8 +94,8 @@ PathProbe {
var clangPath = FileInfo.joinPaths(FileInfo.path(compilerFilePath), "clang.exe");
var defaultPaths = Gcc.dumpDefaultPaths(buildEnv, clangPath,
- [], _nullDevice,
- _pathListSeparator, "", "");
+ [], Host.nullDevice(),
+ FileInfo.pathListSeparator(), "", "");
includePaths = defaultPaths.includePaths;
architecture = ModUtils.guessArchitecture(macros);
}
diff --git a/share/qbs/imports/qbs/Probes/ConanfileProbe.qbs b/share/qbs/imports/qbs/Probes/ConanfileProbe.qbs
index 03dde25e2..32fbcace2 100644
--- a/share/qbs/imports/qbs/Probes/ConanfileProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/ConanfileProbe.qbs
@@ -31,6 +31,7 @@
import qbs.Process
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.TextFile
import qbs.Utilities
@@ -39,7 +40,7 @@ Probe {
property stringList additionalArguments: []
property path conanfilePath
property path packageReference
- property path executable: "conan" + (qbs.hostOS.contains("windows") ? ".exe": "")
+ property path executable: "conan" + (Host.os().contains("windows") ? ".exe": "")
property stringList generators: ["json"]
property var options
property var settings
diff --git a/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs b/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs
index 9081f5efb..0872e6cc0 100644
--- a/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs
@@ -1,5 +1,6 @@
import qbs.Environment
import qbs.FileInfo
+import qbs.Host
import "path-probe.js" as PathProbeConfigure
BinaryProbe {
@@ -13,7 +14,7 @@ BinaryProbe {
platformSearchPaths: {
var paths = base;
- if (qbs.targetOS.contains("windows") && qbs.hostOS.contains("windows"))
+ if (qbs.targetOS.contains("windows") && Host.os().contains("windows"))
paths.push(FileInfo.joinPaths(
Environment.getEnv("SystemDrive"), "MinGW", "bin"));
return paths;
@@ -51,8 +52,7 @@ BinaryProbe {
var selectors;
var results = PathProbeConfigure.configure(
selectors, names, nameSuffixes, nameFilter, candidateFilter, searchPaths,
- pathSuffixes, platformSearchPaths, environmentPaths, platformEnvironmentPaths,
- pathListSeparator);
+ pathSuffixes, platformSearchPaths, environmentPaths, platformEnvironmentPaths);
found = results.found;
if (!found)
diff --git a/share/qbs/imports/qbs/Probes/GccProbe.qbs b/share/qbs/imports/qbs/Probes/GccProbe.qbs
index 9106ff27b..5c6dc1936 100644
--- a/share/qbs/imports/qbs/Probes/GccProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/GccProbe.qbs
@@ -29,6 +29,8 @@
****************************************************************************/
import qbs.File
+import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import "../../../modules/cpp/gcc.js" as Gcc
@@ -39,8 +41,6 @@ PathProbe {
property stringList flags: []
property var environment
- property string _nullDevice: qbs.nullDevice
- property string _pathListSeparator: qbs.pathListSeparator
property string _sysroot: qbs.sysroot
property stringList _targetOS: qbs.targetOS
@@ -63,7 +63,8 @@ PathProbe {
if (fp && File.exists(fp)) {
try {
compilerDefinesByLanguage[languages[i]] = Gcc.dumpMacros(environment, fp,
- flags, _nullDevice,
+ flags,
+ Host.nullDevice(),
languages[i]);
} catch (e) {
// Only throw errors when determining the compiler defines for the C language;
@@ -84,8 +85,8 @@ PathProbe {
|| compilerDefinesByLanguage["objcpp"];
var defaultPaths = Gcc.dumpDefaultPaths(environment, compilerFilePathByLanguage["cpp"] ||
compilerFilePathByLanguage["c"],
- flags, _nullDevice,
- _pathListSeparator, _sysroot, _targetOS);
+ flags, Host.nullDevice(),
+ FileInfo.pathListSeparator(), _sysroot, _targetOS);
found = !!macros && !!defaultPaths;
includePaths = defaultPaths.includePaths;
diff --git a/share/qbs/imports/qbs/Probes/GccVersionProbe.qbs b/share/qbs/imports/qbs/Probes/GccVersionProbe.qbs
index 528719e5b..497835479 100644
--- a/share/qbs/imports/qbs/Probes/GccVersionProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/GccVersionProbe.qbs
@@ -29,6 +29,7 @@
****************************************************************************/
import qbs.File
+import qbs.Host
import "../../../modules/cpp/gcc.js" as Gcc
PathProbe {
@@ -36,7 +37,6 @@ PathProbe {
property string compilerFilePath
property var environment
- property string _nullDevice: qbs.nullDevice
property stringList _toolchain: qbs.toolchain
// Outputs
@@ -50,7 +50,7 @@ PathProbe {
return;
}
- var macros = Gcc.dumpMacros(environment, compilerFilePath, undefined, _nullDevice);
+ var macros = Gcc.dumpMacros(environment, compilerFilePath, undefined, Host.nullDevice());
if (_toolchain.contains("clang")) {
versionMajor = parseInt(macros["__clang_major__"], 10);
diff --git a/share/qbs/imports/qbs/Probes/IarProbe.qbs b/share/qbs/imports/qbs/Probes/IarProbe.qbs
index 3a65c208f..a0008be47 100644
--- a/share/qbs/imports/qbs/Probes/IarProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/IarProbe.qbs
@@ -36,8 +36,6 @@ PathProbe {
property string compilerFilePath
property stringList enableDefinesByLanguage
- property string _nullDevice: qbs.nullDevice
-
// Outputs
property string architecture
property string endianness
diff --git a/share/qbs/imports/qbs/Probes/JdkProbe.qbs b/share/qbs/imports/qbs/Probes/JdkProbe.qbs
index 1f414b0fa..efb5a5336 100644
--- a/share/qbs/imports/qbs/Probes/JdkProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/JdkProbe.qbs
@@ -30,14 +30,14 @@
****************************************************************************/
import qbs.Environment
+import qbs.Host
import "../../../modules/java/utils.js" as JavaUtils
PathProbe {
// Inputs
- property stringList hostOS: qbs.hostOS
property string architecture: !_androidCrossCompiling ? qbs.architecture : undefined
property bool _androidCrossCompiling: qbs.targetOS.contains("android")
- && !qbs.hostOS.contains("android")
+ && !Host.os().contains("android")
environmentPaths: Environment.getEnv("JAVA_HOME")
platformSearchPaths: [
@@ -47,7 +47,8 @@ PathProbe {
]
configure: {
- path = JavaUtils.findJdkPath(hostOS, architecture, environmentPaths, platformSearchPaths);
+ path = JavaUtils.findJdkPath(Host.os(), architecture, environmentPaths,
+ platformSearchPaths);
found = !!path;
}
}
diff --git a/share/qbs/imports/qbs/Probes/KeilProbe.qbs b/share/qbs/imports/qbs/Probes/KeilProbe.qbs
index ba39691fb..b123584ad 100644
--- a/share/qbs/imports/qbs/Probes/KeilProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/KeilProbe.qbs
@@ -29,6 +29,7 @@
****************************************************************************/
import qbs.File
+import qbs.Host
import "../../../modules/cpp/keil.js" as KEIL
PathProbe {
@@ -36,8 +37,6 @@ PathProbe {
property string compilerFilePath
property stringList enableDefinesByLanguage
- property string _nullDevice: qbs.nullDevice
-
// Outputs
property string architecture
property string endianness
@@ -62,7 +61,7 @@ PathProbe {
for (var i = 0; i < languages.length; ++i) {
var tag = languages[i];
compilerDefinesByLanguage[tag] = KEIL.dumpMacros(
- compilerFilePath, tag, _nullDevice);
+ compilerFilePath, tag, Host.nullDevice());
}
var macros = compilerDefinesByLanguage["c"]
@@ -72,7 +71,7 @@ PathProbe {
endianness = KEIL.guessEndianness(macros);
var defaultPaths = KEIL.dumpDefaultPaths(
- compilerFilePath, _nullDevice);
+ compilerFilePath, Host.nullDevice());
includePaths = defaultPaths.includePaths;
diff --git a/share/qbs/imports/qbs/Probes/NodeJsProbe.qbs b/share/qbs/imports/qbs/Probes/NodeJsProbe.qbs
index b0162c715..520e57f56 100644
--- a/share/qbs/imports/qbs/Probes/NodeJsProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/NodeJsProbe.qbs
@@ -30,12 +30,13 @@
import qbs.Environment
import qbs.FileInfo
+import qbs.Host
BinaryProbe {
names: ["node", "nodejs"]
platformSearchPaths: {
var paths = base;
- if (qbs.hostOS.contains("windows")) {
+ if (Host.os().contains("windows")) {
var env32 = Environment.getEnv("PROGRAMFILES(X86)");
var env64 = Environment.getEnv("PROGRAMFILES");
if (env64 === env32 && env64.endsWith(" (x86)"))
diff --git a/share/qbs/imports/qbs/Probes/NpmProbe.qbs b/share/qbs/imports/qbs/Probes/NpmProbe.qbs
index 3ca6a96c2..08490065a 100644
--- a/share/qbs/imports/qbs/Probes/NpmProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/NpmProbe.qbs
@@ -28,6 +28,8 @@
**
****************************************************************************/
+import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import "path-probe.js" as PathProbeConfigure
import "../../../modules/nodejs/nodejs.js" as NodeJs
@@ -50,11 +52,10 @@ NodeJsProbe {
var selectors;
var results = PathProbeConfigure.configure(
selectors, names, nameSuffixes, nameFilter, candidateFilter, searchPaths,
- pathSuffixes, platformSearchPaths, environmentPaths, platformEnvironmentPaths,
- pathListSeparator);
+ pathSuffixes, platformSearchPaths, environmentPaths, platformEnvironmentPaths);
- var v = new ModUtils.EnvironmentVariable("PATH", pathListSeparator,
- hostOS.contains("windows"));
+ var v = new ModUtils.EnvironmentVariable("PATH", FileInfo.pathListSeparator(),
+ Host.os().contains("windows"));
v.prepend(interpreterPath);
var resultsMapper = function(result) {
diff --git a/share/qbs/imports/qbs/Probes/PathProbe.qbs b/share/qbs/imports/qbs/Probes/PathProbe.qbs
index 768defd87..dc3b32ab7 100644
--- a/share/qbs/imports/qbs/Probes/PathProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/PathProbe.qbs
@@ -29,6 +29,7 @@
****************************************************************************/
import "path-probe.js" as PathProbeConfigure
+import qbs.Host
import qbs.ModUtils
Probe {
@@ -40,11 +41,9 @@ Probe {
property varList selectors
property pathList searchPaths
property stringList pathSuffixes
- property pathList platformSearchPaths: hostOS.contains("unix") ? ['/usr', '/usr/local'] : []
+ property pathList platformSearchPaths: Host.os().contains("unix") ? ['/usr', '/usr/local'] : []
property stringList environmentPaths
property stringList platformEnvironmentPaths
- property stringList hostOS: qbs.hostOS
- property string pathListSeparator: qbs.pathListSeparator
// Output
property stringList candidatePaths
@@ -58,7 +57,7 @@ Probe {
var results = PathProbeConfigure.configure(selectors, names, nameSuffixes, nameFilter,
candidateFilter, searchPaths, pathSuffixes,
platformSearchPaths, environmentPaths,
- platformEnvironmentPaths, pathListSeparator);
+ platformEnvironmentPaths);
found = results.found;
allResults = results.files;
diff --git a/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs b/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs
index 2ed772227..61a9c0b74 100644
--- a/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/PkgConfigProbe.qbs
@@ -28,6 +28,7 @@
**
****************************************************************************/
+import qbs.Host
import qbs.Process
import qbs.FileInfo
@@ -42,7 +43,6 @@ Probe {
property string maxVersion
property bool forStaticBuild: false
property stringList libDirs // Full, non-sysrooted paths, mirroring the environment variable
- property string pathListSeparator: qbs.pathListSeparator
// Output
property stringList cflags // Unmodified --cflags output
@@ -73,7 +73,7 @@ Probe {
}
}
if (libDirsToSet)
- p.setEnv("PKG_CONFIG_LIBDIR", libDirsToSet.join(pathListSeparator));
+ p.setEnv("PKG_CONFIG_LIBDIR", libDirsToSet.join(FileInfo.pathListSeparator()));
var versionArgs = [];
if (minVersion !== undefined)
versionArgs.push("--atleast-version=" + minVersion);
diff --git a/share/qbs/imports/qbs/Probes/TypeScriptProbe.qbs b/share/qbs/imports/qbs/Probes/TypeScriptProbe.qbs
index 6a854a2e6..f494d6012 100644
--- a/share/qbs/imports/qbs/Probes/TypeScriptProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/TypeScriptProbe.qbs
@@ -30,6 +30,7 @@
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import "path-probe.js" as PathProbeConfigure
import "../../../modules/typescript/typescript.js" as TypeScript
@@ -60,11 +61,10 @@ BinaryProbe {
var selectors;
var results = PathProbeConfigure.configure(
selectors, names, nameSuffixes, nameFilter, candidateFilter, searchPaths,
- pathSuffixes, platformSearchPaths, environmentPaths, platformEnvironmentPaths,
- pathListSeparator);
+ pathSuffixes, platformSearchPaths, environmentPaths, platformEnvironmentPaths);
- var v = new ModUtils.EnvironmentVariable("PATH", pathListSeparator,
- hostOS.contains("windows"));
+ var v = new ModUtils.EnvironmentVariable("PATH", FileInfo.pathListSeparator(),
+ Host.os().contains("windows"));
v.prepend(interpreterPath);
var resultsMapper = function(result) {
diff --git a/share/qbs/imports/qbs/Probes/path-probe.js b/share/qbs/imports/qbs/Probes/path-probe.js
index 1f55dcf32..1858f5222 100644
--- a/share/qbs/imports/qbs/Probes/path-probe.js
+++ b/share/qbs/imports/qbs/Probes/path-probe.js
@@ -73,7 +73,7 @@ function pathsFromEnvs(envs, pathListSeparator) {
function configure(selectors, names, nameSuffixes, nameFilter, candidateFilter,
searchPaths, pathSuffixes, platformSearchPaths, environmentPaths,
- platformEnvironmentPaths, pathListSeparator) {
+ platformEnvironmentPaths) {
var result = { found: false, files: [] };
if (!selectors && !names)
throw '"names" or "selectors" must be specified';
@@ -102,9 +102,9 @@ function configure(selectors, names, nameSuffixes, nameFilter, candidateFilter,
// FIXME: Suggest how to obtain paths from system
var _paths = ModUtils.concatAll(
- pathsFromEnvs(environmentPaths, pathListSeparator),
+ pathsFromEnvs(environmentPaths, FileInfo.pathListSeparator()),
searchPaths,
- pathsFromEnvs(platformEnvironmentPaths, pathListSeparator),
+ pathsFromEnvs(platformEnvironmentPaths, FileInfo.pathListSeparator()),
platformSearchPaths);
var _suffixes = ModUtils.concatAll('', pathSuffixes);
_paths = _paths.map(function(p) { return FileInfo.fromNativeSeparators(p); });
diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js
index 87a719bf0..6dd42312c 100644
--- a/share/qbs/module-providers/Qt/setup-qt.js
+++ b/share/qbs/module-providers/Qt/setup-qt.js
@@ -40,6 +40,7 @@
var Environment = require("qbs.Environment");
var File = require("qbs.File");
var FileInfo = require("qbs.FileInfo");
+var Host = require("qbs.Host");
var ModUtils = require("qbs.ModUtils");
var Process = require("qbs.Process");
var TextFile = require("qbs.TextFile");
@@ -47,7 +48,7 @@ var Utilities = require("qbs.Utilities");
function splitNonEmpty(s, c) { return s.split(c).filter(function(e) { return e; }); }
function toNative(p) { return FileInfo.toNativeSeparators(p); }
-function exeSuffix(qbs) { return qbs.hostOS.contains("windows") ? ".exe" : ""; }
+function exeSuffix(qbs) { return Host.os().contains("windows") ? ".exe" : ""; }
function getQmakeFilePaths(qmakeFilePaths, qbs) {
if (qmakeFilePaths && qmakeFilePaths.length > 0)
@@ -56,7 +57,7 @@ function getQmakeFilePaths(qmakeFilePaths, qbs) {
var filePaths = [];
var pathValue = Environment.getEnv("PATH");
if (pathValue) {
- var dirs = splitNonEmpty(pathValue, qbs.pathListSeparator);
+ var dirs = splitNonEmpty(pathValue, FileInfo.pathListSeparator());
var suffix = exeSuffix(qbs);
for (var i = 0; i < dirs.length; ++i) {
var candidate = FileInfo.joinPaths(dirs[i], "qmake" + suffix);
@@ -304,7 +305,7 @@ function getQtProperties(qmakeFilePath, qbs) {
if (mkspecsBaseSrcPath && !File.exists(qtProps.mkspecPath))
qtProps.mkspecPath = FileInfo.joinPaths(mkspecsBaseSrcPath, qtProps.mkspecName);
} else {
- if (qbs.hostOS.contains("windows")) {
+ if (Host.os().contains("windows")) {
var baseDirPath = FileInfo.joinPaths(qtProps.mkspecBasePath, "default");
var fileContent = readFileContent(FileInfo.joinPaths(baseDirPath, "qmake.conf"));
qtProps.mkspecPath = configVariable(fileContent, "QMAKESPEC_ORIGINAL");
diff --git a/share/qbs/module-providers/Qt/templates/qml.qbs b/share/qbs/module-providers/Qt/templates/qml.qbs
index 55bf31dee..23cb60426 100644
--- a/share/qbs/module-providers/Qt/templates/qml.qbs
+++ b/share/qbs/module-providers/Qt/templates/qml.qbs
@@ -1,3 +1,4 @@
+import qbs.Host
import qbs.TextFile
import '../QtModule.qbs' as QtModule
import "qml.js" as Qml
@@ -144,7 +145,7 @@ QtModule {
qmlInputs = [];
var scannerData = Qml.scannerData(product.Qt.qml.qmlImportScannerFilePath,
qmlInputs.map(function(inp) { return inp.filePath; }),
- product.Qt.qml.qmlPath, product.qbs.hostOS);
+ product.Qt.qml.qmlPath, Host.os());
var cppFile;
var listFile;
try {
diff --git a/share/qbs/module-providers/Qt/templates/qmlcache.qbs b/share/qbs/module-providers/Qt/templates/qmlcache.qbs
index 38338d106..9a5956884 100644
--- a/share/qbs/module-providers/Qt/templates/qmlcache.qbs
+++ b/share/qbs/module-providers/Qt/templates/qmlcache.qbs
@@ -1,5 +1,6 @@
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.Process
import qbs.Utilities
@@ -10,7 +11,7 @@ Module {
throw "qmlcachegen unsupported for this target";
}
property string qmlCacheGenPath: FileInfo.joinPaths(Qt.core.qmlLibExecPath, "qmlcachegen")
- + (qbs.hostOS.contains("windows") ? ".exe" : "")
+ + (Host.os().contains("windows") ? ".exe" : "")
property bool supportsAllArchitectures: Utilities.versionCompare(Qt.core.version, "5.11") >= 0
property string installDir
diff --git a/share/qbs/module-providers/qbspkgconfig.qbs b/share/qbs/module-providers/qbspkgconfig.qbs
index 0de3be776..7c31060f2 100644
--- a/share/qbs/module-providers/qbspkgconfig.qbs
+++ b/share/qbs/module-providers/qbspkgconfig.qbs
@@ -40,6 +40,7 @@
import qbs.Environment
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.PkgConfig
import qbs.Process
@@ -61,7 +62,7 @@ ModuleProvider {
relativeSearchPaths: {
- function exeSuffix(qbs) { return qbs.hostOS.contains("windows") ? ".exe" : ""; }
+ function exeSuffix(qbs) { return Host.os().contains("windows") ? ".exe" : ""; }
// we need Probes in Providers...
function getPkgConfigExecutable(qbs) {
@@ -70,7 +71,7 @@ ModuleProvider {
var pathValue = Environment.getEnv("PATH");
if (!pathValue)
return undefined;
- var dirs = splitNonEmpty(pathValue, qbs.pathListSeparator);
+ var dirs = splitNonEmpty(pathValue, FileInfo.pathListSeparator());
var suffix = exeSuffix(qbs);
var filePaths = [];
for (var i = 0; i < dirs.length; ++i) {
@@ -165,7 +166,7 @@ ModuleProvider {
var p = new Process()
if (p.exec(executable, ['pkg-config', '--variable=pc_path']) === 0) {
var stdout = p.readStdOut().trim();
- // TODO: qbs.pathListSeparator? depends on what pkg-config prints on Windows
+ // TODO: pathListSeparator? depends on what pkg-config prints on Windows
options.libDirs = stdout ? stdout.split(':'): [];
}
}
diff --git a/share/qbs/modules/archiver/archiver.qbs b/share/qbs/modules/archiver/archiver.qbs
index 71822987a..6da3f43ff 100644
--- a/share/qbs/modules/archiver/archiver.qbs
+++ b/share/qbs/modules/archiver/archiver.qbs
@@ -30,6 +30,7 @@
import qbs.Environment
import qbs.File
+import qbs.Host
import qbs.FileInfo
import qbs.Probes
@@ -53,7 +54,7 @@ Module {
names: ["7z"]
platformSearchPaths: {
var paths = base;
- if (qbs.hostOS.contains("windows")) {
+ if (Host.os().contains("windows")) {
var env32 = Environment.getEnv("PROGRAMFILES(X86)");
var env64 = Environment.getEnv("PROGRAMFILES");
if (env64 === env32 && env64.endsWith(" (x86)"))
diff --git a/share/qbs/modules/bundle/BundleModule.qbs b/share/qbs/modules/bundle/BundleModule.qbs
index e1c3c26cf..6526fa314 100644
--- a/share/qbs/modules/bundle/BundleModule.qbs
+++ b/share/qbs/modules/bundle/BundleModule.qbs
@@ -33,6 +33,7 @@ import qbs.DarwinTools
import qbs.Environment
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.PropertyList
import qbs.TextFile
@@ -618,7 +619,7 @@ Module {
for (var i = 0; i < artifacts.length; ++i)
artifacts[i].bundle = { wrapperPath: wrapperPath };
- if (product.qbs.hostOS.contains("darwin") && product.codesign
+ if (Host.os().contains("darwin") && product.codesign
&& product.codesign.enableCodeSigning) {
artifacts.push({
filePath: FileInfo.joinPaths(product.bundle.contentsFolderPath, "_CodeSignature/CodeResources"),
diff --git a/share/qbs/modules/cli/CLIModule.qbs b/share/qbs/modules/cli/CLIModule.qbs
index cea4c09ca..df58942b5 100644
--- a/share/qbs/modules/cli/CLIModule.qbs
+++ b/share/qbs/modules/cli/CLIModule.qbs
@@ -1,5 +1,6 @@
// base for Common Language Infrastructure modules
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import "cli.js" as CLI
@@ -87,8 +88,8 @@ Module {
}
setupBuildEnvironment: {
- var v = new ModUtils.EnvironmentVariable("PATH", product.qbs.pathListSeparator,
- product.qbs.hostOS.contains("windows"));
+ var v = new ModUtils.EnvironmentVariable("PATH", FileInfo.pathListSeparator(),
+ Host.os().contains("windows"));
v.prepend(product.cli.toolchainInstallPath);
v.set();
}
diff --git a/share/qbs/modules/cli/mono.qbs b/share/qbs/modules/cli/mono.qbs
index f04956a5e..2ed65fd67 100644
--- a/share/qbs/modules/cli/mono.qbs
+++ b/share/qbs/modules/cli/mono.qbs
@@ -1,4 +1,5 @@
import qbs.File
+import qbs.Host
import qbs.Probes
CLIModule {
@@ -14,9 +15,9 @@ CLIModule {
names: ["mono"]
platformSearchPaths: {
var paths = [];
- if (qbs.hostOS.contains("macos"))
+ if (Host.os().contains("macos"))
paths.push("/Library/Frameworks/Mono.framework/Commands");
- if (qbs.hostOS.contains("unix"))
+ if (Host.os().contains("unix"))
paths.push("/usr/bin");
return paths;
}
diff --git a/share/qbs/modules/codesign/android.qbs b/share/qbs/modules/codesign/android.qbs
index f4535aa9c..e149e033c 100644
--- a/share/qbs/modules/codesign/android.qbs
+++ b/share/qbs/modules/codesign/android.qbs
@@ -31,6 +31,7 @@
import qbs.Environment
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.Probes
import "codesign.js" as CodeSign
@@ -54,7 +55,7 @@ CodeSignModule {
property string keytoolName: "keytool"
property string debugKeystorePath: FileInfo.joinPaths(
- Environment.getEnv(qbs.hostOS.contains("windows")
+ Environment.getEnv(Host.os().contains("windows")
? "USERPROFILE" : "HOME"),
".android", "debug.keystore")
readonly property string debugKeystorePassword: "android"
diff --git a/share/qbs/modules/codesign/apple.qbs b/share/qbs/modules/codesign/apple.qbs
index 4340e3037..05232d7c1 100644
--- a/share/qbs/modules/codesign/apple.qbs
+++ b/share/qbs/modules/codesign/apple.qbs
@@ -34,6 +34,7 @@ import qbs.DarwinTools
import qbs.Environment
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.PropertyList
import qbs.Probes
@@ -49,7 +50,7 @@ CodeSignModule {
names: [codesignName]
}
- condition: qbs.hostOS.contains("macos") && qbs.targetOS.contains("darwin")
+ condition: Host.os().contains("macos") && qbs.targetOS.contains("darwin")
priority: 0
enableCodeSigning: _codeSigningRequired
diff --git a/share/qbs/modules/codesign/signtool.qbs b/share/qbs/modules/codesign/signtool.qbs
index 06efa80df..0fc50f1b7 100644
--- a/share/qbs/modules/codesign/signtool.qbs
+++ b/share/qbs/modules/codesign/signtool.qbs
@@ -29,13 +29,14 @@
****************************************************************************/
import qbs.File
+import qbs.Host
import qbs.ModUtils
import qbs.Probes
import "codesign.js" as CODESIGN
CodeSignModule {
condition: qbs.targetOS.contains("windows")
- && qbs.hostOS.contains("windows")
+ && Host.os().contains("windows")
&& qbs.toolchain.contains("msvc")
_canSignArtifacts: true
@@ -43,7 +44,7 @@ CodeSignModule {
Probes.BinaryProbe {
id: signtoolProbe
names: [codesignName]
- searchPaths: CODESIGN.findBestSignToolSearchPaths(qbs.hostArchitecture)
+ searchPaths: CODESIGN.findBestSignToolSearchPaths(Host.architecture())
}
codesignName: "signtool"
diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs
index 0a3050370..038de8617 100644
--- a/share/qbs/modules/cpp/CppModule.qbs
+++ b/share/qbs/modules/cpp/CppModule.qbs
@@ -29,6 +29,7 @@
****************************************************************************/
// base for Cpp modules
+import qbs.Host
import qbs.ModUtils
import qbs.Utilities
import qbs.WindowsUtils
@@ -216,7 +217,7 @@ Module {
property stringList knownArchitectures: []
property var toolchainDetails
- property string compilerExtension: qbs.hostOS.contains("windows") ? ".exe" : ""
+ property string compilerExtension: Host.os().contains("windows") ? ".exe" : ""
property string linkerMode: "automatic"
PropertyOptions {
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs
index 5060af2d6..025aad498 100644
--- a/share/qbs/modules/cpp/GenericGCC.qbs
+++ b/share/qbs/modules/cpp/GenericGCC.qbs
@@ -30,6 +30,7 @@
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.PathTools
import qbs.Probes
@@ -261,7 +262,7 @@ CppModule {
// __USING_SJLJ_EXCEPTIONS__ is defined as 1 when using SJLJ exceptions, but there don't
// seem to be defines for the other models, so use the presence of the DLLs for now.
var prefix = toolchainInstallPath;
- if (!qbs.hostOS.contains("windows"))
+ if (!Host.os().contains("windows"))
prefix = FileInfo.joinPaths(toolchainInstallPath, "..", "lib", "gcc",
toolchainPrefix,
[compilerVersionMajor, compilerVersionMinor].join("."));
diff --git a/share/qbs/modules/cpp/LinuxGCC.qbs b/share/qbs/modules/cpp/LinuxGCC.qbs
index 14fb0a7e9..17346d048 100644
--- a/share/qbs/modules/cpp/LinuxGCC.qbs
+++ b/share/qbs/modules/cpp/LinuxGCC.qbs
@@ -28,6 +28,7 @@
**
****************************************************************************/
+import qbs.Host
import qbs.Process
UnixGCC {
@@ -41,7 +42,7 @@ UnixGCC {
Probe {
id: runPathsProbe
- condition: !_skipAllChecks && qbs.targetPlatform === qbs.hostPlatform
+ condition: !_skipAllChecks && qbs.targetPlatform === Host.platform()
property stringList systemRunPaths: []
configure: {
var paths = [];
diff --git a/share/qbs/modules/cpp/dmc.qbs b/share/qbs/modules/cpp/dmc.qbs
index 68a0033e0..fe8ba25f1 100644
--- a/share/qbs/modules/cpp/dmc.qbs
+++ b/share/qbs/modules/cpp/dmc.qbs
@@ -30,6 +30,7 @@
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.PathTools
import qbs.Probes
import qbs.Utilities
@@ -37,7 +38,7 @@ import "dmc.js" as DMC
import "cpp.js" as Cpp
CppModule {
- condition: qbs.hostOS.contains("windows") && qbs.toolchain && qbs.toolchain.contains("dmc")
+ condition: Host.os().contains("windows") && qbs.toolchain && qbs.toolchain.contains("dmc")
Probes.BinaryProbe {
id: compilerPathProbe
diff --git a/share/qbs/modules/cpp/freebsd-gcc.qbs b/share/qbs/modules/cpp/freebsd-gcc.qbs
index 929c4e557..fb6d45b37 100644
--- a/share/qbs/modules/cpp/freebsd-gcc.qbs
+++ b/share/qbs/modules/cpp/freebsd-gcc.qbs
@@ -29,13 +29,14 @@
****************************************************************************/
import "freebsd.js" as FreeBSD
+import qbs.Host
UnixGCC {
condition: qbs.targetOS.contains("freebsd") &&
qbs.toolchain && qbs.toolchain.contains("gcc")
priority: 1
- targetSystem: "freebsd" + (qbs.hostOS.contains("freebsd") ? FreeBSD.hostKernelRelease() : "")
+ targetSystem: "freebsd" + (Host.os().contains("freebsd") ? FreeBSD.hostKernelRelease() : "")
distributionIncludePaths: ["/usr/local/include"]
distributionLibraryPaths: ["/usr/local/lib"]
diff --git a/share/qbs/modules/cpp/gcc.js b/share/qbs/modules/cpp/gcc.js
index c7bf66de3..7e8e768b0 100644
--- a/share/qbs/modules/cpp/gcc.js
+++ b/share/qbs/modules/cpp/gcc.js
@@ -32,6 +32,7 @@ var Codesign = require("../codesign/codesign.js");
var Cpp = require("cpp.js");
var File = require("qbs.File");
var FileInfo = require("qbs.FileInfo");
+var Host = require("qbs.Host");
var DarwinTools = require("qbs.DarwinTools");
var ModUtils = require("qbs.ModUtils");
var PathTools = require("qbs.PathTools");
@@ -1011,7 +1012,7 @@ function linkerEnvVars(config, inputs)
function setResponseFileThreshold(command, product)
{
- if (product.qbs.targetOS.contains("windows") && product.qbs.hostOS.contains("windows"))
+ if (product.qbs.targetOS.contains("windows") && Host.os().contains("windows"))
command.responseFileThreshold = 10000;
}
diff --git a/share/qbs/modules/cpp/ios-gcc.qbs b/share/qbs/modules/cpp/ios-gcc.qbs
index 2d73c8125..92e072a0a 100644
--- a/share/qbs/modules/cpp/ios-gcc.qbs
+++ b/share/qbs/modules/cpp/ios-gcc.qbs
@@ -31,6 +31,7 @@
import qbs.DarwinTools
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.Utilities
@@ -40,7 +41,7 @@ DarwinGCC {
qbs.toolchain && qbs.toolchain.contains('gcc')
minimumIosVersion: {
- if (qbs.architecture == "armv7a")
+ if (Host.architecture() == "armv7a")
return "6.0";
// XCode 12 requres version (at least 8.0) to be present in the -target triplet
// when compiling for ios-simulator
diff --git a/share/qbs/modules/cpp/keil.qbs b/share/qbs/modules/cpp/keil.qbs
index c66e95a47..edee1697b 100644
--- a/share/qbs/modules/cpp/keil.qbs
+++ b/share/qbs/modules/cpp/keil.qbs
@@ -30,12 +30,13 @@
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.Probes
import "cpp.js" as Cpp
import "keil.js" as KEIL
CppModule {
- condition: qbs.hostOS.contains("windows") && qbs.toolchain && qbs.toolchain.contains("keil")
+ condition: Host.os().contains("windows") && qbs.toolchain && qbs.toolchain.contains("keil")
Probes.BinaryProbe {
id: compilerPathProbe
diff --git a/share/qbs/modules/cpp/sdcc.js b/share/qbs/modules/cpp/sdcc.js
index 5fc7970aa..bb9a429c8 100644
--- a/share/qbs/modules/cpp/sdcc.js
+++ b/share/qbs/modules/cpp/sdcc.js
@@ -33,6 +33,7 @@ var Cpp = require("cpp.js");
var Environment = require("qbs.Environment");
var File = require("qbs.File");
var FileInfo = require("qbs.FileInfo");
+var Host = require("qbs.Host");
var ModUtils = require("qbs.ModUtils");
var PathTools = require("qbs.PathTools");
var Process = require("qbs.Process");
@@ -395,7 +396,7 @@ function buildLinkerMapFilePath(target, suffix) {
// We need to replace the '\r\n\' line endings with the'\n' line
// endings for each generated object file.
function patchObjectFile(project, product, inputs, outputs, input, output) {
- var isWindows = input.qbs.hostOS.contains("windows");
+ var isWindows = Host.os().contains("windows");
if (isWindows && input.cpp.debugInformation) {
var cmd = new JavaScriptCommand();
cmd.objectPath = outputs.obj[0].filePath;
diff --git a/share/qbs/modules/cpp/setuprunenv.js b/share/qbs/modules/cpp/setuprunenv.js
index 1c3753552..df034e72a 100644
--- a/share/qbs/modules/cpp/setuprunenv.js
+++ b/share/qbs/modules/cpp/setuprunenv.js
@@ -30,6 +30,7 @@
var FileInfo = require("qbs.FileInfo");
var File = require("qbs.File");
+var Host = require("qbs.Host");
var ModUtils = require("qbs.ModUtils"); // TODO: append/prepend functionality should go to qbs.Environment
function addNewElement(list, elem)
@@ -48,7 +49,7 @@ function artifactDir(artifact)
function addExternalLibPath(product, list, path)
{
addNewElement(list, path);
- if (product.qbs.hostOS.contains("windows") && FileInfo.fileName(path) === "lib") {
+ if (Host.os().contains("windows") && FileInfo.fileName(path) === "lib") {
var binPath = FileInfo.joinPaths(FileInfo.path(path), "bin");
if (File.exists(binPath))
addNewElement(list, binPath);
@@ -108,7 +109,7 @@ function setupRunEnvironment(product, config)
if (config.contains("ignore-lib-dependencies"))
return;
- if (product.qbs.hostPlatform !== product.qbs.targetPlatform)
+ if (Host.platform() !== product.qbs.targetPlatform)
return;
var libPaths = [];
@@ -134,8 +135,8 @@ function setupRunEnvironment(product, config)
envVarName = "DYLD_LIBRARY_PATH";
else
envVarName = "LD_LIBRARY_PATH";
- var envVar = new ModUtils.EnvironmentVariable(envVarName, product.qbs.pathListSeparator,
- product.qbs.hostOS.contains("windows"));
+ var envVar = new ModUtils.EnvironmentVariable(envVarName, FileInfo.pathListSeparator(),
+ Host.os().contains("windows"));
libPaths.forEach(function(p) { envVar.prepend(p); });
envVar.set();
}
diff --git a/share/qbs/modules/cpp/windows-clang-cl.qbs b/share/qbs/modules/cpp/windows-clang-cl.qbs
index e1f4ee425..cc58097f6 100644
--- a/share/qbs/modules/cpp/windows-clang-cl.qbs
+++ b/share/qbs/modules/cpp/windows-clang-cl.qbs
@@ -28,13 +28,14 @@
**
****************************************************************************/
+import qbs.Host
import qbs.ModUtils
import qbs.Probes
import qbs.FileInfo
import 'windows-msvc-base.qbs' as MsvcBaseModule
MsvcBaseModule {
- condition: qbs.hostOS.contains('windows') &&
+ condition: Host.os().contains('windows') &&
qbs.targetOS.contains('windows') &&
qbs.toolchain && qbs.toolchain.contains('clang-cl')
priority: 100
diff --git a/share/qbs/modules/cpp/windows-clang-mingw.qbs b/share/qbs/modules/cpp/windows-clang-mingw.qbs
index 10d56cc85..b5bac0572 100644
--- a/share/qbs/modules/cpp/windows-clang-mingw.qbs
+++ b/share/qbs/modules/cpp/windows-clang-mingw.qbs
@@ -30,6 +30,7 @@
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.Utilities
import "msvc.js" as MSVC
@@ -68,16 +69,16 @@ MingwBaseModule {
"llvm-rc" + compilerExtension)
setupBuildEnvironment: {
- if (product.qbs.hostOS.contains("windows") && product.qbs.sysroot) {
- var v = new ModUtils.EnvironmentVariable("PATH", product.qbs.pathListSeparator, true);
+ if (Host.os().contains("windows") && product.qbs.sysroot) {
+ var v = new ModUtils.EnvironmentVariable("PATH", FileInfo.pathListSeparator(), true);
v.prepend(FileInfo.joinPaths(product.qbs.sysroot, "bin"));
v.set();
}
}
setupRunEnvironment: {
- if (product.qbs.hostOS.contains("windows") && product.qbs.sysroot) {
- var v = new ModUtils.EnvironmentVariable("PATH", product.qbs.pathListSeparator, true);
+ if (Host.os().contains("windows") && product.qbs.sysroot) {
+ var v = new ModUtils.EnvironmentVariable("PATH", FileInfo.pathListSeparator(), true);
v.prepend(FileInfo.joinPaths(product.qbs.sysroot, "bin"));
v.set();
SetupRunEnv.setupRunEnvironment(product, config);
diff --git a/share/qbs/modules/cpp/windows-mingw.qbs b/share/qbs/modules/cpp/windows-mingw.qbs
index 2a01d81a9..4c20eda5f 100644
--- a/share/qbs/modules/cpp/windows-mingw.qbs
+++ b/share/qbs/modules/cpp/windows-mingw.qbs
@@ -52,13 +52,13 @@ MingwBaseModule {
}
setupBuildEnvironment: {
- var v = new ModUtils.EnvironmentVariable("PATH", product.qbs.pathListSeparator, true);
+ var v = new ModUtils.EnvironmentVariable("PATH", FileInfo.pathListSeparator(), true);
v.prepend(product.cpp.toolchainInstallPath);
v.set();
}
setupRunEnvironment: {
- var v = new ModUtils.EnvironmentVariable("PATH", product.qbs.pathListSeparator, true);
+ var v = new ModUtils.EnvironmentVariable("PATH", FileInfo.pathListSeparator(), true);
v.prepend(product.cpp.toolchainInstallPath);
v.set();
SetupRunEnv.setupRunEnvironment(product, config);
diff --git a/share/qbs/modules/cpp/windows-msvc.qbs b/share/qbs/modules/cpp/windows-msvc.qbs
index 5e41c76fa..a57c4cc5a 100644
--- a/share/qbs/modules/cpp/windows-msvc.qbs
+++ b/share/qbs/modules/cpp/windows-msvc.qbs
@@ -29,11 +29,12 @@
**
****************************************************************************/
+import qbs.Host
import qbs.Probes
import "windows-msvc-base.qbs" as MsvcBaseModule
MsvcBaseModule {
- condition: qbs.hostOS.contains('windows') &&
+ condition: Host.os().contains('windows') &&
qbs.targetOS.contains('windows') &&
qbs.toolchain && qbs.toolchain.contains('msvc')
priority: 50
diff --git a/share/qbs/modules/dmg/DMGModule.qbs b/share/qbs/modules/dmg/DMGModule.qbs
index c5d097a0b..f069cb5dc 100644
--- a/share/qbs/modules/dmg/DMGModule.qbs
+++ b/share/qbs/modules/dmg/DMGModule.qbs
@@ -31,6 +31,7 @@
import qbs.DarwinTools
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.Process
import qbs.TextFile
@@ -39,7 +40,7 @@ import "dmg.js" as Dmg
Module {
Depends { name: "xcode"; required: false }
- condition: qbs.hostOS.contains("darwin") && qbs.targetOS.contains("darwin")
+ condition: Host.os().contains("darwin") && qbs.targetOS.contains("darwin")
property string volumeName: product.targetName
PropertyOptions {
diff --git a/share/qbs/modules/ib/IBModule.qbs b/share/qbs/modules/ib/IBModule.qbs
index 6af5e94e4..4ff8abea2 100644
--- a/share/qbs/modules/ib/IBModule.qbs
+++ b/share/qbs/modules/ib/IBModule.qbs
@@ -31,6 +31,7 @@
import qbs.BundleTools
import qbs.DarwinTools
import qbs.File
+import qbs.Host
import qbs.FileInfo
import qbs.ModUtils
import qbs.Process
@@ -49,7 +50,7 @@ Module {
}
}
- condition: qbs.hostOS.contains("darwin") && qbs.targetOS.contains("darwin")
+ condition: Host.os().contains("darwin") && qbs.targetOS.contains("darwin")
property bool warnings: true
property bool errors: true
diff --git a/share/qbs/modules/java/JavaModule.qbs b/share/qbs/modules/java/JavaModule.qbs
index 3bb3bbe91..d4d7c4492 100644
--- a/share/qbs/modules/java/JavaModule.qbs
+++ b/share/qbs/modules/java/JavaModule.qbs
@@ -29,6 +29,7 @@
****************************************************************************/
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.Probes
import qbs.Process
@@ -122,7 +123,7 @@ Module {
} else {
paths.push(FileInfo.joinPaths(jdkPath, "include"));
- var hostOS = qbs.hostOS.contains("windows") ? qbs.hostOS.concat(["win32"]) : qbs.hostOS;
+ var hostOS = Host.os().contains("windows") ? Host.os().concat(["win32"]) : Host.os();
var platforms = ["win32", "darwin", "linux", "bsd", "solaris"];
for (var i = 0; i < platforms.length; ++i) {
if (hostOS.contains(platforms[i])) {
@@ -140,7 +141,7 @@ Module {
property path classFilesDir: FileInfo.joinPaths(product.buildDirectory, "classes")
property path internalClassFilesDir: FileInfo.joinPaths(product.buildDirectory, ".classes")
- property bool isAppleJava: qbs.hostOS.contains("darwin")
+ property bool isAppleJava: Host.os().contains("darwin")
&& (compilerVersionMajor < 1
|| (compilerVersionMajor === 1 && compilerVersionMinor < 7))
diff --git a/share/qbs/modules/java/utils.js b/share/qbs/modules/java/utils.js
index 520511192..8fb9661fa 100644
--- a/share/qbs/modules/java/utils.js
+++ b/share/qbs/modules/java/utils.js
@@ -193,7 +193,7 @@ function javacArguments(product, inputs, overrides) {
classPaths.push(inputs["java.jar"][i].filePath);
var debugArg = product.moduleProperty("qbs", "buildVariant") === "debug"
? "-g" : "-g:none";
- var pathListSeparator = product.moduleProperty("qbs", "pathListSeparator");
+ var pathListSeparator = FileInfo.pathListSeparator();
var args = [
"-classpath", classPaths.join(pathListSeparator),
"-s", product.buildDirectory,
@@ -312,7 +312,7 @@ function outputArtifacts(product, inputs) {
process.setWorkingDirectory(
FileInfo.joinPaths(ModUtils.moduleProperty(product, "internalClassFilesDir")));
- var sep = product.moduleProperty("qbs", "pathListSeparator");
+ var sep = FileInfo.pathListSeparator();
var toolsJarPath = ModUtils.moduleProperty(product, "toolsJarPath");
var javaArgs = [
"-classpath", process.workingDirectory() + (toolsJarPath ? (sep + toolsJarPath) : ""),
diff --git a/share/qbs/modules/nodejs/NodeJS.qbs b/share/qbs/modules/nodejs/NodeJS.qbs
index 7fd992fdb..db10fb36f 100644
--- a/share/qbs/modules/nodejs/NodeJS.qbs
+++ b/share/qbs/modules/nodejs/NodeJS.qbs
@@ -31,6 +31,7 @@
import qbs.Environment
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.Probes
@@ -84,13 +85,13 @@ Module {
"tmp", "nodejs.intermediate")
setupBuildEnvironment: {
- var v = new ModUtils.EnvironmentVariable("PATH", product.qbs.pathListSeparator, product.qbs.hostOS.contains("windows"));
+ var v = new ModUtils.EnvironmentVariable("PATH", FileInfo.pathListSeparator(), Host.os().contains("windows"));
v.prepend(product.nodejs.toolchainInstallPath);
v.set();
}
setupRunEnvironment: {
- var v = new ModUtils.EnvironmentVariable("NODE_PATH", product.qbs.pathListSeparator, product.qbs.hostOS.contains("windows"));
+ var v = new ModUtils.EnvironmentVariable("NODE_PATH", FileInfo.pathListSeparator(), Host.os().contains("windows"));
v.prepend(FileInfo.path(Environment.getEnv("QBS_RUN_FILE_PATH")));
v.set();
}
diff --git a/share/qbs/modules/nsis/NSISModule.qbs b/share/qbs/modules/nsis/NSISModule.qbs
index 23d673880..cf8626949 100644
--- a/share/qbs/modules/nsis/NSISModule.qbs
+++ b/share/qbs/modules/nsis/NSISModule.qbs
@@ -30,6 +30,7 @@
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.Utilities
@@ -89,7 +90,7 @@ Module {
// Private properties
property string registryKey: {
- if (!qbs.hostOS.contains("windows"))
+ if (!Host.os().contains("windows"))
return undefined;
var keys = [ "HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS" ];
diff --git a/share/qbs/modules/qnx/qnx.qbs b/share/qbs/modules/qnx/qnx.qbs
index 9cab5abb6..f329db18c 100644
--- a/share/qbs/modules/qnx/qnx.qbs
+++ b/share/qbs/modules/qnx/qnx.qbs
@@ -31,6 +31,7 @@
import qbs.Environment
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.Probes
import qbs.Utilities
@@ -39,7 +40,7 @@ Module {
Probes.PathProbe {
id: qnxSdkProbe
names: ["qnx700", "qnx660", "qnx650"]
- searchPaths: qbs.hostOS.contains("windows")
+ searchPaths: Host.os().contains("windows")
? [Environment.getEnv("USERPROFILE"), Environment.getEnv("SystemDrive")]
: [Environment.getEnv("HOME"), "/opt"]
}
@@ -77,11 +78,11 @@ Module {
property string hostArch: qnx7 ? "x86_64" : "x86"
property string hostOs: {
- if (qbs.hostOS.contains("linux"))
+ if (Host.os().contains("linux"))
return "linux";
- if (qbs.hostOS.contains("macos"))
+ if (Host.os().contains("macos"))
return "darwin";
- if (qbs.hostOS.contains("windows"))
+ if (Host.os().contains("windows"))
return qnx7 ? "win64" : "win32";
}
@@ -111,7 +112,7 @@ Module {
}
if (!hostOs) {
- throw ModUtils.ModuleError("Host operating system '" + qbs.hostOS
+ throw ModUtils.ModuleError("Host operating system '" + Host.os()
+ "' is not supported by the QNX SDK.");
} else if (!File.exists(hostDir)) {
throw ModUtils.ModuleError("Detected host tools operating system '" + hostOs
diff --git a/share/qbs/modules/typescript/TypeScriptModule.qbs b/share/qbs/modules/typescript/TypeScriptModule.qbs
index d8e61b17f..c8ca270e0 100644
--- a/share/qbs/modules/typescript/TypeScriptModule.qbs
+++ b/share/qbs/modules/typescript/TypeScriptModule.qbs
@@ -30,6 +30,7 @@
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.Probes
import qbs.Process
@@ -129,7 +130,7 @@ Module {
var preValidator = new ModUtils.PropertyValidator("nodejs");
preValidator.addCustomValidator("interpreterFileName", nodejs.interpreterFileName, function (value) {
- return value === "node" + (qbs.hostOS.contains("windows") ? ".exe" : "");
+ return value === "node" + (Host.os().contains("windows") ? ".exe" : "");
}, interpreterMessage);
preValidator.addCustomValidator("interpreterFilePath", nodejs.interpreterFilePath, function (value) {
return value.endsWith(nodejs.interpreterFileName);
diff --git a/share/qbs/modules/typescript/typescript.js b/share/qbs/modules/typescript/typescript.js
index 858041b3d..7b2cf98df 100644
--- a/share/qbs/modules/typescript/typescript.js
+++ b/share/qbs/modules/typescript/typescript.js
@@ -132,7 +132,7 @@ function outputArtifacts(product, inputs) {
process.setEnv("NODE_PATH", [
ModUtils.moduleProperty(product, "toolchainInstallPath"),
product.moduleProperty("nodejs", "packageManagerRootPath")
- ].join(product.moduleProperty("qbs", "pathListSeparator")));
+ ].join(FileInfo.pathListSeparator()));
process.exec(product.moduleProperty("nodejs", "interpreterFilePath"),
[FileInfo.joinPaths(product.buildDirectory,
".io.qt.qbs.internal.typescript",
diff --git a/share/qbs/modules/wix/WiXModule.qbs b/share/qbs/modules/wix/WiXModule.qbs
index ad8586da1..31bdac51f 100644
--- a/share/qbs/modules/wix/WiXModule.qbs
+++ b/share/qbs/modules/wix/WiXModule.qbs
@@ -30,6 +30,7 @@
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.ModUtils
import qbs.Probes
import qbs.Utilities
@@ -124,7 +125,7 @@ Module {
}
// MSI/MSM package validation only works natively on Windows
- property bool enablePackageValidation: qbs.hostOS.contains("windows")
+ property bool enablePackageValidation: Host.os().contains("windows")
property string executableSuffix: ".exe"
property string windowsInstallerSuffix: ".msi"
@@ -151,7 +152,7 @@ Module {
}
setupBuildEnvironment: {
- var v = new ModUtils.EnvironmentVariable("PATH", product.qbs.pathListSeparator, true);
+ var v = new ModUtils.EnvironmentVariable("PATH", FileInfo.pathListSeparator(), true);
v.prepend(product.wix.toolchainInstallPath);
v.prepend(product.wix.toolchainInstallRoot);
v.set();
diff --git a/share/qbs/modules/xcode/xcode.qbs b/share/qbs/modules/xcode/xcode.qbs
index 6c0584c81..1975f04b7 100644
--- a/share/qbs/modules/xcode/xcode.qbs
+++ b/share/qbs/modules/xcode/xcode.qbs
@@ -193,7 +193,7 @@ Module {
})
setupBuildEnvironment: {
- var v = new ModUtils.EnvironmentVariable("PATH", product.qbs.pathListSeparator, false);
+ var v = new ModUtils.EnvironmentVariable("PATH", FileInfo.pathListSeparator(), false);
v.prepend(product.xcode.platformPath + "/Developer/usr/bin");
v.prepend(product.xcode.developerPath + "/usr/bin");
v.set();
diff --git a/tests/auto/api/testdata/explicitly-depends-on/explicitly-depends-on.qbs b/tests/auto/api/testdata/explicitly-depends-on/explicitly-depends-on.qbs
index 1823384f5..0ebb73413 100644
--- a/tests/auto/api/testdata/explicitly-depends-on/explicitly-depends-on.qbs
+++ b/tests/auto/api/testdata/explicitly-depends-on/explicitly-depends-on.qbs
@@ -1,4 +1,5 @@
import qbs.FileInfo
+import qbs.Host
import qbs.TextFile
Project {
@@ -12,7 +13,7 @@ Project {
}
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/api/testdata/infinite-loop-process/infinite-loop.qbs b/tests/auto/api/testdata/infinite-loop-process/infinite-loop.qbs
index f100e4d37..99aafea1c 100644
--- a/tests/auto/api/testdata/infinite-loop-process/infinite-loop.qbs
+++ b/tests/auto/api/testdata/infinite-loop-process/infinite-loop.qbs
@@ -1,3 +1,5 @@
+import qbs.Host
+
Project {
CppApplication {
type: "application"
@@ -17,7 +19,7 @@ Project {
Depends { name: "infinite-loop" }
Depends {
name: "cpp" // Make sure build environment is set up properly.
- condition: qbs.hostOS.contains("windows") && qbs.toolchain.contains("gcc")
+ condition: Host.os().contains("windows") && qbs.toolchain.contains("gcc")
}
Rule {
inputsFromDependencies: "application"
diff --git a/tests/auto/api/testdata/process-result/process-result.qbs b/tests/auto/api/testdata/process-result/process-result.qbs
index 069edb4c0..dc9ff2839 100644
--- a/tests/auto/api/testdata/process-result/process-result.qbs
+++ b/tests/auto/api/testdata/process-result/process-result.qbs
@@ -1,3 +1,5 @@
+import qbs.Host
+
Project {
CppApplication {
name: "app"
@@ -6,7 +8,7 @@ Project {
}
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/api/testdata/timeout-process/timeout.qbs b/tests/auto/api/testdata/timeout-process/timeout.qbs
index 994050309..c95b5ae67 100644
--- a/tests/auto/api/testdata/timeout-process/timeout.qbs
+++ b/tests/auto/api/testdata/timeout-process/timeout.qbs
@@ -1,3 +1,5 @@
+import qbs.Host
+
Project {
CppApplication {
type: "application"
@@ -14,7 +16,7 @@ Project {
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
@@ -24,7 +26,7 @@ Project {
Depends { name: "infinite-loop" }
Depends {
name: "cpp" // Make sure build environment is set up properly.
- condition: qbs.hostOS.contains("windows") && qbs.toolchain.contains("gcc")
+ condition: Host.os().contains("windows") && qbs.toolchain.contains("gcc")
}
Rule {
inputsFromDependencies: "application"
diff --git a/tests/auto/api/testdata/tool-in-module/use-outside-project/modules/thetool/thetool.qbs b/tests/auto/api/testdata/tool-in-module/use-outside-project/modules/thetool/thetool.qbs
index d72ebda17..de9c4e935 100644
--- a/tests/auto/api/testdata/tool-in-module/use-outside-project/modules/thetool/thetool.qbs
+++ b/tests/auto/api/testdata/tool-in-module/use-outside-project/modules/thetool/thetool.qbs
@@ -1,11 +1,12 @@
import qbs.FileInfo
+import qbs.Host
Module {
Depends { name: "cpp" }
Group {
name: "thetool binary"
files: FileInfo.cleanPath(FileInfo.joinPaths(path, "..", "..",
- "thetool" + (qbs.hostOS.contains("windows") ? ".exe" : "")));
+ "thetool" + (Host.os().contains("windows") ? ".exe" : "")));
fileTags: ["thetool.thetool"]
filesAreTargets: true
}
diff --git a/tests/auto/api/testdata/tool-in-module/use-within-project/use-within-project.qbs b/tests/auto/api/testdata/tool-in-module/use-within-project/use-within-project.qbs
index d0f7c35ed..ab4e07170 100644
--- a/tests/auto/api/testdata/tool-in-module/use-within-project/use-within-project.qbs
+++ b/tests/auto/api/testdata/tool-in-module/use-within-project/use-within-project.qbs
@@ -1,3 +1,5 @@
+import qbs.Host
+
Project {
CppApplication {
name: "thetool"
@@ -5,7 +7,7 @@ Project {
files: "main.cpp"
property bool skip: {
- var result = qbs.targetPlatform !== qbs.hostPlatform;
+ var result = qbs.targetPlatform !== Host.platform();
if (result)
console.info("Skip this test");
return result;
diff --git a/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs b/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs
index 6e999adda..7cbb58051 100644
--- a/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs
+++ b/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs
@@ -1,3 +1,4 @@
+import qbs.Host
import qbs.Utilities
Project {
@@ -17,8 +18,8 @@ Project {
filez.push("empty.xcassets/empty.iconset");
else if (Utilities.versionCompare(xcode.version, "5") >= 0)
filez.push("empty.xcassets");
- if ((qbs.hostOSVersionMajor >= 11
- || qbs.hostOSVersionMinor >= 10) // need macOS 10.10 or higher to build SBs
+ if ((Host.osVersionMajor() >= 11
+ || Host.osVersionMinor() >= 10) // need macOS 10.10 or higher to build SBs
&& cpp.minimumMacosVersion !== undefined
&& Utilities.versionCompare(cpp.minimumMacosVersion, "10.10") >= 0)
filez.push("Storyboard.storyboard");
diff --git a/tests/auto/blackbox/testdata-java/java/vehicles.qbs b/tests/auto/blackbox/testdata-java/java/vehicles.qbs
index 633ee5abd..2fc01e102 100644
--- a/tests/auto/blackbox/testdata-java/java/vehicles.qbs
+++ b/tests/auto/blackbox/testdata-java/java/vehicles.qbs
@@ -1,4 +1,5 @@
import qbs.FileInfo
+import qbs.Host
import qbs.Utilities
Project {
@@ -11,7 +12,7 @@ Project {
}
property bool _testPlatform: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata-joblimits/job-limits-init/job-limits-init.qbs b/tests/auto/blackbox/testdata-joblimits/job-limits-init/job-limits-init.qbs
index 9e387bc7f..3a0075530 100644
--- a/tests/auto/blackbox/testdata-joblimits/job-limits-init/job-limits-init.qbs
+++ b/tests/auto/blackbox/testdata-joblimits/job-limits-init/job-limits-init.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
Product {
property bool _testPlatform: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata-qt/auto-qrc/auto-qrc.qbs b/tests/auto/blackbox/testdata-qt/auto-qrc/auto-qrc.qbs
index 92b290719..bdbf8b2a1 100644
--- a/tests/auto/blackbox/testdata-qt/auto-qrc/auto-qrc.qbs
+++ b/tests/auto/blackbox/testdata-qt/auto-qrc/auto-qrc.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
Project {
QtApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata-qt/forced-moc/forced-moc.qbs b/tests/auto/blackbox/testdata-qt/forced-moc/forced-moc.qbs
index aab7ed220..064470a79 100644
--- a/tests/auto/blackbox/testdata-qt/forced-moc/forced-moc.qbs
+++ b/tests/auto/blackbox/testdata-qt/forced-moc/forced-moc.qbs
@@ -1,3 +1,4 @@
+import qbs.Host
import qbs.Utilities
QtApplication {
@@ -6,7 +7,7 @@ QtApplication {
console.info("using qt4");
return false;
}
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata-qt/pkgconfig/pkgconfig.qbs b/tests/auto/blackbox/testdata-qt/pkgconfig/pkgconfig.qbs
index 87ec6dc7d..b2d411154 100644
--- a/tests/auto/blackbox/testdata-qt/pkgconfig/pkgconfig.qbs
+++ b/tests/auto/blackbox/testdata-qt/pkgconfig/pkgconfig.qbs
@@ -1,10 +1,11 @@
+import qbs.Host
import qbs.Probes
Project {
property string name: 'pkgconfig'
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs b/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs
index 7e5f98340..a3067f0b0 100644
--- a/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs
+++ b/tests/auto/blackbox/testdata-qt/plugin-meta-data/plugin-meta-data.qbs
@@ -1,3 +1,4 @@
+import qbs.Host
import qbs.Utilities
Project {
@@ -8,7 +9,7 @@ Project {
console.info("using qt4");
return false;
}
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata-qt/qrc/i.qbs b/tests/auto/blackbox/testdata-qt/qrc/i.qbs
index e98c069b5..45275106d 100644
--- a/tests/auto/blackbox/testdata-qt/qrc/i.qbs
+++ b/tests/auto/blackbox/testdata-qt/qrc/i.qbs
@@ -1,3 +1,4 @@
+import qbs.Host
import qbs.Utilities
Project {
@@ -7,7 +8,7 @@ Project {
console.info("using qt4");
return false;
}
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs b/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs
index 90b968ec9..90f7e5b96 100644
--- a/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs
+++ b/tests/auto/blackbox/testdata-qt/qtscxml/qtscxml.qbs
@@ -1,5 +1,6 @@
import qbs.Environment
import qbs.FileInfo
+import qbs.Host
import qbs.Utilities
Project {
@@ -25,7 +26,7 @@ Project {
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
@@ -41,9 +42,9 @@ Project {
cmd.description = "running " + input.filePath;
var envVars = {};
- if (product.qbs.hostOS.contains("windows")) {
+ if (Host.os().contains("windows")) {
envVars["PATH"] = FileInfo.toWindowsSeparators(input["Qt.core"].binPath);
- } else if (product.qbs.hostOS.contains("macos")) {
+ } else if (Host.os().contains("macos")) {
envVars["DYLD_LIBRARY_PATH"] = input["Qt.core"].libPath;
envVars["DYLD_FRAMEWORK_PATH"] = input["Qt.core"].libPath;
} else {
@@ -51,7 +52,7 @@ Project {
}
for (var varName in envVars) {
var oldValue = Environment.getEnv(varName) || "";
- var newValue = envVars[varName] + product.qbs.pathListSeparator + oldValue;
+ var newValue = envVars[varName] + FileInfo.pathListSeparator() + oldValue;
cmd.environment.push(varName + '=' + newValue);
}
diff --git a/tests/auto/blackbox/testdata-windows/wix/WiXInstallers.qbs b/tests/auto/blackbox/testdata-windows/wix/WiXInstallers.qbs
index 7e1dbf5e3..1316d07d7 100644
--- a/tests/auto/blackbox/testdata-windows/wix/WiXInstallers.qbs
+++ b/tests/auto/blackbox/testdata-windows/wix/WiXInstallers.qbs
@@ -1,4 +1,5 @@
import qbs.FileInfo
+import qbs.Host
Project {
WindowsInstallerPackage {
@@ -19,7 +20,7 @@ Project {
WindowsSetupPackage {
Depends { name: "QbsSetup" }
- condition: qbs.hostOS.contains("windows") // currently does not work in Wine with WiX 3.9
+ condition: Host.os().contains("windows") // currently does not work in Wine with WiX 3.9
name: "QbsBootstrapper"
targetName: "qbs-setup-" + qbs.architecture
files: ["QbsBootstrapper.wxs"]
diff --git a/tests/auto/blackbox/testdata/autotest-timeout/autotests-timeout.qbs b/tests/auto/blackbox/testdata/autotest-timeout/autotests-timeout.qbs
index 8ae4f3ceb..08de04fc7 100644
--- a/tests/auto/blackbox/testdata/autotest-timeout/autotests-timeout.qbs
+++ b/tests/auto/blackbox/testdata/autotest-timeout/autotests-timeout.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
Project {
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
@@ -20,7 +22,7 @@ Project {
AutotestRunner {
Depends {
name: "cpp" // Make sure build environment is set up properly.
- condition: qbs.hostOS.contains("windows") && qbs.toolchain.contains("gcc")
+ condition: Host.os().contains("windows") && qbs.toolchain.contains("gcc")
}
}
}
diff --git a/tests/auto/blackbox/testdata/autotest-with-dependencies/autotest-with-dependencies.qbs b/tests/auto/blackbox/testdata/autotest-with-dependencies/autotest-with-dependencies.qbs
index b64473526..8f4634368 100644
--- a/tests/auto/blackbox/testdata/autotest-with-dependencies/autotest-with-dependencies.qbs
+++ b/tests/auto/blackbox/testdata/autotest-with-dependencies/autotest-with-dependencies.qbs
@@ -1,9 +1,10 @@
import qbs.FileInfo
+import qbs.Host
Project {
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
@@ -29,7 +30,7 @@ Project {
AutotestRunner {
Depends {
name: "cpp" // Make sure build environment is set up properly.
- condition: qbs.hostOS.contains("windows") && qbs.toolchain.contains("gcc")
+ condition: Host.os().contains("windows") && qbs.toolchain.contains("gcc")
}
arguments: FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix, "bin")
auxiliaryInputs: "test-helper"
diff --git a/tests/auto/blackbox/testdata/autotests/autotests.qbs b/tests/auto/blackbox/testdata/autotests/autotests.qbs
index 4927a8869..dc27d8288 100644
--- a/tests/auto/blackbox/testdata/autotests/autotests.qbs
+++ b/tests/auto/blackbox/testdata/autotests/autotests.qbs
@@ -1,15 +1,17 @@
+import qbs.Host
+
Project {
references: ["test1", "test2", "test3"]
AutotestRunner {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
}
Depends {
name: "cpp" // Make sure build environment is set up properly.
- condition: qbs.hostOS.contains("windows") && qbs.toolchain.contains("gcc")
+ condition: Host.os().contains("windows") && qbs.toolchain.contains("gcc")
}
}
}
diff --git a/tests/auto/blackbox/testdata/badInterpreter/badInterpreter.qbs b/tests/auto/blackbox/testdata/badInterpreter/badInterpreter.qbs
index 2317e6edf..3c8f64c6c 100644
--- a/tests/auto/blackbox/testdata/badInterpreter/badInterpreter.qbs
+++ b/tests/auto/blackbox/testdata/badInterpreter/badInterpreter.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
Project {
property bool enabled: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/capnproto/capnproto_absolute_import.qbs b/tests/auto/blackbox/testdata/capnproto/capnproto_absolute_import.qbs
index ee0903f73..0d7c8a1bb 100644
--- a/tests/auto/blackbox/testdata/capnproto/capnproto_absolute_import.qbs
+++ b/tests/auto/blackbox/testdata/capnproto/capnproto_absolute_import.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
CppApplication {
Depends { name: "capnproto.cpp"; required: false }
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
if (!capnproto.cpp.present)
diff --git a/tests/auto/blackbox/testdata/capnproto/capnproto_cpp.qbs b/tests/auto/blackbox/testdata/capnproto/capnproto_cpp.qbs
index d7ee1b4c9..c31824bb0 100644
--- a/tests/auto/blackbox/testdata/capnproto/capnproto_cpp.qbs
+++ b/tests/auto/blackbox/testdata/capnproto/capnproto_cpp.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
CppApplication {
Depends { name: "capnproto.cpp"; required: false }
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
if (!capnproto.cpp.present)
diff --git a/tests/auto/blackbox/testdata/capnproto/capnproto_cpp_pkgconfig.qbs b/tests/auto/blackbox/testdata/capnproto/capnproto_cpp_pkgconfig.qbs
index 58c7d568d..90201e440 100644
--- a/tests/auto/blackbox/testdata/capnproto/capnproto_cpp_pkgconfig.qbs
+++ b/tests/auto/blackbox/testdata/capnproto/capnproto_cpp_pkgconfig.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
CppApplication {
Depends { name: "capnproto.cpp"; required: false }
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
if (!capnproto.cpp.present)
@@ -14,4 +16,4 @@ CppApplication {
"foo.capnp"
]
qbsModuleProviders: "qbspkgconfig"
-} \ No newline at end of file
+}
diff --git a/tests/auto/blackbox/testdata/capnproto/capnproto_relative_import.qbs b/tests/auto/blackbox/testdata/capnproto/capnproto_relative_import.qbs
index 7c1991d8f..333a3cdb9 100644
--- a/tests/auto/blackbox/testdata/capnproto/capnproto_relative_import.qbs
+++ b/tests/auto/blackbox/testdata/capnproto/capnproto_relative_import.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
CppApplication {
Depends { name: "capnproto.cpp"; required: false }
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
if (!capnproto.cpp.present)
diff --git a/tests/auto/blackbox/testdata/capnproto/greeter_cpp.qbs b/tests/auto/blackbox/testdata/capnproto/greeter_cpp.qbs
index cf95b968b..7266e9e15 100644
--- a/tests/auto/blackbox/testdata/capnproto/greeter_cpp.qbs
+++ b/tests/auto/blackbox/testdata/capnproto/greeter_cpp.qbs
@@ -1,8 +1,10 @@
+import qbs.Host
+
Project {
CppApplication {
Depends { name: "capnproto.cpp"; required: false }
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
if (!capnproto.cpp.present)
diff --git a/tests/auto/blackbox/testdata/configure/configure.qbs b/tests/auto/blackbox/testdata/configure/configure.qbs
index 62dfa4ce4..be0e65247 100644
--- a/tests/auto/blackbox/testdata/configure/configure.qbs
+++ b/tests/auto/blackbox/testdata/configure/configure.qbs
@@ -1,8 +1,9 @@
import qbs.FileInfo
+import qbs.Host
Project {
property bool enabled: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/dynamic-library-in-module/theapp.qbs b/tests/auto/blackbox/testdata/dynamic-library-in-module/theapp.qbs
index 26b3f2cab..5ea8cef23 100644
--- a/tests/auto/blackbox/testdata/dynamic-library-in-module/theapp.qbs
+++ b/tests/auto/blackbox/testdata/dynamic-library-in-module/theapp.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
Project {
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/env-merging/env-merging.qbs b/tests/auto/blackbox/testdata/env-merging/env-merging.qbs
index b927003eb..eb681f36b 100644
--- a/tests/auto/blackbox/testdata/env-merging/env-merging.qbs
+++ b/tests/auto/blackbox/testdata/env-merging/env-merging.qbs
@@ -1,3 +1,5 @@
+import qbs.Host
+
Project {
CppApplication {
name: "tool"
@@ -6,7 +8,7 @@ Project {
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs b/tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs
index b855a6149..94632053a 100644
--- a/tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs
+++ b/tests/auto/blackbox/testdata/exports-pkgconfig/exports-pkgconfig.qbs
@@ -1,4 +1,5 @@
import qbs.FileInfo
+import qbs.Host
Project {
Product {
@@ -42,7 +43,7 @@ Project {
Depends { name: "Qt.core"; required: false }
Depends { name: "helper1" }
Depends { name: "helper3" }
- property bool someCondition: qbs.hostOS.contains("windows") // hostOS for easier testing
+ property bool someCondition: Host.os().contains("windows") // hostOS for easier testing
property bool someOtherCondition: someCondition
Properties {
condition: !someOtherCondition
diff --git a/tests/auto/blackbox/testdata/exports-qbs/consumer.qbs b/tests/auto/blackbox/testdata/exports-qbs/consumer.qbs
index 79ac50e0b..073504400 100644
--- a/tests/auto/blackbox/testdata/exports-qbs/consumer.qbs
+++ b/tests/auto/blackbox/testdata/exports-qbs/consumer.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/groups-in-modules/groups-in-modules.qbs b/tests/auto/blackbox/testdata/groups-in-modules/groups-in-modules.qbs
index 0508872db..1d1d2d54e 100644
--- a/tests/auto/blackbox/testdata/groups-in-modules/groups-in-modules.qbs
+++ b/tests/auto/blackbox/testdata/groups-in-modules/groups-in-modules.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
Project {
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/grpc/grpc_cpp.qbs b/tests/auto/blackbox/testdata/grpc/grpc_cpp.qbs
index 1ecbd0394..6f5360ccb 100644
--- a/tests/auto/blackbox/testdata/grpc/grpc_cpp.qbs
+++ b/tests/auto/blackbox/testdata/grpc/grpc_cpp.qbs
@@ -1,8 +1,10 @@
+import qbs.Host
+
CppApplication {
name: "grpc_cpp"
consoleApplication: true
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result && hasDependencies;
diff --git a/tests/auto/blackbox/testdata/host-os-properties/host-os-properties.qbs b/tests/auto/blackbox/testdata/host-os-properties/host-os-properties.qbs
index e1e722764..9d050e166 100644
--- a/tests/auto/blackbox/testdata/host-os-properties/host-os-properties.qbs
+++ b/tests/auto/blackbox/testdata/host-os-properties/host-os-properties.qbs
@@ -1,14 +1,16 @@
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
}
consoleApplication: true
cpp.defines: [
- 'HOST_ARCHITECTURE="' + qbs.hostArchitecture + '"',
- 'HOST_PLATFORM="' + qbs.hostPlatform + '"'
+ 'HOST_ARCHITECTURE="' + Host.architecture() + '"',
+ 'HOST_PLATFORM="' + Host.platform() + '"'
]
files: "main.cpp"
}
diff --git a/tests/auto/blackbox/testdata/includeLookup/includeLookup.qbs b/tests/auto/blackbox/testdata/includeLookup/includeLookup.qbs
index 5b645fad3..903d170d0 100644
--- a/tests/auto/blackbox/testdata/includeLookup/includeLookup.qbs
+++ b/tests/auto/blackbox/testdata/includeLookup/includeLookup.qbs
@@ -1,11 +1,12 @@
import qbs.FileInfo
+import qbs.Host
Project {
property string name: 'includeLookup'
qbsSearchPaths: '.'
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs b/tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs
index a1c96bf3d..a445fc35b 100644
--- a/tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs
+++ b/tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs
@@ -1,12 +1,13 @@
import qbs.File
import qbs.FileInfo
+import qbs.Host
import qbs.TextFile
Project {
name: "p"
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/jsextensions-process/process.qbs b/tests/auto/blackbox/testdata/jsextensions-process/process.qbs
index b634a8056..fa184fa91 100644
--- a/tests/auto/blackbox/testdata/jsextensions-process/process.qbs
+++ b/tests/auto/blackbox/testdata/jsextensions-process/process.qbs
@@ -1,12 +1,13 @@
import qbs.Environment
import qbs.FileInfo
+import qbs.Host
import qbs.Process
import qbs.TextFile
Project {
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
@@ -54,7 +55,7 @@ Project {
// closeWriteChannel test
process = new Process();
- if (product.qbs.hostOS.contains("windows"))
+ if (Host.os().contains("windows"))
process.start(product.qbs.windowsShellPath,
["/C", product.qbs.windowsSystemRoot + "\\system32\\sort.exe"]);
else
@@ -75,7 +76,7 @@ Project {
testReadlineFile.close();
process = new Process();
- if (product.qbs.hostOS.contains("windows"))
+ if (Host.os().contains("windows"))
process.exec(product.qbs.windowsShellPath,
["/C", "type", "123.txt"],
true);
diff --git a/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs b/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs
index ec4ede648..243ab09b5 100644
--- a/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs
+++ b/tests/auto/blackbox/testdata/lexyacc/one-grammar/one-grammar.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs b/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs
index 025b2109e..a126d725d 100644
--- a/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs
+++ b/tests/auto/blackbox/testdata/lexyacc/two-grammars/two-grammars.qbs
@@ -1,9 +1,11 @@
+import qbs.Host
+
CppApplication {
Depends { name: "lex_yacc" }
consoleApplication: true
cpp.includePaths: ".."
Properties {
- condition: qbs.hostOS.contains("darwin") && qbs.toolchain.contains("clang")
+ condition: Host.os().contains("darwin") && qbs.toolchain.contains("clang")
cpp.cFlags: "-Wno-implicit-function-declaration"
}
files: [
diff --git a/tests/auto/blackbox/testdata/linker-module-definition/linker-module-definition.qbs b/tests/auto/blackbox/testdata/linker-module-definition/linker-module-definition.qbs
index 7425cdca5..cae80e651 100644
--- a/tests/auto/blackbox/testdata/linker-module-definition/linker-module-definition.qbs
+++ b/tests/auto/blackbox/testdata/linker-module-definition/linker-module-definition.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
Project {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs b/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs
index 5749480cc..a5705a865 100644
--- a/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs
+++ b/tests/auto/blackbox/testdata/loadablemodule/loadablemodule.qbs
@@ -1,3 +1,5 @@
+import qbs.Host
+
Project {
LoadableModule {
Depends { name: "cpp" }
@@ -16,7 +18,7 @@ Project {
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/localDeployment/localDeployment.qbs b/tests/auto/blackbox/testdata/localDeployment/localDeployment.qbs
index 856642689..b3fa86d32 100644
--- a/tests/auto/blackbox/testdata/localDeployment/localDeployment.qbs
+++ b/tests/auto/blackbox/testdata/localDeployment/localDeployment.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
Project {
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/makefile-generator/app.qbs b/tests/auto/blackbox/testdata/makefile-generator/app.qbs
index 2f53c4808..367f484cf 100644
--- a/tests/auto/blackbox/testdata/makefile-generator/app.qbs
+++ b/tests/auto/blackbox/testdata/makefile-generator/app.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/minimumSystemVersion/macappstore.qbs b/tests/auto/blackbox/testdata/minimumSystemVersion/macappstore.qbs
index 8ae787b9a..a94b7a80e 100644
--- a/tests/auto/blackbox/testdata/minimumSystemVersion/macappstore.qbs
+++ b/tests/auto/blackbox/testdata/minimumSystemVersion/macappstore.qbs
@@ -1,9 +1,11 @@
// just to make sure three-digit minimum versions work on macOS
// this only affects the value of __MAC_OS_X_VERSION_MIN_REQUIRED,
// not the actual LC_VERSION_MIN_MACOSX command which is limited to two
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result && qbs.targetOS.contains("macos");
diff --git a/tests/auto/blackbox/testdata/minimumSystemVersion/specific.qbs b/tests/auto/blackbox/testdata/minimumSystemVersion/specific.qbs
index 8099d79b9..4dca16df0 100644
--- a/tests/auto/blackbox/testdata/minimumSystemVersion/specific.qbs
+++ b/tests/auto/blackbox/testdata/minimumSystemVersion/specific.qbs
@@ -3,9 +3,11 @@ import qbs.Utilities
// a specific version of the operating systems is specified
// when the application is run its output should confirm
// that the given values took effect
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result && qbs.targetOS.contains("windows") || qbs.targetOS.contains("macos");
diff --git a/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified-forced.qbs b/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified-forced.qbs
index c0b70a0b2..36756137e 100644
--- a/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified-forced.qbs
+++ b/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified-forced.qbs
@@ -2,9 +2,11 @@ import qbs.Utilities
// no minimum versions are specified, and explicitly set to undefined in
// case the profile has set it
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified.qbs b/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified.qbs
index a27ffcd28..1440925f3 100644
--- a/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified.qbs
+++ b/tests/auto/blackbox/testdata/minimumSystemVersion/unspecified.qbs
@@ -1,9 +1,11 @@
import qbs.Utilities
// no minimum versions are specified so the profile defaults will be used
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/module-providers/module-providers.qbs b/tests/auto/blackbox/testdata/module-providers/module-providers.qbs
index 781a3ca03..e83c80bb1 100644
--- a/tests/auto/blackbox/testdata/module-providers/module-providers.qbs
+++ b/tests/auto/blackbox/testdata/module-providers/module-providers.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
Project {
property bool enabled: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs b/tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs
index 7f620f310..1ec51c354 100644
--- a/tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs
+++ b/tests/auto/blackbox/testdata/multiplexed-tool/multiplexed-tool.qbs
@@ -1,9 +1,11 @@
+import qbs.Host
+
Project {
CppApplication {
name: "tool"
consoleApplication: true
property bool _testPlatform: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/nodejs/hello.qbs b/tests/auto/blackbox/testdata/nodejs/hello.qbs
index d7c545922..849a8789f 100644
--- a/tests/auto/blackbox/testdata/nodejs/hello.qbs
+++ b/tests/auto/blackbox/testdata/nodejs/hello.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
NodeJSApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs b/tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs
index 3ee443438..37b5b3778 100644
--- a/tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs
+++ b/tests/auto/blackbox/testdata/output-redirection/output-redirection.qbs
@@ -1,4 +1,5 @@
import qbs.FileInfo
+import qbs.Host
Product {
name: "the-product"
@@ -21,7 +22,7 @@ Product {
prepare: {
var binary;
var prefixArgs;
- if (product.qbs.hostOS.contains("windows")) {
+ if (Host.os().contains("windows")) {
binary = product.qbs.windowsShellPath;
prefixArgs = ["/c", "type"];
} else {
diff --git a/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs b/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs
index c619b33ef..30b7f4ace 100644
--- a/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs
+++ b/tests/auto/blackbox/testdata/plugin-dependency/plugin-dependency.qbs
@@ -1,10 +1,12 @@
+import qbs.Host
+
Project {
CppApplication {
name: "myapp"
files: ["main.cpp"]
Depends {
name: "plugin1" // not to be linked
- cpp.link: qbs.hostOS === undefined
+ cpp.link: Host.os() === undefined
}
Depends { name: "plugin2" } // not to be linked
Depends {
diff --git a/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs b/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs
index 3330b8263..1587940a2 100644
--- a/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs
+++ b/tests/auto/blackbox/testdata/proper quoting/proper quoting.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
Project {
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/protobuf-library-install/protobuf-library.qbs b/tests/auto/blackbox/testdata/protobuf-library-install/protobuf-library.qbs
index af7e6ced6..501675c15 100644
--- a/tests/auto/blackbox/testdata/protobuf-library-install/protobuf-library.qbs
+++ b/tests/auto/blackbox/testdata/protobuf-library-install/protobuf-library.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
StaticLibrary {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result && hasProtobuf;
diff --git a/tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs b/tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs
index 8e8735b69..cf63eb17f 100644
--- a/tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs
+++ b/tests/auto/blackbox/testdata/protobuf/addressbook_cpp.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result && hasProtobuf;
diff --git a/tests/auto/blackbox/testdata/protobuf/addressbook_nanopb.qbs b/tests/auto/blackbox/testdata/protobuf/addressbook_nanopb.qbs
index 61a44fc0f..ccb724ef5 100644
--- a/tests/auto/blackbox/testdata/protobuf/addressbook_nanopb.qbs
+++ b/tests/auto/blackbox/testdata/protobuf/addressbook_nanopb.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result && hasProtobuf;
diff --git a/tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs b/tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs
index 95b03d7d7..7f0b999aa 100644
--- a/tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs
+++ b/tests/auto/blackbox/testdata/protobuf/addressbook_objc.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result && hasProtobuf;
diff --git a/tests/auto/blackbox/testdata/protobuf/create-proto-library.qbs b/tests/auto/blackbox/testdata/protobuf/create-proto-library.qbs
index 9938fcdd4..967bf2bb8 100644
--- a/tests/auto/blackbox/testdata/protobuf/create-proto-library.qbs
+++ b/tests/auto/blackbox/testdata/protobuf/create-proto-library.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
Project {
StaticLibrary {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result && hasProtobuf;
diff --git a/tests/auto/blackbox/testdata/protobuf/import.qbs b/tests/auto/blackbox/testdata/protobuf/import.qbs
index d7ae5e1a2..41669020d 100644
--- a/tests/auto/blackbox/testdata/protobuf/import.qbs
+++ b/tests/auto/blackbox/testdata/protobuf/import.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result && hasProtobuf;
diff --git a/tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs b/tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs
index 80a9d9a88..143e9c20f 100644
--- a/tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs
+++ b/tests/auto/blackbox/testdata/protobuf/needs-import-dir.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result && hasProtobuf;
diff --git a/tests/auto/blackbox/testdata/remove-duplicate-libs/remove-duplicate-libs.qbs b/tests/auto/blackbox/testdata/remove-duplicate-libs/remove-duplicate-libs.qbs
index a6b97bad2..040e12b3a 100644
--- a/tests/auto/blackbox/testdata/remove-duplicate-libs/remove-duplicate-libs.qbs
+++ b/tests/auto/blackbox/testdata/remove-duplicate-libs/remove-duplicate-libs.qbs
@@ -1,4 +1,5 @@
import "MyStaticLib.qbs" as MyStaticLib
+import qbs.Host
Project {
property bool removeDuplicates
@@ -6,7 +7,7 @@ Project {
property bool dummy: {
// most BSD systems (including macOS) use LLVM linker now
console.info("is bfd linker: "
- + (qbs.toolchain.contains("gcc") && !qbs.hostOS.contains("bsd")))
+ + (qbs.toolchain.contains("gcc") && !Host.os().contains("bsd")))
}
qbsSearchPaths: "."
diff --git a/tests/auto/blackbox/testdata/response-files/response-files.qbs b/tests/auto/blackbox/testdata/response-files/response-files.qbs
index 168cdf66a..9158a85fa 100644
--- a/tests/auto/blackbox/testdata/response-files/response-files.qbs
+++ b/tests/auto/blackbox/testdata/response-files/response-files.qbs
@@ -1,4 +1,5 @@
import qbs.FileInfo
+import qbs.Host
import qbs.TextFile
Project {
@@ -9,7 +10,7 @@ Project {
}
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/setup-run-environment/setup-run-environment.qbs b/tests/auto/blackbox/testdata/setup-run-environment/setup-run-environment.qbs
index 5c5100b29..02f5ec7b1 100644
--- a/tests/auto/blackbox/testdata/setup-run-environment/setup-run-environment.qbs
+++ b/tests/auto/blackbox/testdata/setup-run-environment/setup-run-environment.qbs
@@ -1,4 +1,5 @@
import qbs.FileInfo
+import qbs.Host
Project {
DynamicLibrary { // Product dependency, installed
@@ -64,7 +65,7 @@ Project {
// Testing shows that clang (8.0) does not find dynamic libraries via
// the -L<dir> and -l<libname> mechanism unless the name is "lib<libname>.a".
Properties {
- condition: qbs.hostOS.contains("windows") && qbs.toolchain.contains("clang")
+ condition: Host.os().contains("windows") && qbs.toolchain.contains("clang")
cpp.dynamicLibraryPrefix: "lib"
cpp.dynamicLibraryImportSuffix: ".a"
}
@@ -91,7 +92,7 @@ Project {
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs b/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs
index 63789a182..086a9455b 100644
--- a/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs
+++ b/tests/auto/blackbox/testdata/symbolLinkMode/symbolLinkMode.qbs
@@ -1,4 +1,5 @@
import qbs.FileInfo
+import qbs.Host
Project {
property bool shouldInstallLibrary: true
@@ -6,7 +7,7 @@ Project {
Application {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/trackAddFile/after/trackAddFile.qbs b/tests/auto/blackbox/testdata/trackAddFile/after/trackAddFile.qbs
index 113f44316..4d454d4ff 100644
--- a/tests/auto/blackbox/testdata/trackAddFile/after/trackAddFile.qbs
+++ b/tests/auto/blackbox/testdata/trackAddFile/after/trackAddFile.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
Project {
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/trackAddFile/before/trackAddFile.qbs b/tests/auto/blackbox/testdata/trackAddFile/before/trackAddFile.qbs
index 74efdf8f7..fd858b247 100644
--- a/tests/auto/blackbox/testdata/trackAddFile/before/trackAddFile.qbs
+++ b/tests/auto/blackbox/testdata/trackAddFile/before/trackAddFile.qbs
@@ -1,7 +1,9 @@
+import qbs.Host
+
Project {
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/trackFileTags/after/trackFileTags.qbs b/tests/auto/blackbox/testdata/trackFileTags/after/trackFileTags.qbs
index 1d589978a..1c5b6b56f 100644
--- a/tests/auto/blackbox/testdata/trackFileTags/after/trackFileTags.qbs
+++ b/tests/auto/blackbox/testdata/trackFileTags/after/trackFileTags.qbs
@@ -1,9 +1,11 @@
import qbs.TextFile
+import qbs.Host
+
Project {
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/trackFileTags/before/trackFileTags.qbs b/tests/auto/blackbox/testdata/trackFileTags/before/trackFileTags.qbs
index 4c9e77dd8..86771ab8f 100644
--- a/tests/auto/blackbox/testdata/trackFileTags/before/trackFileTags.qbs
+++ b/tests/auto/blackbox/testdata/trackFileTags/before/trackFileTags.qbs
@@ -1,9 +1,11 @@
import qbs.TextFile
+import qbs.Host
+
Project {
Product {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/blackbox/testdata/vcs/vcstest.qbs b/tests/auto/blackbox/testdata/vcs/vcstest.qbs
index dabe889b6..4f861654b 100644
--- a/tests/auto/blackbox/testdata/vcs/vcstest.qbs
+++ b/tests/auto/blackbox/testdata/vcs/vcstest.qbs
@@ -1,6 +1,8 @@
+import qbs.Host
+
CppApplication {
condition: {
- var result = qbs.targetPlatform === qbs.hostPlatform;
+ var result = qbs.targetPlatform === Host.platform();
if (!result)
console.info("targetPlatform differs from hostPlatform");
return result;
diff --git a/tests/auto/language/testdata/getNativeSetting.qbs b/tests/auto/language/testdata/getNativeSetting.qbs
index 975aefebc..c8126bb10 100644
--- a/tests/auto/language/testdata/getNativeSetting.qbs
+++ b/tests/auto/language/testdata/getNativeSetting.qbs
@@ -1,13 +1,15 @@
import qbs.FileInfo
import qbs.Utilities
+import qbs.Host
+
Project {
Product {
name: "p1"
targetName: {
- if (qbs.hostOS.contains("macos")) {
+ if (Host.os().contains("macos")) {
return Utilities.getNativeSetting("/System/Library/CoreServices/SystemVersion.plist", "ProductName");
- } else if (qbs.hostOS.contains("windows")) {
+ } else if (Host.os().contains("windows")) {
var productName = Utilities.getNativeSetting("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion", "ProductName");
if (productName.contains("Windows")) {
return "Windows";