Пример #1
0
 def _product_node(self, dependency):
   variants = self.variants
   if getattr(self.subject, 'variants', None):
     # A subject's default variants are only used if a dependent has not overridden them.
     variants = Variants.merge(self.subject.variants.items(), variants)
   if dependency.address:
     # If a subject has a literal variant for particular dependencies, it wins over all else.
     variants = Variants.merge(variants, extract_variants(dependency.address))
   return SelectNode(dependency, self.product, variants)
Пример #2
0
 def _product_node(self, dependency):
     variants = self.variants
     if getattr(self.subject, 'variants', None):
         # A subject's default variants are only used if a dependent has not overridden them.
         variants = Variants.merge(self.subject.variants.items(), variants)
     if dependency.address:
         # If a subject has a literal variant for particular dependencies, it wins over all else.
         variants = Variants.merge(variants,
                                   extract_variants(dependency.address))
     return SelectNode(dependency, self.product, variants)
Пример #3
0
  def _create_roots(self, build_request):
    # Determine the root products and subjects based on the request.
    root_subjects = [(self._graph.resolve(a), extract_variants(a))
                     for a in build_request.addressable_roots]
    root_products = OrderedSet()
    for goal in build_request.goals:
      root_products.update(self._products_by_goal[goal])

    # Roots are products that might be possible to produce for these subjects.
    # TODO: allow specifying variants per Subject as part BuildRequest parsing.
    return [SelectNode(s, p, v) for s, v in root_subjects for p in root_products]
Пример #4
0
    def _create_roots(self, build_request):
        # Determine the root products and subjects based on the request.
        root_subjects = [(self._graph.resolve(a), extract_variants(a))
                         for a in build_request.addressable_roots]
        root_products = OrderedSet()
        for goal in build_request.goals:
            root_products.update(self._products_by_goal[goal])

        # Roots are products that might be possible to produce for these subjects.
        # TODO: allow specifying variants per Subject as part BuildRequest parsing.
        return [
            SelectNode(s, p, v) for s, v in root_subjects
            for p in root_products
        ]