code: def add_alternative (self, target_instance):
          
          assert isinstance(target_instance, AbstractTarget)
          if self.built_main_targets_:
              raise IllegalOperation ("add-alternative called when main targets are already created for project '%s'" % self.full_name ())
  
          self.alternatives_.append (target_instance)
docs: Add new target alternative.