[QBS] Probe properties not working?
Jake Thomas Petroules
jake.petroules at petroules.com
Tue Mar 5 23:04:16 CET 2013
It appears that reading Probe properties works fine when inside a Properties section, but not a Group. My mistake!
Jake Petroules
Petroules Corporation (www.petroules.com)
Email: jake.petroules at petroules.com
Telephone: +1 (970) 587-3821
On Mar 5, 2013, at 4:12 PM, Jake Thomas Petroules <jake.petroules at petroules.com> wrote:
> Hi All,
>
> It seems to me that the properties of Probe items don't get set. For example, if I run this file through QBS:
>
> import qbs.base 1.0
> import qbs.probes as Probes
> import qbs.fileinfo as FileInfo
> import "<path to qbs>/share/qbs/imports/qbs/probes/utils.js" as Utils
>
> CppApplication {
> Depends { name: "cpp" }
> name: "foo"
> files: "main.c"
>
> Probes.PathProbe {
> id: foo
> platformPaths: [
> "~/Downloads",
> "/Users/jakepetroules/Downloads"
> ]
>
> names: [ "test.txt" ]
> }
>
> Group {
> name: {
> print("found: " + foo.found)
> print("path: " + foo.path)
> print("filePath: " + foo.filePath)
> return "bar"
> }
>
> files: "dummy.txt"
> }
> }
>
> I receive the following output:
>
> Loading project
> found: false
> path: undefined
> filePath: undefined
> Resolving project
> Building
> generating PkgInfo
> generating Info.plist
> compiling main.c
> linking foo
> generating app bundle
> Build done.
>
> /Users/jakepetroules/Downloads/test.txt DOES exist and FileInfo.exists() does return true, which I tested by inserting debug print() statements into PathProbe.qbs. So, why are the properties undefined as shown in the output?
>
> I'd open a bug report but I'm not sure yet whether this is a bug or if I've simply done something wrong.
>
> Jake Petroules
> Petroules Corporation (www.petroules.com)
> Email: jake.petroules at petroules.com
>
>
More information about the Qbs
mailing list