Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-02-14 03:14:39


On Monday 13 February 2006 20:28, Daniel Einspanjer wrote:
> "Vladimir Prus" <ghost_at_[hidden]> wrote in message
> news:200602131305.32815.ghost_at_cs.msu.su...
>
> > Not extra nice, and not better than what you've proposed, but that's how
> > I did
> > it before. Maybe, we just need 'virtual-target.select-by-type' helper
> > rule,
> > so that above can be rewritten as:
> >
> > rule generated-targets ( sources + : property-set : project name ? )
> > {
> > return [ generator.generated-targets
> > [ virtual-target.select-by-type XML : $(sources) ]
> > [ virtual-target.select-by-type XSLT : $(sources) ]
> >
> > : $(property-set) : $(project) $(name) ] ;
> >
> > }
> >
> > Mark, Daniel, what do you think?
>
> The helper rule sounds useful in this case. Do you think there would be
> enough other problems solved by similar logic to make it worthwhile?

I had similar logic in a couple of other cases, at least.

> I am also wondering about extended scenarios similar to my presented
> situation. For instance, what would a user do if they wanted to be able to
> specify an arbitrary number of xml and/or xsl files? I would envision that
> being something the user might wish to do if they wanted to give a list of
> xml files that should all be run through all given xsl files making a
> Cartesian product.

Then, you'd probably have this:

   local xml = [ virtual-target.select-by-type XML : $(sources) ] ;
   local xsl = [ virtual-target.select-by-type XSLT : $(sources) ] ;
   for local i1 in $(xml)
   {
                for local i2 in $(xsl)
                {
                        # Create action/target as needed
                }
   }

- Volodya


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk