[QBS] What is the semantic difference between Rule and Transformer?

Joerg Bornemann joerg.bornemann at theqtcompany.com
Mon Nov 10 11:34:48 CET 2014


On 08-Nov-14 14:40, Smirnov Vladimir wrote:

> So I can imagine that Rule wraps some Transformer's functionality. But
> why don't just use only Rules? What can i do with Transformer that Rule
> couldn't cover?

Like Tim already mentioned, rules are triggered by matching file tags, 
transformers OTOH have file paths as input.
Rules can be seen as templates for transformers, or as a generalization.

The only thing you can't do with rules is producing artifacts out of 
thin air, like St├ęphane wrote. But it would be possible to enable rules 
that have no input file tags. Shall we? :)

In qmake land transformers are similar to QMAKE_EXTRA_TARGETS and rules 
are like QMAKE_EXTRA_COMPILERS.


BR,

Joerg



More information about the Qbs mailing list