Esempio 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.resources = self._resolve_paths(ExportableJvmLibrary.RESOURCES_BASE_DIR, resources)
    self.processors = processors
Esempio n. 2
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"""
        def get_all_deps():
            all_deps = OrderedSet()
            all_deps.update(Pants('3rdparty:commons-lang').resolve())
            all_deps.update(
                JarDependency(org='org.apache.thrift',
                              name='libthrift',
                              rev='${thrift.library.version}').resolve())
            all_deps.update(Pants('3rdparty:slf4j-api').resolve())
            if dependencies:
                all_deps.update(dependencies)
            return all_deps

        ExportableJvmLibrary.__init__(self, JavaThriftLibrary._SRC_DIR, name,
                                      sources, provides, get_all_deps(),
                                      excludes, buildflags, is_meta)
        self.is_codegen = True
Esempio n. 3
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"""
        def get_all_deps():
            all_deps = set([
                JarDependency(org='com.google.protobuf',
                              name='protobuf-java',
                              rev='${protobuf.library.version}'),
            ])
            if dependencies:
                all_deps.update(dependencies)
            return all_deps

        ExportableJvmLibrary.__init__(self, JavaProtobufLibrary._SRC_DIR, name,
                                      sources, provides, get_all_deps(),
                                      excludes, buildflags, is_meta)
        self.is_codegen = True
Esempio n. 4
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
Esempio n. 5
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
Esempio n. 6
0
  def __init__(self, name, sources,
               target_base = None,
               java_sources = None,
               provides = None,
               dependencies = None,
               excludes = None,
               resources = None,
               binary_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
    binary_resources: An optional list of paths containing binary 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"""

    def get_all_deps():
      all_deps = OrderedSet()
      all_deps.update(Pants('3rdparty:scala-library').resolve())
      if dependencies:
        all_deps.update(dependencies)
      return all_deps

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

    base_parent = os.path.dirname(self.target_base)
    sibling_java_base = os.path.join(base_parent, 'java')
    self.java_sources = self._resolve_paths(sibling_java_base, java_sources)

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

    self.deployjar = deployjar
Esempio n. 7
0
  def _create_template_data(self):
    allsources = []
    if self.sources:
      allsources += list(os.path.join(JavaThriftLibrary._SRC_DIR, src) for src in self.sources)

    return ExportableJvmLibrary._create_template_data(self).extend(
      allsources = allsources,
    )
Esempio n. 8
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,
    )
Esempio n. 9
0
    def _create_template_data(self):
        allsources = []
        if self.sources:
            allsources += list(
                os.path.join(JavaThriftLibrary._SRC_DIR, src)
                for src in self.sources)

        return ExportableJvmLibrary._create_template_data(self).extend(
            allsources=allsources, )
Esempio n. 10
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=[]
        )
Esempio n. 11
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"""

    def get_all_deps():
      all_deps = OrderedSet()
      all_deps.update(Pants('3rdparty:commons-lang').resolve())
      all_deps.update(JarDependency(org = 'org.apache.thrift',
                                    name = 'libthrift',
                                    rev = '${thrift.library.version}').resolve())
      all_deps.update(Pants('3rdparty:slf4j-api').resolve())
      if dependencies:
        all_deps.update(dependencies)
      return all_deps

    ExportableJvmLibrary.__init__(self,
                                   JavaThriftLibrary._SRC_DIR,
                                   name,
                                   sources,
                                   provides,
                                   get_all_deps(),
                                   excludes,
                                   buildflags,
                                   is_meta)
    self.is_codegen = True
Esempio n. 12
0
  def __init__(self, name, sources,
               target_base = None,
               provides = None,
               dependencies = None,
               excludes = None,
               resources = None,
               binary_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
    binary_resources: An optional list of paths containing binary 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,
                                  target_base,
                                  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.binary_resources = self._resolve_paths(self.sibling_resources_base, binary_resources)
    self.deployjar = deployjar
Esempio n. 13
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"""

    def get_all_deps():
      all_deps = set([
        JarDependency(org = 'com.google.protobuf',
                      name = 'protobuf-java',
                      rev = '${protobuf.library.version}'),
      ])
      if dependencies:
        all_deps.update(dependencies)
      return all_deps

    ExportableJvmLibrary.__init__(self,
                                   JavaProtobufLibrary._SRC_DIR,
                                   name,
                                   sources,
                                   provides,
                                   get_all_deps(),
                                   excludes,
                                   buildflags,
                                   is_meta)
    self.is_codegen = True
Esempio n. 14
0
  def __init__(self, name, sources,
               provides = None,
               dependencies = None,
               excludes = None,
               resources = None,
               binary_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
    binary_resources: An optional list of paths containing binary 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,
                                  AnnotationProcessor._SRC_DIR,
                                  name,
                                  sources,
                                  provides,
                                  dependencies,
                                  excludes,
                                  [],
                                  is_meta)

    self.resources = self._resolve_paths(ExportableJvmLibrary.RESOURCES_BASE_DIR, resources)
    self.binary_resources = self._resolve_paths(ExportableJvmLibrary.RESOURCES_BASE_DIR,
                                                binary_resources)
    self.processors = processors
Esempio 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
    )
Esempio n. 16
0
  def _create_template_data(self):
    allsources = []
    if self.sources:
      allsources += list(os.path.join(JavaLibrary._SRC_DIR, source) for source in self.sources)
    if self.resources:
      allsources += list(os.path.join(ExportableJvmLibrary.RESOURCES_BASE_DIR, res) for res in self.resources)
    if self.binary_resources:
      allsources += list(os.path.join(ExportableJvmLibrary.RESOURCES_BASE_DIR, res) for res in self.binary_resources)

    return ExportableJvmLibrary._create_template_data(self).extend(
      resources = self.resources,
      binary_resources = self.binary_resources,
      deploy_jar = self.deployjar,
      allsources = allsources
    )
Esempio n. 17
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)
    if self.binary_resources:
      allsources += list(os.path.join(self.sibling_resources_base, res)
                         for res in self.binary_resources)

    return ExportableJvmLibrary._create_template_data(self).extend(
      resources = self.resources,
      binary_resources = self.binary_resources,
      deploy_jar = self.deployjar,
      allsources = allsources,
      processors = []
    )
Esempio n. 18
0
  def _create_template_data(self):
    allsources = []
    if self.sources:
      allsources += [ os.path.join(AnnotationProcessor._SRC_DIR, source)
                      for source in self.sources ]
    if self.resources:
      allsources += [ os.path.join(ExportableJvmLibrary.RESOURCES_BASE_DIR, res)
                      for res in self.resources ]
    if self.binary_resources:
      allsources += [ os.path.join(ExportableJvmLibrary.RESOURCES_BASE_DIR, res)
                      for res in self.binary_resources ]

    return ExportableJvmLibrary._create_template_data(self).extend(
      resources = self.resources,
      binary_resources = self.binary_resources,
      deploy_jar = False,
      allsources = allsources,
      processors = self.processors
    )
Esempio n. 19
0
 def _as_jar_dependency(self):
     return ExportableJvmLibrary._as_jar_dependency(self).withSources()
Esempio n. 20
0
 def _as_jar_dependency(self):
   return ExportableJvmLibrary._as_jar_dependency(self).withSources()