public interface ActionRegistry
Action
s, which creates its corresponding ActionWrapperData
.
This helps to hide and enforce the relationship between ActionAnalysisDataKey
, ActionAnalysisData
, Action
, and BuildArtifact
.
There is one registry per BuildTarget
, such that all Action
s registered by
this are considered to be associated with the build target.
Modifier and Type | Method and Description |
---|---|
default Artifact |
declareArtifact(Path output) |
Artifact |
declareArtifact(Path output,
com.google.devtools.build.lib.events.Location location) |
Artifact |
declareArtifact(String output,
com.google.devtools.build.lib.events.Location location)
Simple helper behaves like
declareArtifact(Path, Location) , but validates that the
string is a valid path |
BuildTarget |
getOwner() |
String |
registerActionAnalysisDataForAction(Action action)
Creates the
ActionWrapperData from its Action and registers the ActionWrapperData to the ActionAnalysisDataRegistry . |
void |
verifyAllArtifactsBound()
Verifies that all the
Artifact s declared via declareArtifact(Path) has been
bound with an Action via registerActionAnalysisDataForAction(Action) |
default Artifact declareArtifact(Path output) throws ArtifactDeclarationException
output
- the output Path
relative to the package path for the current rule that
the Action
s are being created forArtifact
for the given pathArtifactDeclarationException
- if the provided output path is invalidArtifact declareArtifact(String output, com.google.devtools.build.lib.events.Location location) throws ArtifactDeclarationException
declareArtifact(Path, Location)
, but validates that the
string is a valid pathoutput
- the output path relative to the package path for hte current rule that the Action
s are being created forlocation
- if provided, the location within the extension file where this artifact was
declaredArtifact
for hte given pathArtifactDeclarationException
- if the provided output path is invalidArtifact declareArtifact(Path output, com.google.devtools.build.lib.events.Location location) throws ArtifactDeclarationException
output
- the output Path
relative to the package path for the current rule that
the Action
s are being created forlocation
- if provided, the location within the extension file where this artifact was
declaredArtifact
for the given pathArtifactDeclarationException
- if the provided output path is invalidString registerActionAnalysisDataForAction(Action action) throws ActionCreationException
ActionWrapperData
from its Action
and registers the ActionWrapperData
to the ActionAnalysisDataRegistry
.
This will materialize the declared Artifact
s and bind them to the action. These
Artifact
s that can be passed via Provider
s to be consumed.
action
- the Action
to create an ActionWrapperData
for and registers itAction
ActionCreationException
BuildTarget getOwner()
BuildTarget
responsible for all the Action
s registered to this
factory.void verifyAllArtifactsBound()
Artifact
s declared via declareArtifact(Path)
has been
bound with an Action
via registerActionAnalysisDataForAction(Action)