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 [])
def __init__(self, name, sources, resources=None, dependencies=None, provides=None, compatibility=None, exclusives=None): TargetWithSources.__init__(self, name, sources=sources, exclusives=exclusives) TargetWithDependencies.__init__(self, name, dependencies=dependencies, exclusives=exclusives) self.add_labels('python') self.resources = self._resolve_paths(resources) if resources else OrderedSet() if provides and not isinstance(provides, PythonArtifact): raise TargetDefinitionException(self, "Target must provide a valid pants setup_py object. Received a '%s' object instead." % provides.__class__.__name__) self.provides = provides self.compatibility = maybe_list(compatibility or ()) for req in self.compatibility: try: PythonIdentity.parse_requirement(req) except ValueError as e: raise TargetDefinitionException(self, str(e))
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
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)
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 = {}