Exemple #1
0
  def __init__(self,
               name,
               sources,
               dependencies,
               excludes=None,
               configurations=None,
               exclusives=None):
    """
    :param string name: The name of this target, which combined with this
      build file defines the target :class:`pants.base.address.Address`.
    :param sources: A list of filenames representing the source code
      this library is compiled from.
    :type sources: list of strings
    :param dependencies: List of :class:`pants.base.target.Target` instances
      this target depends on.
    :type dependencies: list of targets
    :param excludes: One or more :class:`pants.targets.exclude.Exclude` instances
      to filter this target's transitive dependencies against.
    :param configurations: One or more ivy configurations to resolve for this target.
      This parameter is not intended for general use.
    :type configurations: tuple of strings
    """
    InternalTarget.__init__(self, name, dependencies, exclusives=exclusives)
    TargetWithSources.__init__(self, name, sources)

    self.add_labels('jvm')
    for source in self.sources:
      rel_path = os.path.join(self.target_base, source)
      TargetWithSources.register_source(rel_path, self)
    self.excludes = maybe_list(excludes or [], Exclude)
    self.configurations = maybe_list(configurations or [])
Exemple #2
0
 def __init__(self, name, dependencies=None, num_sources=0, exclusives=None):
   with ParseContext.temp():
     InternalTarget.__init__(self, name, dependencies, exclusives=exclusives)
     TargetWithSources.__init__(self, name, exclusives=exclusives)
   self.num_sources = num_sources
   self.declared_exclusives = defaultdict(set)
   if exclusives is not None:
     for k in exclusives:
       self.declared_exclusives[k] = set([exclusives[k]])
   self.exclusives = None
Exemple #3
0
 def __init__(self, name, sources, exclusives=None):
   """
   :param string name: The name of this target, which combined with this
     build file defines the target :class:`pants.base.address.Address`.
   :param sources: A list of filenames representing the resources
     this library provides.
   """
   # TODO(John Sirois): XXX Review why this is an InternalTarget
   InternalTarget.__init__(self, name, dependencies=None, exclusives=exclusives)
   TargetWithSources.__init__(self, name, sources=sources, exclusives=exclusives)
Exemple #4
0
  def __init__(self, name, source, dependencies=None, resources=None, exclusives=None):
    """
    :param string name: The name of this target, which combined with this
      build file defines the target :class:`pants.base.address.Address`.
    :param source: Source of the page in markdown format.
    :param dependencies: List of :class:`pants.base.target.Target` instances
      this target depends on.
    :type dependencies: list of targets
    :param resources: An optional list of Resources objects.
    """
    InternalTarget.__init__(self, name, dependencies, exclusives=exclusives)
    TargetWithSources.__init__(self, name, sources=[source], exclusives=exclusives)

    self.resources = self._resolve_paths(resources) if resources else []
    self._wikis = {}