aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2018-11-26 22:09:02 +0100
committerIvan Komissarov <ABBAPOH@gmail.com>2018-12-10 18:21:07 +0000
commitd6345df9d51f4a122ba01172c927adaf6d898a80 (patch)
treef5c11745056464958b5b5bee9a40cc4cdeb77f28
parentc45593d3c8a2a9086e697e2dfa3974bd54188a95 (diff)
Rename PathProbe.pathPrefixes and PathProbe.platformPaths properties
The naming was misleading - prefixes had the same logical meaning as platformPaths, despite the fact completely different PathProbe.pathSuffixes property exists. Change-Id: Ie593b5e03d27de4f8aafed821a3b37cc1b3b0b9e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs4
-rw-r--r--share/qbs/imports/qbs/Probes/AndroidSdkProbe.qbs4
-rw-r--r--share/qbs/imports/qbs/Probes/BinaryProbe.qbs2
-rw-r--r--share/qbs/imports/qbs/Probes/FrameworkProbe.qbs2
-rw-r--r--share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs6
-rw-r--r--share/qbs/imports/qbs/Probes/JdkProbe.qbs4
-rw-r--r--share/qbs/imports/qbs/Probes/LibraryProbe.qbs2
-rw-r--r--share/qbs/imports/qbs/Probes/NodeJsProbe.qbs2
-rw-r--r--share/qbs/imports/qbs/Probes/NpmProbe.qbs7
-rw-r--r--share/qbs/imports/qbs/Probes/PathProbe.qbs18
-rw-r--r--share/qbs/imports/qbs/Probes/TypeScriptProbe.qbs9
-rw-r--r--share/qbs/imports/qbs/Probes/path-probe.js4
-rw-r--r--share/qbs/modules/archiver/archiver.qbs2
-rw-r--r--share/qbs/modules/cli/mono.qbs2
-rw-r--r--share/qbs/modules/cpp/DarwinGCC.qbs2
-rw-r--r--share/qbs/modules/nodejs/NodeJS.qbs4
-rw-r--r--share/qbs/modules/qnx/qnx.qbs2
-rw-r--r--src/packages/chocolatey/chocolatey.qbs2
-rw-r--r--tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs2
-rw-r--r--tests/auto/blackbox/testdata/includeLookup/modules/definition/module.qbs2
-rw-r--r--tests/auto/blackbox/testdata/probeProperties/probeProperties.qbs4
21 files changed, 49 insertions, 37 deletions
diff --git a/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs b/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs
index c73a7f2d3..d7c80144e 100644
--- a/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/AndroidNdkProbe.qbs
@@ -40,7 +40,7 @@ PathProbe {
property path sdkPath
environmentPaths: Environment.getEnv("ANDROID_NDK_ROOT")
- platformPaths: {
+ platformSearchPaths: {
var paths = [];
if (sdkPath)
paths.push(FileInfo.joinPaths(sdkPath, "ndk-bundle"));
@@ -78,7 +78,7 @@ PathProbe {
return result;
}
- var i, j, allPaths = (environmentPaths || []).concat(platformPaths || []);
+ var i, j, allPaths = (environmentPaths || []).concat(platformSearchPaths || []);
candidatePaths = allPaths;
for (i in allPaths) {
var platforms = [];
diff --git a/share/qbs/imports/qbs/Probes/AndroidSdkProbe.qbs b/share/qbs/imports/qbs/Probes/AndroidSdkProbe.qbs
index 076b36d72..28a9c568a 100644
--- a/share/qbs/imports/qbs/Probes/AndroidSdkProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/AndroidSdkProbe.qbs
@@ -35,7 +35,7 @@ import "../../../modules/Android/sdk/utils.js" as SdkUtils
BinaryProbe {
environmentPaths: Environment.getEnv("ANDROID_HOME")
- platformPaths: {
+ platformSearchPaths: {
if (qbs.hostOS.contains("windows"))
return [FileInfo.joinPaths(Environment.getEnv("LOCALAPPDATA"), "Android", "sdk")];
if (qbs.hostOS.contains("macos"))
@@ -53,7 +53,7 @@ BinaryProbe {
configure: {
var suffixes = nameSuffixes || [""];
- var i, allPaths = (environmentPaths || []).concat(platformPaths || []);
+ var i, allPaths = (environmentPaths || []).concat(platformSearchPaths || []);
candidatePaths = allPaths;
for (i in allPaths) {
for (var j in suffixes) {
diff --git a/share/qbs/imports/qbs/Probes/BinaryProbe.qbs b/share/qbs/imports/qbs/Probes/BinaryProbe.qbs
index 16fde72cb..0bb264bd6 100644
--- a/share/qbs/imports/qbs/Probes/BinaryProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/BinaryProbe.qbs
@@ -30,6 +30,6 @@
PathProbe {
nameSuffixes: qbs.hostOS.contains("windows") ? [".com", ".exe", ".bat", ".cmd"] : undefined
- platformPaths: hostOS.contains("unix") ? ["/usr/bin", "/usr/local/bin"] : []
+ platformSearchPaths: hostOS.contains("unix") ? ["/usr/bin", "/usr/local/bin"] : []
platformEnvironmentPaths: [ "PATH" ]
}
diff --git a/share/qbs/imports/qbs/Probes/FrameworkProbe.qbs b/share/qbs/imports/qbs/Probes/FrameworkProbe.qbs
index da5557cc9..e0fe73b40 100644
--- a/share/qbs/imports/qbs/Probes/FrameworkProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/FrameworkProbe.qbs
@@ -29,7 +29,7 @@
****************************************************************************/
PathProbe {
- platformPaths: (qbs.sysroot ? [qbs.sysroot + "/System/Library/Frameworks"] : []).concat([
+ platformSearchPaths: (qbs.sysroot ? [qbs.sysroot + "/System/Library/Frameworks"] : []).concat([
"~/Library/Frameworks",
"/usr/local/lib",
"/Library/Frameworks",
diff --git a/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs b/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs
index 1db1291cc..6ebaff8be 100644
--- a/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs
@@ -10,7 +10,7 @@ BinaryProbe {
// Outputs
property string tcPrefix
- platformPaths: {
+ platformSearchPaths: {
var paths = base;
if (qbs.targetOS.contains("windows") && qbs.hostOS.contains("windows"))
paths.push(FileInfo.joinPaths(
@@ -47,8 +47,8 @@ BinaryProbe {
}
configure: {
- var result = PathProbeConfigure.configure(names, nameSuffixes, nameFilter, pathPrefixes,
- pathSuffixes, platformPaths, environmentPaths,
+ var result = PathProbeConfigure.configure(names, nameSuffixes, nameFilter, searchPaths,
+ pathSuffixes, platformSearchPaths, environmentPaths,
platformEnvironmentPaths, pathListSeparator);
found = result.found;
candidatePaths = result.candidatePaths;
diff --git a/share/qbs/imports/qbs/Probes/JdkProbe.qbs b/share/qbs/imports/qbs/Probes/JdkProbe.qbs
index 2f72f552b..1f414b0fa 100644
--- a/share/qbs/imports/qbs/Probes/JdkProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/JdkProbe.qbs
@@ -40,14 +40,14 @@ PathProbe {
&& !qbs.hostOS.contains("android")
environmentPaths: Environment.getEnv("JAVA_HOME")
- platformPaths: [
+ platformSearchPaths: [
"/usr/lib/jvm/default-java", // Debian/Ubuntu
"/etc/alternatives/java_sdk_openjdk", // Fedora
"/usr/lib/jvm/default" // Arch
]
configure: {
- path = JavaUtils.findJdkPath(hostOS, architecture, environmentPaths, platformPaths);
+ path = JavaUtils.findJdkPath(hostOS, architecture, environmentPaths, platformSearchPaths);
found = !!path;
}
}
diff --git a/share/qbs/imports/qbs/Probes/LibraryProbe.qbs b/share/qbs/imports/qbs/Probes/LibraryProbe.qbs
index b81a15dcb..26787d1b4 100644
--- a/share/qbs/imports/qbs/Probes/LibraryProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/LibraryProbe.qbs
@@ -36,7 +36,7 @@ PathProbe {
return [".dylib", ".a"];
return [".so", ".a"];
}
- platformPaths: qbs.targetOS.contains("unix") ? [
+ platformSearchPaths: qbs.targetOS.contains("unix") ? [
"/usr/lib",
"/usr/local/lib",
] : []
diff --git a/share/qbs/imports/qbs/Probes/NodeJsProbe.qbs b/share/qbs/imports/qbs/Probes/NodeJsProbe.qbs
index 45623553b..b0162c715 100644
--- a/share/qbs/imports/qbs/Probes/NodeJsProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/NodeJsProbe.qbs
@@ -33,7 +33,7 @@ import qbs.FileInfo
BinaryProbe {
names: ["node", "nodejs"]
- platformPaths: {
+ platformSearchPaths: {
var paths = base;
if (qbs.hostOS.contains("windows")) {
var env32 = Environment.getEnv("PROGRAMFILES(X86)");
diff --git a/share/qbs/imports/qbs/Probes/NpmProbe.qbs b/share/qbs/imports/qbs/Probes/NpmProbe.qbs
index 55f848965..4e8124d56 100644
--- a/share/qbs/imports/qbs/Probes/NpmProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/NpmProbe.qbs
@@ -47,9 +47,10 @@ NodeJsProbe {
if (!interpreterPath)
throw '"interpreterPath" must be specified';
- var result = PathProbeConfigure.configure(names, nameSuffixes, nameFilter, pathPrefixes,
- pathSuffixes, platformPaths, environmentPaths,
- platformEnvironmentPaths, pathListSeparator);
+ var result = PathProbeConfigure.configure(names, nameSuffixes, nameFilter, searchPaths,
+ pathSuffixes, platformSearchPaths,
+ environmentPaths, platformEnvironmentPaths,
+ pathListSeparator);
var v = new ModUtils.EnvironmentVariable("PATH", pathListSeparator,
hostOS.contains("windows"));
diff --git a/share/qbs/imports/qbs/Probes/PathProbe.qbs b/share/qbs/imports/qbs/Probes/PathProbe.qbs
index b88a69925..1235ce211 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.ModUtils
Probe {
// Inputs
@@ -36,8 +37,10 @@ Probe {
property stringList nameSuffixes
property var nameFilter
property pathList pathPrefixes
+ property pathList searchPaths
property stringList pathSuffixes
- property pathList platformPaths: hostOS.contains("unix") ? ['/usr', '/usr/local'] : []
+ property pathList platformSearchPaths: hostOS.contains("unix") ? ['/usr', '/usr/local'] : []
+ property pathList platformPaths
property stringList environmentPaths
property stringList platformEnvironmentPaths
property stringList hostOS: qbs.hostOS
@@ -50,9 +53,16 @@ Probe {
property string fileName
configure: {
- var result = PathProbeConfigure.configure(names, nameSuffixes, nameFilter, pathPrefixes,
- pathSuffixes, platformPaths, environmentPaths,
- platformEnvironmentPaths, pathListSeparator);
+ if (pathPrefixes)
+ console.warn("PathProbe.pathPrefixes is deprecated, use searchPaths instead");
+ if (platformPaths)
+ console.warn("PathProbe.platformPaths is deprecated, use platformSearchPaths instead");
+ var _searchPaths = ModUtils.concatAll(pathPrefixes, searchPaths);
+ var _platformSearchPaths = ModUtils.concatAll(platformPaths, platformSearchPaths);
+ var result = PathProbeConfigure.configure(names, nameSuffixes, nameFilter, _searchPaths,
+ pathSuffixes, _platformSearchPaths,
+ environmentPaths, platformEnvironmentPaths,
+ pathListSeparator);
found = result.found;
candidatePaths = result.candidatePaths;
path = result.path;
diff --git a/share/qbs/imports/qbs/Probes/TypeScriptProbe.qbs b/share/qbs/imports/qbs/Probes/TypeScriptProbe.qbs
index 3eeb95342..de28fa327 100644
--- a/share/qbs/imports/qbs/Probes/TypeScriptProbe.qbs
+++ b/share/qbs/imports/qbs/Probes/TypeScriptProbe.qbs
@@ -37,7 +37,7 @@ import "../../../modules/typescript/typescript.js" as TypeScript
BinaryProbe {
id: tsc
names: ["tsc"]
- pathPrefixes: packageManagerBinPath ? [packageManagerBinPath] : []
+ searchPaths: packageManagerBinPath ? [packageManagerBinPath] : []
// Inputs
property path interpreterPath
@@ -57,9 +57,10 @@ BinaryProbe {
if (!packageManagerRootPath)
throw '"packageManagerRootPath" must be specified';
- var result = PathProbeConfigure.configure(names, nameSuffixes, nameFilter, pathPrefixes,
- pathSuffixes, platformPaths, environmentPaths,
- platformEnvironmentPaths, pathListSeparator);
+ var result = PathProbeConfigure.configure(names, nameSuffixes, nameFilter, searchPaths,
+ pathSuffixes, platformSearchPaths,
+ environmentPaths, platformEnvironmentPaths,
+ pathListSeparator);
var v = new ModUtils.EnvironmentVariable("PATH", pathListSeparator,
hostOS.contains("windows"));
diff --git a/share/qbs/imports/qbs/Probes/path-probe.js b/share/qbs/imports/qbs/Probes/path-probe.js
index bf30e8ec6..a48a7e4fe 100644
--- a/share/qbs/imports/qbs/Probes/path-probe.js
+++ b/share/qbs/imports/qbs/Probes/path-probe.js
@@ -33,7 +33,7 @@ var File = require("qbs.File");
var FileInfo = require("qbs.FileInfo");
var ModUtils = require("qbs.ModUtils");
-function configure(names, nameSuffixes, nameFilter, pathPrefixes, pathSuffixes, platformPaths,
+function configure(names, nameSuffixes, nameFilter, searchPaths, pathSuffixes, platformSearchPaths,
environmentPaths, platformEnvironmentPaths, pathListSeparator) {
var result = { found: false, candidatePaths: [] };
if (!names)
@@ -45,7 +45,7 @@ function configure(names, nameSuffixes, nameFilter, pathPrefixes, pathSuffixes,
return (nameSuffixes || [""]).map(function(suffix) { return name + suffix; });
}));
// FIXME: Suggest how to obtain paths from system
- var _paths = ModUtils.concatAll(pathPrefixes, platformPaths);
+ var _paths = ModUtils.concatAll(searchPaths, platformSearchPaths);
// FIXME: Add getenv support
var envs = ModUtils.concatAll(platformEnvironmentPaths, environmentPaths);
for (var i = 0; i < envs.length; ++i) {
diff --git a/share/qbs/modules/archiver/archiver.qbs b/share/qbs/modules/archiver/archiver.qbs
index 2b2515084..6ae53dd37 100644
--- a/share/qbs/modules/archiver/archiver.qbs
+++ b/share/qbs/modules/archiver/archiver.qbs
@@ -51,7 +51,7 @@ Module {
Probes.BinaryProbe {
id: sevenZipProbe
names: ["7z"]
- platformPaths: {
+ platformSearchPaths: {
var paths = base;
if (qbs.hostOS.contains("windows")) {
var env32 = Environment.getEnv("PROGRAMFILES(X86)");
diff --git a/share/qbs/modules/cli/mono.qbs b/share/qbs/modules/cli/mono.qbs
index 30e8c4726..f04956a5e 100644
--- a/share/qbs/modules/cli/mono.qbs
+++ b/share/qbs/modules/cli/mono.qbs
@@ -12,7 +12,7 @@ CLIModule {
Probes.PathProbe {
id: monoProbe
names: ["mono"]
- platformPaths: {
+ platformSearchPaths: {
var paths = [];
if (qbs.hostOS.contains("macos"))
paths.push("/Library/Frameworks/Mono.framework/Commands");
diff --git a/share/qbs/modules/cpp/DarwinGCC.qbs b/share/qbs/modules/cpp/DarwinGCC.qbs
index a0b191ca1..0bd294fb4 100644
--- a/share/qbs/modules/cpp/DarwinGCC.qbs
+++ b/share/qbs/modules/cpp/DarwinGCC.qbs
@@ -49,7 +49,7 @@ UnixGCC {
id: lipoProbe
condition: !_skipAllChecks
names: [lipoName]
- platformPaths: {
+ platformSearchPaths: {
var paths = (xcode.present && xcode.devicePlatformPath)
? [xcode.devicePlatformPath + "/Developer/usr/bin"]
: [];
diff --git a/share/qbs/modules/nodejs/NodeJS.qbs b/share/qbs/modules/nodejs/NodeJS.qbs
index 484496685..7fd992fdb 100644
--- a/share/qbs/modules/nodejs/NodeJS.qbs
+++ b/share/qbs/modules/nodejs/NodeJS.qbs
@@ -41,12 +41,12 @@ Module {
Probes.NodeJsProbe {
id: nodejs
- pathPrefixes: toolchainInstallPath ? [toolchainInstallPath] : []
+ searchPaths: toolchainInstallPath ? [toolchainInstallPath] : []
}
Probes.NpmProbe {
id: npm
- pathPrefixes: toolchainInstallPath ? [toolchainInstallPath] : []
+ searchPaths: toolchainInstallPath ? [toolchainInstallPath] : []
interpreterPath: FileInfo.path(nodejs.filePath)
}
diff --git a/share/qbs/modules/qnx/qnx.qbs b/share/qbs/modules/qnx/qnx.qbs
index 87b54eca0..9cab5abb6 100644
--- a/share/qbs/modules/qnx/qnx.qbs
+++ b/share/qbs/modules/qnx/qnx.qbs
@@ -39,7 +39,7 @@ Module {
Probes.PathProbe {
id: qnxSdkProbe
names: ["qnx700", "qnx660", "qnx650"]
- pathPrefixes: qbs.hostOS.contains("windows")
+ searchPaths: qbs.hostOS.contains("windows")
? [Environment.getEnv("USERPROFILE"), Environment.getEnv("SystemDrive")]
: [Environment.getEnv("HOME"), "/opt"]
}
diff --git a/src/packages/chocolatey/chocolatey.qbs b/src/packages/chocolatey/chocolatey.qbs
index bb4856dab..cb8dd6bc6 100644
--- a/src/packages/chocolatey/chocolatey.qbs
+++ b/src/packages/chocolatey/chocolatey.qbs
@@ -14,7 +14,7 @@ Product {
id: choco
condition: qbs.targetOS.contains("windows")
names: ["choco"]
- platformPaths: {
+ platformSearchPaths: {
var chocolateyInstall = Environment.getEnv("ChocolateyInstall");
if (chocolateyInstall)
return [FileInfo.joinPaths(chocolateyInstall, "bin")];
diff --git a/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs b/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs
index 5b50b5000..00c93a2ac 100644
--- a/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs
+++ b/tests/auto/blackbox/testdata/dynamicRuleOutputs/before/genlexer.qbs
@@ -53,7 +53,7 @@ Project {
Probes.PathProbe {
id: flexProbe
names: ["flex"]
- platformPaths: ["/usr/local/bin", "/usr/bin", "/bin"]
+ platformSearchPaths: ["/usr/local/bin", "/usr/bin", "/bin"]
}
property bool isFlexAvailable: flexProbe.found
Rule {
diff --git a/tests/auto/blackbox/testdata/includeLookup/modules/definition/module.qbs b/tests/auto/blackbox/testdata/includeLookup/modules/definition/module.qbs
index c28fd1310..8762a780a 100644
--- a/tests/auto/blackbox/testdata/includeLookup/modules/definition/module.qbs
+++ b/tests/auto/blackbox/testdata/includeLookup/modules/definition/module.qbs
@@ -7,7 +7,7 @@ Module {
Probes.IncludeProbe {
id: includeNode
names: "fakeopenssl/sha.h"
- platformPaths: [modulePath]
+ platformSearchPaths: [modulePath]
}
cpp.defines: includeNode.found ? 'TEXT="' + includeNode.path + '"' : undefined
}
diff --git a/tests/auto/blackbox/testdata/probeProperties/probeProperties.qbs b/tests/auto/blackbox/testdata/probeProperties/probeProperties.qbs
index 673e478b8..9846eacef 100644
--- a/tests/auto/blackbox/testdata/probeProperties/probeProperties.qbs
+++ b/tests/auto/blackbox/testdata/probeProperties/probeProperties.qbs
@@ -4,13 +4,13 @@ CppApplication {
Probes.PathProbe {
id: probe1
names: ["bin/tool"]
- platformPaths: [product.sourceDirectory]
+ platformSearchPaths: [product.sourceDirectory]
}
Probes.PathProbe {
id: probe2
names: ["tool"]
- platformPaths: [product.sourceDirectory + "/bin"]
+ platformSearchPaths: [product.sourceDirectory + "/bin"]
}
targetName: {