コード例 #1
0
ファイル: ide.py プロジェクト: collude/collude
        def configure_target(target):
            if target not in analyzed:
                analyzed.add(target)

                self.has_scala = self.has_scala or is_scala(target)

                if isinstance(target, JavaLibrary) or isinstance(
                        target, ScalaLibrary):
                    # TODO(John Sirois): this does not handle test resources, make test resources 1st class
                    # in ant build and punch this through to pants model
                    resources = set()
                    if target.resources:
                        resources.update(target.resources)
                    if target.binary_resources:
                        resources.update(target.binary_resources)
                    if resources:
                        self.resource_extensions.update(
                            Project.extract_resource_extensions(resources))
                        configure_source_sets(RESOURCES_BASE_DIR,
                                              resources,
                                              is_test=False)

                if target.sources:
                    test = is_test(target)
                    self.has_tests = self.has_tests or test
                    configure_source_sets(target.target_base,
                                          target.sources,
                                          is_test=test)

                siblings = Target.get_all_addresses(target.address.buildfile)
                return filter(
                    accept_target,
                    [Target.get(a) for a in siblings if a != target.address])
コード例 #2
0
ファイル: ide.py プロジェクト: collude/collude
    def configure_target(target):
      if target not in analyzed:
        analyzed.add(target)

        self.has_scala = self.has_scala or is_scala(target)

        if isinstance(target, JavaLibrary) or isinstance(target, ScalaLibrary):
          # TODO(John Sirois): this does not handle test resources, make test resources 1st class
          # in ant build and punch this through to pants model
          resources = set()
          if target.resources:
            resources.update(target.resources)
          if target.binary_resources:
            resources.update(target.binary_resources)
          if resources:
            self.resource_extensions.update(Project.extract_resource_extensions(resources))
            configure_source_sets(RESOURCES_BASE_DIR, resources, is_test = False)

        if target.sources:
          test = is_test(target)
          self.has_tests = self.has_tests or test
          configure_source_sets(target.target_base, target.sources, is_test = test)

        siblings = Target.get_all_addresses(target.address.buildfile)
        return filter(accept_target, [ Target.get(a) for a in siblings if a != target.address ])
コード例 #3
0
  def build(self, targets, args):
    for target in targets:
      assert is_python(target), "PythonBuilder can only build PythonTargets, given %s" % str(target)
      if not is_test(target):
        raise Exception("PythonBuilder cannot handle target: %s" % str(target))

    return self._run_tests(targets, args)
コード例 #4
0
ファイル: lib.py プロジェクト: collude/collude
 def is_transitive():
     if self.ide_transitivity == TRANSITIVITY_TESTS:
         return is_test
     if self.ide_transitivity == TRANSITIVITY_ALL:
         return lambda target: True
     if self.ide_transitivity == TRANSITIVITY_NONE:
         return lambda target: False
     if self.ide_transitivity == TRANSITIVITY_SOURCES:
         return lambda target: not is_test(target)
コード例 #5
0
ファイル: lib.py プロジェクト: collude/collude
 def is_transitive():
   if self.ide_transitivity == TRANSITIVITY_TESTS:
     return is_test
   if self.ide_transitivity == TRANSITIVITY_ALL:
     return lambda target: True
   if self.ide_transitivity == TRANSITIVITY_NONE:
     return lambda target: False
   if self.ide_transitivity == TRANSITIVITY_SOURCES:
     return lambda target: not is_test(target)