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

2014-11-10 Thread Stéphane Fabry
A transformer can be used without input, just to produce an output 
artifact from nothing.



Le 08-11-14 14:44, Tim Hutt a écrit :


As far as I can see, a Transformer isn't aware of file tags - they act 
on specific file names rather than file types, but yeah they seem to 
overlap a lot and the use case for Transformers isn't totally clear 
from the documentation.


On 8 Nov 2014 13:39, Smirnov Vladimir map...@yandex.ru 
mailto:map...@yandex.ru wrote:


From docs:
-A /multiplex rule/ creates one /transformer/ that takes all input
artifacts with the matching input file tag and creates one or more
artifacts.
-A /simplex rule/ creates one transformer per matching input file.
-A /transformer/ takes zero or more inputs and produces one or
more output artifacts from them.

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?


___
QBS mailing list
QBS@qt-project.org mailto:QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs



___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


--
*Stéphane Fabry*, Project  IT Manager
+32 (0)4 367 07 92
*X-RIS* | /X-Ray Imaging Solutions/
www.xris.eu/contact.html
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


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

2014-11-10 Thread Joerg Bornemann
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
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs