Пример #1
0
  def resolve_jars(self, targets):
    # TODO: Why is this computed directly here instead of taking from the actual product
    # computed by the {Ivy,Coursier}Resolve task?
    executor = SubprocessExecutor(DistributionLocator.cached())
    confs = []
    if self.get_options().libraries:
      confs.append('default')
    if self.get_options().libraries_sources:
      confs.append('sources')
    if self.get_options().libraries_javadocs:
      confs.append('javadoc')

    compile_classpath = None

    if confs:
      compile_classpath = ClasspathProducts(self.get_options().pants_workdir)
      if JvmResolveSubsystem.global_instance().get_options().resolver == 'ivy':
        IvyTaskMixin.resolve(self, executor=executor,
                                          targets=targets,
                                          classpath_products=compile_classpath,
                                          confs=confs)
      else:
        CoursierMixin.resolve(self, targets, compile_classpath,
                              sources=self.get_options().libraries_sources,
                              javadoc=self.get_options().libraries_javadocs,
                              executor=executor)

    return compile_classpath
Пример #2
0
    def resolve_jars(self, targets):
        # TODO: Why is this computed directly here instead of taking from the actual product
        # computed by the {Ivy,Coursier}Resolve task?
        executor = SubprocessExecutor(DistributionLocator.cached())
        confs = []
        if self.get_options().libraries:
            confs.append('default')
        if self.get_options().libraries_sources:
            confs.append('sources')
        if self.get_options().libraries_javadocs:
            confs.append('javadoc')

        compile_classpath = None

        if confs:
            compile_classpath = ClasspathProducts(
                self.get_options().pants_workdir)
            if JvmResolveSubsystem.global_instance().get_options(
            ).resolver == 'ivy':
                IvyTaskMixin.resolve(self,
                                     executor=executor,
                                     targets=targets,
                                     classpath_products=compile_classpath,
                                     confs=confs)
            else:
                CoursierMixin.resolve(
                    self,
                    targets,
                    compile_classpath,
                    sources=self.get_options().libraries_sources,
                    javadoc=self.get_options().libraries_javadocs,
                    executor=executor)

        return compile_classpath
Пример #3
0
    def resolve_jars(self, targets):
        executor = SubprocessExecutor(DistributionLocator.cached())
        confs = []
        if self.get_options().libraries:
            confs.append('default')
        if self.get_options().libraries_sources:
            confs.append('sources')
        if self.get_options().libraries_javadocs:
            confs.append('javadoc')

        compile_classpath = None

        if confs:
            compile_classpath = ClasspathProducts(
                self.get_options().pants_workdir)
            if JvmResolveSubsystem.global_instance().get_options(
            ).resolver == 'ivy':
                IvyTaskMixin.resolve(self,
                                     executor=executor,
                                     targets=targets,
                                     classpath_products=compile_classpath,
                                     confs=confs)
            else:
                CoursierMixin.resolve(
                    self,
                    targets,
                    compile_classpath,
                    sources=self.get_options().libraries_sources,
                    javadoc=self.get_options().libraries_javadocs)

        return compile_classpath