Given something like so..
There is a way you can do this with minimal changes to your existing sample code. You can combine metadata from ConfigFiles items and DatabaseConfig items into a new "combined" item and then output that "combined" item.
To combine the metadata, use target batching with the batched target running once for each DatabaseConfig item. Then you can call another target to output the combined metadata to get the output you described. Take a look at my extension of your sample code to see how this would all be accomplished:
DB1
Database
DB2
Logging
%(DatabaseConfig.Database)
What's happening in the sample:
test target now just serves as a way to call two other targets to perform the work: test_setup, and test_output test_setup target is batched and creates the new
CombinedOutput items. test_output target is called after test_setup
to output the CombinedOutput items' metadata.Output from test_output:
one.config DB1
two.config DB1
one.config DB2
two.config DB2