예제 #1
0
파일: export.py 프로젝트: OniOni/pants
    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
파일: export.py 프로젝트: zhaohaobing/pants
    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
예제 #3
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
예제 #4
0
 def test_ivy_args(self):
   # A regression test for ivy_mixin_task. UnpackLibraries depends on the mapped jar filename
   # being unique and including the version number. If you are making a change to
   # ivy_task_mixin._get_ivy_args() that maintains both then feel free to update this test.
   ivy_args = [
     '-retrieve', '{}/[organisation]/[artifact]/[conf]/'
                  '[organisation]-[artifact]-[revision](-[classifier]).[ext]'.format('foo'),
     '-symlink',
     ]
   self.assertEqual(ivy_args, IvyTaskMixin._get_ivy_args('foo'))
예제 #5
0
 def test_ivy_args(self):
   # A regression test for ivy_mixin_task. UnpackLibraries depends on the mapped jar filename
   # being unique and including the version number. If you are making a change to
   # ivy_task_mixin._get_ivy_args() that maintains both then feel free to update this test.
   ivy_args = [
     '-retrieve', '{}/[organisation]/[artifact]/[conf]/'
                  '[organisation]-[artifact]-[revision](-[classifier]).[ext]'.format('foo'),
     '-symlink',
     ]
   self.assertEqual(ivy_args, IvyTaskMixin._get_ivy_args('foo'))