示例#1
0
    def update_dependee_references(self):
        dependee_targets = self.dependency_graph()[
            # TODO: The **{} seems unnecessary.
            Target(name=self._from_address.target_name,
                   address=self._from_address,
                   build_graph=self.context.build_graph,
                   **{})]

        logging.disable(logging.WARNING)

        buildozer_binary = BuildozerBinary.scoped_instance(self)
        for concrete_target in dependee_targets:
            for formats in [{
                    'from': self._from_address.spec,
                    'to': self._to_address.spec
            }, {
                    'from':
                    ':{}'.format(self._from_address.target_name),
                    'to':
                    ':{}'.format(self._to_address.target_name)
            }]:
                buildozer_binary.execute('replace dependencies {} {}'.format(
                    formats['from'], formats['to']),
                                         spec=concrete_target.address.spec,
                                         context=self.context)

        logging.disable(logging.NOTSET)
示例#2
0
  def update_dependee_references(self):
    dependee_targets = self.dependency_graph()[
      # TODO: The **{} seems unnecessary.
      Target(name=self._from_address.target_name, address=self._from_address, build_graph=self.context.build_graph, **{})
    ]

    logging.disable(logging.WARNING)

    buildozer_binary = BuildozerBinary.scoped_instance(self)
    for concrete_target in dependee_targets:
      for formats in [
        { 'from': self._from_address.spec, 'to': self._to_address.spec },
        { 'from': ':{}'.format(self._from_address.target_name), 'to': ':{}'.format(
          self._to_address.target_name) }
      ]:
        buildozer_binary.execute(
          'replace dependencies {} {}'.format(formats['from'], formats['to']),
          spec=concrete_target.address.spec,
          context=self.context
        )

    logging.disable(logging.NOTSET)
示例#3
0
 def update_original_build_name(self):
     BuildozerBinary.scoped_instance(self).execute(
         'set name {}'.format(self._to_address.target_name),
         spec=self._from_address.spec,
         context=self.context)
示例#4
0
 def _execute_buildozer_script(self, command):
     binary = BuildozerBinary.scoped_instance(self)
     for root in self.context.target_roots:
         binary.execute(command, root.address.spec, context=self.context)
示例#5
0
文件: buildozer.py 项目: benjyw/pants
 def _execute_buildozer_script(self, command):
   binary = BuildozerBinary.scoped_instance(self)
   for root in self.context.target_roots:
     binary.execute(command, root.address.spec, context=self.context)
示例#6
0
 def update_original_build_name(self):
   BuildozerBinary.scoped_instance(self).execute(
     'set name {}'.format(self._to_address.target_name),
     spec=self._from_address.spec,
     context=self.context)