Exemplo n.º 1
0
  def __init__(self, name, sources,
               provides = None,
               dependencies = None,
               excludes = None,
               resources = None,
               processors = None,
               is_meta = False):

    """name: The name of this module target, addressable via pants via the portion of the spec
        following the colon
    sources: A list of paths containing the java source files this modules jar is compiled from
    provides: An optional Dependency object indicating the The ivy artifact to export
    dependencies: An optional list of Dependency objects specifying the binary (jar) dependencies of
        this module.
    excludes: An optional list of dependency exclude patterns to filter all of this module's
        transitive dependencies against.
    resources: An optional list of paths containing (filterable) text file resources to place in
        this module's jar
    processors: a list of the fully qualified class names of the annotation processors this library
        exports"""

    ExportableJvmLibrary.__init__(self,
                                  name,
                                  sources,
                                  provides,
                                  dependencies,
                                  excludes,
                                  (),
                                  is_meta)

    self.add_label('java')
    self.add_label('apt')
    self.resources = self._resolve_paths(ExportableJvmLibrary.RESOURCES_BASE_DIR, resources)
    self.processors = processors
Exemplo n.º 2
0
    def __init__(self,
                 name,
                 sources,
                 provides=None,
                 dependencies=None,
                 excludes=None,
                 resources=None,
                 processors=None,
                 is_meta=False):
        """name: The name of this module target, addressable via pants via the portion of the spec
        following the colon
    sources: A list of paths containing the java source files this modules jar is compiled from
    provides: An optional Dependency object indicating the The ivy artifact to export
    dependencies: An optional list of Dependency objects specifying the binary (jar) dependencies of
        this module.
    excludes: An optional list of dependency exclude patterns to filter all of this module's
        transitive dependencies against.
    resources: An optional list of paths containing (filterable) text file resources to place in
        this module's jar
    processors: a list of the fully qualified class names of the annotation processors this library
        exports"""

        ExportableJvmLibrary.__init__(self, name, sources, provides,
                                      dependencies, excludes, (), is_meta)

        self.add_label('java')
        self.add_label('apt')
        self.sibling_resources_base = os.path.join(
            os.path.dirname(self.target_base), 'resources')
        self.resources = self._resolve_paths(self.sibling_resources_base,
                                             resources)
        self.processors = processors
Exemplo n.º 3
0
    def __init__(
        self,
        name,
        sources=None,
        provides=None,
        dependencies=None,
        excludes=None,
        resources=None,
        deployjar=False,
        buildflags=None,
        is_meta=False,
    ):

        """name: The name of this module target, addressable via pants via the portion of the spec
        following the colon
    sources: A list of paths containing the java source files this modules jar is compiled from
    provides: An optional Dependency object indicating the The ivy artifact to export
    dependencies: An optional list of Dependency objects specifying the binary (jar) dependencies of
        this module.
    excludes: An optional list of dependency exclude patterns to filter all of this module's
        transitive dependencies against.
    resources: An optional list of paths containing (filterable) text file resources to place in
        this module's jar
    deployjar: An optional boolean that turns on generation of a monolithic deploy jar
    buildflags: A list of additional command line arguments to pass to the underlying build system
        for this target"""

        ExportableJvmLibrary.__init__(self, name, sources, provides, dependencies, excludes, buildflags, is_meta)

        self.sibling_resources_base = os.path.join(os.path.dirname(self.target_base), "resources")
        self.resources = self._resolve_paths(self.sibling_resources_base, resources)
        self.deployjar = deployjar
Exemplo n.º 4
0
  def __init__(self,
               name,
               sources,
               provides = None,
               dependencies = None,
               excludes = None,
               buildflags = None,
               is_meta = False):

    """name: The name of this module target, addressable via pants via the portion of the spec
        following the colon
    sources: A list of paths containing the protobuf source files this modules jar is compiled from
    provides: An optional Dependency object indicating the The ivy artifact to export
    dependencies: An optional list of Dependency objects specifying the binary (jar) dependencies of
        this module.
    excludes: An optional list of dependency exclude patterns to filter all of this module's
        transitive dependencies against.
    buildflags: A list of additional command line arguments to pass to the underlying build system
        for this target"""

    ExportableJvmLibrary.__init__(self,
                                  name,
                                  sources,
                                  provides,
                                  dependencies,
                                  excludes,
                                  buildflags,
                                  is_meta)
    self.add_label('java')
    self.add_label('codegen')
Exemplo n.º 5
0
    def __init__(self,
                 name,
                 sources,
                 provides=None,
                 dependencies=None,
                 excludes=None,
                 compiler='antlr3'):
        """name: The name of this module target, addressable via pants via the portion of the spec
        following the colon
    sources: A list of paths containing the Antlr source files this module's jar is compiled from
    provides: An optional Dependency object indicating the The ivy artifact to export
    dependencies: An optional list of Dependency objects specifying the binary (jar) dependencies of
        this module.
    excludes: An optional list of dependency exclude patterns to filter all of this module's
        transitive dependencies against.
    compiler: The name of the compiler used to compile the ANTLR files.
        Currently only supports 'antlr3' and 'antlr4'"""

        ExportableJvmLibrary.__init__(self, name, sources, provides,
                                      dependencies, excludes)
        self.add_labels('codegen')

        if compiler not in ['antlr3', 'antlr4']:
            raise ValueError(
                "Illegal value for 'compiler': {}".format(compiler))
        self.compiler = compiler
Exemplo n.º 6
0
  def __init__(self,
               name,
               sources,
               provides = None,
               dependencies = None,
               excludes = None,
               compiler = 'antlr3'):

    """name: The name of this module target, addressable via pants via the portion of the spec
        following the colon
    sources: A list of paths containing the Antlr source files this module's jar is compiled from
    provides: An optional Dependency object indicating the The ivy artifact to export
    dependencies: An optional list of Dependency objects specifying the binary (jar) dependencies of
        this module.
    excludes: An optional list of dependency exclude patterns to filter all of this module's
        transitive dependencies against.
    compiler: The name of the compiler used to compile the ANTLR files.
        Currently only supports 'antlr3' and 'antlr4'"""

    ExportableJvmLibrary.__init__(self,
                                  name,
                                  sources,
                                  provides,
                                  dependencies,
                                  excludes)

    self.is_codegen = True

    if compiler not in ['antlr3', 'antlr4']:
        raise ValueError("Illegal value for 'compiler': {}".format(compiler))

    self.compiler = compiler
Exemplo n.º 7
0
    def __init__(self, name, sources, dependencies=None):
        """name: The name of this module target, addressable via pants via the portion of the spec
        following the colon
    sources: A list of paths containing the thriftstore source files this module's jar is compiled from
    dependencies: An optional list of Dependency objects specifying the binary (jar) dependencies of
        this module.
    """

        ExportableJvmLibrary.__init__(self,
                                      name,
                                      sources,
                                      provides=None,
                                      dependencies=dependencies)
        self.add_labels('codegen')
Exemplo n.º 8
0
  def __init__(self, name,
               sources = None,
               java_sources = None,
               provides = None,
               dependencies = None,
               excludes = None,
               resources = None,
               deployjar = False,
               buildflags = None,
               is_meta = False):

    """name: The name of this module target, addressable via pants via the portion of the spec
        following the colon
    sources: A list of paths containing the scala source files this module's jar is compiled from
    java_sources: An optional list of paths containing the java sources this module's jar is in part
        compiled from
    provides: An optional Dependency object indicating the The ivy artifact to export
    dependencies: An optional list of Dependency objects specifying the binary (jar) dependencies of
        this module.
    excludes: An optional list of dependency exclude patterns to filter all of this module's
        transitive dependencies against.
    resources: An optional list of paths containing (filterable) text file resources to place in
        this module's jar
    deployjar: An optional boolean that turns on generation of a monolithic deploy jar
    buildflags: A list of additional command line arguments to pass to the underlying build system
        for this target"""

    ExportableJvmLibrary.__init__(self,
                                  name,
                                  sources,
                                  provides,
                                  dependencies,
                                  excludes,
                                  buildflags,
                                  is_meta)

    self.add_label('scala')
    self.java_sources = java_sources

    base_parent = os.path.dirname(self.target_base)
    self.sibling_resources_base = os.path.join(base_parent, 'resources')
    self.resources = self._resolve_paths(self.sibling_resources_base, resources)

    self.deployjar = deployjar

    # All scala targets implicitly depend on the selected scala runtime.
    for spec in self._config.getlist('scala-compile', 'scaladeps'):
      self.add_injected_dependency(spec)
Exemplo n.º 9
0
  def _create_template_data(self):
    allsources = []
    if self.sources:
      allsources += list(os.path.join(self.target_base, src) for src in self.sources)

    return ExportableJvmLibrary._create_template_data(self).extend(
      allsources = allsources,
    )
Exemplo n.º 10
0
    def _create_template_data(self):
        allsources = []
        if self.sources:
            allsources += list(
                os.path.join(self.target_base, src) for src in self.sources)

        return ExportableJvmLibrary._create_template_data(self).extend(
            allsources=allsources, )
  def __init__(self,
               name,
               sources,
               dependencies = None):

    """name: The name of this module target, addressable via pants via the portion of the spec
        following the colon
    sources: A list of paths containing the thriftstore source files this module's jar is compiled from
    dependencies: An optional list of Dependency objects specifying the binary (jar) dependencies of
        this module.
    """

    ExportableJvmLibrary.__init__(self,
                                  name,
                                  sources,
                                  provides = None,
                                  dependencies = dependencies)
    self.add_label('codegen')
Exemplo n.º 12
0
    def _create_template_data(self):
        allsources = []
        if self.sources:
            allsources += list(os.path.join(self.target_base, source) for source in self.sources)
        if self.resources:
            allsources += list(os.path.join(self.sibling_resources_base, res) for res in self.resources)

        return ExportableJvmLibrary._create_template_data(self).extend(
            resources=self.resources, deploy_jar=self.deployjar, allsources=allsources, processors=[]
        )
Exemplo n.º 13
0
  def _create_template_data(self):
    allsources = []
    if self.sources:
      allsources += list(os.path.join(self.target_base, source) for source in self.sources)
    if self.resources:
      allsources += list(os.path.join(self.sibling_resources_base, res) for res in self.resources)

    return ExportableJvmLibrary._create_template_data(self).extend(
      resources = self.resources,
      deploy_jar = self.deployjar,
      allsources = allsources,
      processors = []
    )
Exemplo n.º 14
0
    def __init__(self,
                 name,
                 sources,
                 provides=None,
                 dependencies=None,
                 excludes=None,
                 buildflags=None,
                 is_meta=False):
        """name: The name of this module target, addressable via pants via the portion of the spec
        following the colon
    sources: A list of paths containing the thrift source files this module's jar is compiled from
    provides: An optional Dependency object indicating the The ivy artifact to export
    dependencies: An optional list of Dependency objects specifying the binary (jar) dependencies of
        this module.
    excludes: An optional list of dependency exclude patterns to filter all of this module's
        transitive dependencies against.
    buildflags: A list of additional command line arguments to pass to the underlying build system
        for this target"""

        ExportableJvmLibrary.__init__(self, name, sources, provides,
                                      dependencies, excludes, buildflags,
                                      is_meta)
        self.is_codegen = True
Exemplo n.º 15
0
  def _create_template_data(self):
    allsources = []
    if self.sources:
      allsources += [ os.path.join(self.target_base, source) for source in self.sources ]
    if self.resources:
      allsources += [ os.path.join(ExportableJvmLibrary.RESOURCES_BASE_DIR, res)
                      for res in self.resources ]

    return ExportableJvmLibrary._create_template_data(self).extend(
      resources = self.resources,
      deploy_jar = False,
      allsources = allsources,
      processors = self.processors
    )
Exemplo n.º 16
0
    def _create_template_data(self):
        allsources = []
        if self.sources:
            allsources += [
                os.path.join(self.target_base, source)
                for source in self.sources
            ]
        if self.resources:
            allsources += [
                os.path.join(ExportableJvmLibrary.RESOURCES_BASE_DIR, res)
                for res in self.resources
            ]

        return ExportableJvmLibrary._create_template_data(self).extend(
            resources=self.resources,
            deploy_jar=False,
            allsources=allsources,
            processors=self.processors)
Exemplo n.º 17
0
 def _as_jar_dependency(self):
     return ExportableJvmLibrary._as_jar_dependency(self).with_sources()
Exemplo n.º 18
0
 def _as_jar_dependency(self):
   return ExportableJvmLibrary._as_jar_dependency(self).with_sources()