[QBS] A Rule with more than one Artifact?

Joerg Bornemann joerg.bornemann at nokia.com
Tue Sep 11 11:39:31 CEST 2012


On 10/09/2012 23:28, ext William Gallafent wrote:

> For the record (and correct me if I've got this wrong!), if one has
> multiple Artifacts in a Rule, the "output" variable is undefined in
> the prepare statement. Instead there is a variable outputs which may
> be referenced using outputs [X][Y] to obtain an "output" type object,
> where X is the fileTag of the Artifact and Y is 0 (at least in my
> experience so far). So instead of output.fileName one may say
> outputs["cpp"][0].fileName for example.

That's right. The variable output only exists, if there is only one 
output. This is just a convenience short cut. To be on the safe side wrt 
changes in your rule, you can always use outputs.
The same applies to input / inputs BTW.

> Is there a wiki where little recipes like this are written down to
> save neophytes like me from having to roam the wilds of
> modules/cpp/msvc.js to see how it all fits together?

There is a wiki page http://qt-project.org/wiki/qbs
with a quick reference and useful links.
That might count as a recipe collection. :)


Cheers,

Jörg




More information about the Qbs mailing list