Unfortunately I don't have any good idea of how this could be done better. For the moment I use a combination of two workarounds:
1. For external modules I add support for the properties to my preprocessor module 2. For internal modules I add a project property that contains a mapping file-name -> property Both are not really nice but at least they work and the overhead is acceptable. One idea (although I don't think that it's a good one) might be to allow enumeration and programmatic generation of module properties. This way one could use them in situations we haven't thought of yet. Enumeration could be done with functions like file.moduleCount(), file.moduleAt(index), file.modulePropertyCount(module), file.modulePropertyAt(module, index) or something similar. Generation of new module-properties would then be done in the expression of a new moduleProperties-property. This could for example use associative arrays or even a new javascript-type. As already mentioned. I don't think this is the ideal solution but on the other side it would be very flexible. Best Regards, Johannes PS: Sorry for sending this twice. Outlook seems to not recognize when I want to respond to a mailing-list. > -----Original Message----- > From: qbs-bounces+johannes.matokic=microchip....@qt-project.org > [mailto:qbs-bounces+johannes.matokic=microchip....@qt-project.org] On > Behalf Of Joerg Bornemann > Sent: Montag, 24. Februar 2014 10:33 > To: qbs@qt-project.org > Subject: Re: [QBS] Preserving independent module-properties when > applying rules > > On 21-Feb-14 11:15, johannes.mato...@microchip.com wrote: > > > How can I preserve the module-properties without adding specific code > > for each possible property to the preprocessor module? > > Right. The output artifacts of a rule inherit the properties that are set on > the > product. We could provide a flag for output artifacts to inherit the > properties > from the input artifact. > Downside: this would be restricted to rules that take exactly on input > artifact. > > Any thoughts on how to solve this more generally or smarter? > > > BR, > > Joerg > _______________________________________________ > QBS mailing list > 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