public class DefaultActionRegistry extends BuildArtifactFactory implements ActionRegistry
target
Constructor and Description |
---|
DefaultActionRegistry(BuildTarget buildTarget,
ActionAnalysisDataRegistry actionRegistry,
ProjectFilesystem filesystem) |
Modifier and Type | Method and Description |
---|---|
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
ActionRegistry.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()
Validates that all
DeclaredArtifact s have been bound to an ActionAnalysisDataKey |
bindtoBuildArtifact, createDeclaredArtifact, createDeclaredArtifact
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
declareArtifact
public DefaultActionRegistry(BuildTarget buildTarget, ActionAnalysisDataRegistry actionRegistry, ProjectFilesystem filesystem)
buildTarget
- the BuildTarget
for which all of the Action
s created are foractionRegistry
- the ActionAnalysisDataRegistry
that all actions created are
registered tofilesystem
- the ProjectFilesystem
to use for generating pathspublic Artifact declareArtifact(String output, com.google.devtools.build.lib.events.Location location) throws ArtifactDeclarationException
ActionRegistry
ActionRegistry.declareArtifact(Path, Location)
, but validates that the
string is a valid pathdeclareArtifact
in interface ActionRegistry
output
- 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 invalidpublic Artifact declareArtifact(Path output, com.google.devtools.build.lib.events.Location location) throws ArtifactDeclarationException
declareArtifact
in interface ActionRegistry
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 invalidpublic String registerActionAnalysisDataForAction(Action action) throws ActionCreationException
ActionRegistry
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.
registerActionAnalysisDataForAction
in interface ActionRegistry
action
- the Action
to create an ActionWrapperData
for and registers itAction
ActionCreationException
public BuildTarget getOwner()
getOwner
in interface ActionRegistry
BuildTarget
responsible for all the Action
s registered to this
factory.public void verifyAllArtifactsBound()
BuildArtifactFactory
DeclaredArtifact
s have been bound to an ActionAnalysisDataKey
verifyAllArtifactsBound
in interface ActionRegistry
verifyAllArtifactsBound
in class BuildArtifactFactory