Exemplo n.º 1
0
 def jvmdoc(cls):
     return Jvmdoc(tool_name='javadoc', product_type='javadoc')
Exemplo n.º 2
0
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import (absolute_import, division, generators, nested_scopes,
                        print_function, unicode_literals, with_statement)

import os

from pants.backend.jvm.tasks.jvmdoc_gen import Jvmdoc, JvmdocGen
from pants.base.exceptions import TaskError
from pants_test.jvm.jvm_task_test_base import JvmTaskTestBase

dummydoc = Jvmdoc(tool_name='dummydoc', product_type='dummydoc')


class DummyJvmdocGen(JvmdocGen):
    @classmethod
    def jvmdoc(cls):
        return dummydoc

    def execute(self):
        self.generate_doc(lambda t: True, create_dummydoc_command)


def create_dummydoc_command(classpath, gendir, *targets):
    # here we need to test that we get the expected classpath
    pass


class JvmdocGenTest(JvmTaskTestBase):
Exemplo n.º 3
0
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

import os

from pants.backend.jvm.tasks.jvmdoc_gen import Jvmdoc, JvmdocGen
from pants.base.exceptions import TaskError
from pants.testutil.jvm.jvm_task_test_base import JvmTaskTestBase

dummydoc = Jvmdoc(tool_name="dummydoc", product_type="dummydoc")


class DummyJvmdocGen(JvmdocGen):
    @classmethod
    def jvmdoc(cls):
        return dummydoc

    def execute(self):
        self.generate_doc(lambda t: True, create_dummydoc_command)


def create_dummydoc_command(classpath, gendir, *targets):
    # here we need to test that we get the expected classpath
    pass


class JvmdocGenTest(JvmTaskTestBase):
    """Test some base functionality in JvmdocGen."""
    @classmethod
    def task_type(cls):
        return DummyJvmdocGen
Exemplo n.º 4
0
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import (nested_scopes, generators, division, absolute_import,
                        with_statement, print_function, unicode_literals)

from pants.backend.jvm.tasks.jvmdoc_gen import Jvmdoc, JvmdocGen

javadoc = Jvmdoc(tool_name='javadoc', product_type='javadoc')


def is_java(target):
    return target.has_sources('.java')


class JavadocGen(JvmdocGen):
    @classmethod
    def jvmdoc(cls):
        return javadoc

    def execute(self):
        self.generate_doc(is_java, self.create_javadoc_command)

    def create_javadoc_command(self, classpath, gendir, *targets):
        sources = []
        for target in targets:
            sources.extend(target.sources_relative_to_buildroot())

        if not sources:
            return None
Exemplo n.º 5
0
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
                        print_function, unicode_literals)

from pants.backend.jvm.tasks.jvmdoc_gen import Jvmdoc, JvmdocGen


scaladoc = Jvmdoc(tool_name='scaladoc', product_type='scaladoc')


def is_scala(target):
  return target.has_sources('.scala')


class ScaladocGen(JvmdocGen):
  @classmethod
  def jvmdoc(cls):
    return scaladoc

  def execute(self):
    self.generate_doc(lambda t: t.is_scala, create_scaladoc_command)


def create_scaladoc_command(classpath, gendir, *targets):
  sources = []
  for target in targets:
    sources.extend(target.sources_relative_to_buildroot())
    # TODO(Tejal Desai): pantsbuild/pants/65: Remove java_sources attribute for ScalaLibrary
Exemplo n.º 6
0
 def jvmdoc(cls):
     return Jvmdoc(tool_name="javadoc", product_type="javadoc")