Exemple #1
0
  def execute(self):
    jvm_targets = OrderedSet(extract_jvm_targets(self.targets))
    if not jvm_targets:
      raise Exception("Only jvm targets currently handled and none found in: %s" % self.targets)

    skip_java = not self.options.java
    skip_scala = not self.options.scala

    checkstyle_suppression_files = self._load_checkstyle_suppressions()
    project = Project(self.project_name,
                      self.options.python,
                      skip_java,
                      skip_scala,
                      self.root_dir,
                      checkstyle_suppression_files,
                      jvm_targets)
    all_targets = project.configure(self.scala_compiler_profile)

    foil = list(all_targets)[0]
    def is_cp(target):
      return target.is_codegen \
             or is_apt(target) \
             or (skip_java and is_java(target)) \
             or (skip_scala and is_scala(target))

    ide_target = foil.do_in_context(lambda: extract_target(all_targets, is_cp))

    ivyfile, ivysettingsfile = self._generate_ivy(ide_target)
    return self._generate_project_files(project, ivyfile, ivysettingsfile)
Exemple #2
0
  def configure_project(self, targets, checkstyle_suppression_files, debug_port,
                        scala_compiler_profile):

    jvm_targets = extract_jvm_targets(targets)
    if self.intransitive:
      jvm_targets = set(self.context.target_roots).intersection(jvm_targets)
    project = Project(self.project_name,
                      self.python,
                      self.skip_java,
                      self.skip_scala,
                      get_buildroot(),
                      checkstyle_suppression_files,
                      debug_port,
                      jvm_targets,
                      not self.intransitive,
                      self.context.new_workunit)

    if self.python:
      python_source_paths = self.context.config.getlist('ide', 'python_source_paths', default=[])
      python_test_paths = self.context.config.getlist('ide', 'python_test_paths', default=[])
      python_lib_paths = self.context.config.getlist('ide', 'python_lib_paths', default=[])
      project.configure_python(python_source_paths, python_test_paths, python_lib_paths)

    extra_source_paths = self.context.config.getlist('ide', 'extra_jvm_source_paths', default=[])
    extra_test_paths = self.context.config.getlist('ide', 'extra_jvm_test_paths', default=[])
    all_targets = project.configure_jvm(
      scala_compiler_profile,
      extra_source_paths,
      extra_test_paths
    )
    return all_targets, project
Exemple #3
0
    def configure_project(self, targets, checkstyle_suppression_files,
                          debug_port, scala_compiler_profile):

        jvm_targets = extract_jvm_targets(targets)
        if self.intransitive:
            jvm_targets = set(
                self.context.target_roots).intersection(jvm_targets)
        project = Project(self.project_name,
                          self.python, self.skip_java, self.skip_scala,
                          get_buildroot(), checkstyle_suppression_files,
                          debug_port, jvm_targets, not self.intransitive,
                          self.context.new_workunit)

        if self.python:
            python_source_paths = self.context.config.getlist(
                'ide', 'python_source_paths', default=[])
            python_test_paths = self.context.config.getlist(
                'ide', 'python_test_paths', default=[])
            python_lib_paths = self.context.config.getlist('ide',
                                                           'python_lib_paths',
                                                           default=[])
            project.configure_python(python_source_paths, python_test_paths,
                                     python_lib_paths)

        extra_source_paths = self.context.config.getlist(
            'ide', 'extra_jvm_source_paths', default=[])
        extra_test_paths = self.context.config.getlist('ide',
                                                       'extra_jvm_test_paths',
                                                       default=[])
        all_targets = project.configure_jvm(scala_compiler_profile,
                                            extra_source_paths,
                                            extra_test_paths)
        return all_targets, project
Exemple #4
0
  def execute(self):
    jvm_targets = OrderedSet(extract_jvm_targets(self.targets))
    if not jvm_targets:
      raise Exception("Only jvm targets currently handled and none found in: %s" % self.targets)

    project = Project(self.project_name, self.options.python, self.root_dir, jvm_targets)
    all_targets = project.configure()
    ivyfile, ivysettingsfile = self._generate_ivy(all_targets)
    self._generate_project_files(project, ivyfile, ivysettingsfile)
Exemple #5
0
    def execute(self):
        jvm_targets = OrderedSet(extract_jvm_targets(self.targets))
        if not jvm_targets:
            raise Exception(
                "Only jvm targets currently handled and none found in: %s" %
                self.targets)

        project = Project(self.project_name, self.options.python,
                          self.root_dir, jvm_targets)
        all_targets = project.configure()
        ivyfile, ivysettingsfile = self._generate_ivy(all_targets)
        self._generate_project_files(project, ivyfile, ivysettingsfile)
Exemple #6
0
  def execute(self):
    print("Build operating on targets: %s" % self.targets)

    jvm_targets = OrderedSet()
    python_targets = OrderedSet()
    for target in self.targets:
      targets = list(extract_jvm_targets([target]))
      if targets:
        jvm_targets.update(targets)
      elif is_python(target):
        python_targets.add(target)
      else:
        self.error("Cannot build target %s" % target)

    if jvm_targets:
      status = self._jvm_build(jvm_targets)
      if status != 0:
        return status

    if python_targets:
      status = self._python_build(python_targets)

    return status
Exemple #7
0
    def execute(self):
        print "Build operating on targets: %s" % self.targets

        jvm_targets = OrderedSet()
        python_targets = OrderedSet()
        for target in self.targets:
            targets = list(extract_jvm_targets([target]))
            if targets:
                jvm_targets.update(targets)
            elif is_python(target):
                python_targets.add(target)
            else:
                self.error("Cannot build target %s" % target)

        if jvm_targets:
            status = self._jvm_build(jvm_targets)
            if status != 0:
                return status

        if python_targets:
            status = self._python_build(python_targets)

        return status