wangyu5 / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

Feature Request: merge list by merging list items #182

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
(Disclaimer: I really don't understand how gyp works, so this may be a silly 
request.)

Use-case:
I was trying to build a target_defaults entry that would let me factor out a 
bunch of repetition in my rules.  But there seems to be no way to move 
commonality out of rules, because each rule is in a list, and when the target 
is merged into the default, its list of rules is merged into the default's list 
of rules.  When this happens we can only prepend, overwrite, or append the 
target's rule into the default rule -- we cannot merge them.

Suggestion:
Add a new list-merge behavior.  If the key ends with a pipe (|), then the 
source list and target list must be the same length, and each element of the 
source list will be merged into the corresponding element of the target list.  
(Mnemonic: | represents bitwise-or, the sort of operation that would "merge" 
two bytes by merging each bit.)

Original issue reported on code.google.com by abl...@google.com on 11 Mar 2011 at 8:02