public abstract class SourceSet extends Object implements TargetTranslatable<SourceSet>, AddsToRuleKey
Set
of unnamed SourcePath
s or a
Map
of names to SourcePath
s. Commonly used to represent the input
srcs
parameter of rules where source "names" may be important (e.g. to control
layout of C++ headers).Modifier and Type | Class and Description |
---|---|
static class |
SourceSet.Type |
Constructor and Description |
---|
SourceSet() |
Modifier and Type | Method and Description |
---|---|
protected void |
check() |
static SourceSet |
concat(Iterable<SourceSet> elements)
Concatenates elements of the given lists into a single list.
|
abstract Optional<com.google.common.collect.ImmutableMap<String,SourcePath>> |
getNamedSources() |
com.google.common.collect.ImmutableList<SourcePath> |
getPaths() |
abstract SourceSet.Type |
getType() |
abstract Optional<com.google.common.collect.ImmutableSet<SourcePath>> |
getUnnamedSources() |
boolean |
isEmpty() |
static SourceSet |
of(SourceSet.Type type,
Optional<? extends com.google.common.collect.ImmutableSet<SourcePath>> unnamedSources,
Optional<? extends com.google.common.collect.ImmutableMap<String,SourcePath>> namedSources) |
static SourceSet |
ofNamedSources(com.google.common.collect.ImmutableMap<String,SourcePath> namedSources) |
static SourceSet |
ofUnnamedSources(com.google.common.collect.ImmutableSet<SourcePath> unnamedSources) |
com.google.common.collect.ImmutableMap<String,SourcePath> |
toNameMap(BuildTarget buildTarget,
SourcePathResolverAdapter pathResolver,
String parameterName) |
com.google.common.collect.ImmutableMap<String,SourcePath> |
toNameMap(BuildTarget buildTarget,
SourcePathResolverAdapter pathResolver,
String parameterName,
java.util.function.Predicate<SourcePath> filter,
java.util.function.Function<SourcePath,SourcePath> transform) |
Optional<SourceSet> |
translateTargets(CellNameResolver cellPathResolver,
BaseName targetBaseName,
TargetNodeTranslator translator) |
public static final SourceSet EMPTY
public abstract SourceSet.Type getType()
public abstract Optional<com.google.common.collect.ImmutableSet<SourcePath>> getUnnamedSources()
public abstract Optional<com.google.common.collect.ImmutableMap<String,SourcePath>> getNamedSources()
@Value.Check protected void check()
public static SourceSet ofUnnamedSources(com.google.common.collect.ImmutableSet<SourcePath> unnamedSources)
public static SourceSet ofNamedSources(com.google.common.collect.ImmutableMap<String,SourcePath> namedSources)
public boolean isEmpty()
public com.google.common.collect.ImmutableMap<String,SourcePath> toNameMap(BuildTarget buildTarget, SourcePathResolverAdapter pathResolver, String parameterName, java.util.function.Predicate<SourcePath> filter, java.util.function.Function<SourcePath,SourcePath> transform)
public com.google.common.collect.ImmutableMap<String,SourcePath> toNameMap(BuildTarget buildTarget, SourcePathResolverAdapter pathResolver, String parameterName)
public com.google.common.collect.ImmutableList<SourcePath> getPaths()
public Optional<SourceSet> translateTargets(CellNameResolver cellPathResolver, BaseName targetBaseName, TargetNodeTranslator translator)
translateTargets
in interface TargetTranslatable<SourceSet>
public static SourceSet concat(Iterable<SourceSet> elements)
public static SourceSet of(SourceSet.Type type, Optional<? extends com.google.common.collect.ImmutableSet<SourcePath>> unnamedSources, Optional<? extends com.google.common.collect.ImmutableMap<String,SourcePath>> namedSources)