public class CxxLibraryDescription extends Object implements DescriptionWithTargetGraph<CxxLibraryDescriptionArg>, ImplicitDepsInferringDescription<CxxLibraryDescription.CommonArg>, ImplicitFlavorsInferringDescription, Flavored, MetadataProvidingDescription<CxxLibraryDescriptionArg>, VersionPropagator<CxxLibraryDescriptionArg>
Modifier and Type | Class and Description |
---|---|
static interface |
CxxLibraryDescription.CommonArg |
static class |
CxxLibraryDescription.MetadataType |
static interface |
CxxLibraryDescription.TransitiveCxxPreprocessorInputFunction
This is a hack to allow fine grained control over how the transitive
CxxPreprocessorInput s are found. |
static class |
CxxLibraryDescription.Type |
Modifier and Type | Field and Description |
---|---|
static FlavorDomain<HeaderMode> |
HEADER_MODE |
static FlavorDomain<HeaderVisibility> |
HEADER_VISIBILITY |
static FlavorDomain<CxxLibraryDescription.Type> |
LIBRARY_TYPE |
static FlavorDomain<CxxLibraryDescription.MetadataType> |
METADATA_TYPE |
Constructor and Description |
---|
CxxLibraryDescription(CxxLibraryImplicitFlavors cxxLibraryImplicitFlavors,
CxxLibraryFlavored cxxLibraryFlavored,
CxxLibraryFactory cxxLibraryFactory,
CxxLibraryMetadataFactory cxxLibraryMetadataFactory) |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableSortedSet<Flavor> |
addImplicitFlavors(com.google.common.collect.ImmutableSortedSet<Flavor> argDefaultFlavors,
TargetConfiguration toolchainTargetConfiguration) |
BuildRule |
createBuildRule(BuildRuleCreationContextWithTargetGraph context,
BuildTarget buildTarget,
BuildRuleParams params,
CxxLibraryDescriptionArg args)
Create a
BuildRule for the given BuildRuleParams . |
<U> Optional<U> |
createMetadata(BuildTarget buildTarget,
ActionGraphBuilder graphBuilder,
CellPathResolver cellRoots,
CxxLibraryDescriptionArg args,
Optional<com.google.common.collect.ImmutableMap<BuildTarget,Version>> selectedVersions,
Class<U> metadataClass) |
void |
findDepsForTargetFromConstructorArgs(BuildTarget buildTarget,
CellNameResolver cellRoots,
CxxLibraryDescription.CommonArg constructorArg,
com.google.common.collect.ImmutableCollection.Builder<BuildTarget> extraDepsBuilder,
com.google.common.collect.ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder) |
Optional<com.google.common.collect.ImmutableSet<FlavorDomain<?>>> |
flavorDomains(TargetConfiguration toolchainTargetConfiguration) |
Class<CxxLibraryDescriptionArg> |
getConstructorArgType()
The type of the constructor argument that is used by this description to create a rule
|
static Optional<Map.Entry<Flavor,CxxLibraryDescription.Type>> |
getLibType(BuildTarget buildTarget) |
boolean |
hasFlavors(com.google.common.collect.ImmutableSet<Flavor> flavors,
TargetConfiguration toolchainTargetConfiguration) |
boolean |
producesCacheableSubgraph()
Whether or not the build rule subgraph produced by this
Description is safe to cache in
IncrementalActionGraphGenerator
for incremental action graph generation. |
static Optional<CxxPreprocessorInput> |
queryMetadataCxxPreprocessorInput(ActionGraphBuilder graphBuilder,
BuildTarget baseTarget,
CxxPlatform platform,
HeaderVisibility visibility)
Convenience function to query the
CxxPreprocessorInput metadata of a target. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConfigurationDeps
public static final FlavorDomain<CxxLibraryDescription.Type> LIBRARY_TYPE
public static final FlavorDomain<CxxLibraryDescription.MetadataType> METADATA_TYPE
public static final FlavorDomain<HeaderVisibility> HEADER_VISIBILITY
public static final FlavorDomain<HeaderMode> HEADER_MODE
public CxxLibraryDescription(CxxLibraryImplicitFlavors cxxLibraryImplicitFlavors, CxxLibraryFlavored cxxLibraryFlavored, CxxLibraryFactory cxxLibraryFactory, CxxLibraryMetadataFactory cxxLibraryMetadataFactory)
public Optional<com.google.common.collect.ImmutableSet<FlavorDomain<?>>> flavorDomains(TargetConfiguration toolchainTargetConfiguration)
flavorDomains
in interface Flavored
public boolean hasFlavors(com.google.common.collect.ImmutableSet<Flavor> flavors, TargetConfiguration toolchainTargetConfiguration)
hasFlavors
in interface Flavored
flavors
- The set of Flavor
s to consider. All must match.BuildRule
of the given Flavor
can be created.public Class<CxxLibraryDescriptionArg> getConstructorArgType()
BaseDescription
getConstructorArgType
in interface BaseDescription<CxxLibraryDescriptionArg>
public BuildRule createBuildRule(BuildRuleCreationContextWithTargetGraph context, BuildTarget buildTarget, BuildRuleParams params, CxxLibraryDescriptionArg args)
DescriptionWithTargetGraph
BuildRule
for the given BuildRuleParams
. Note that the BuildTarget
referred to in the params
contains the Flavor
to create.createBuildRule
in interface DescriptionWithTargetGraph<CxxLibraryDescriptionArg>
args
- A constructor argument, of type as returned by BaseDescription.getConstructorArgType()
.BuildRule
that describes the default flavour of the rule being described.public static Optional<Map.Entry<Flavor,CxxLibraryDescription.Type>> getLibType(BuildTarget buildTarget)
public void findDepsForTargetFromConstructorArgs(BuildTarget buildTarget, CellNameResolver cellRoots, CxxLibraryDescription.CommonArg constructorArg, com.google.common.collect.ImmutableCollection.Builder<BuildTarget> extraDepsBuilder, com.google.common.collect.ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder)
findDepsForTargetFromConstructorArgs
in interface ImplicitDepsInferringDescription<CxxLibraryDescription.CommonArg>
public static Optional<CxxPreprocessorInput> queryMetadataCxxPreprocessorInput(ActionGraphBuilder graphBuilder, BuildTarget baseTarget, CxxPlatform platform, HeaderVisibility visibility)
CxxPreprocessorInput
metadata of a target.
Use this function instead of constructing the BuildTarget manually.
public <U> Optional<U> createMetadata(BuildTarget buildTarget, ActionGraphBuilder graphBuilder, CellPathResolver cellRoots, CxxLibraryDescriptionArg args, Optional<com.google.common.collect.ImmutableMap<BuildTarget,Version>> selectedVersions, Class<U> metadataClass)
createMetadata
in interface MetadataProvidingDescription<CxxLibraryDescriptionArg>
public com.google.common.collect.ImmutableSortedSet<Flavor> addImplicitFlavors(com.google.common.collect.ImmutableSortedSet<Flavor> argDefaultFlavors, TargetConfiguration toolchainTargetConfiguration)
addImplicitFlavors
in interface ImplicitFlavorsInferringDescription
public boolean producesCacheableSubgraph()
DescriptionWithTargetGraph
Description
is safe to cache in
IncrementalActionGraphGenerator
for incremental action graph generation.producesCacheableSubgraph
in interface Description<CxxLibraryDescriptionArg>
producesCacheableSubgraph
in interface DescriptionWithTargetGraph<CxxLibraryDescriptionArg>