Package com.facebook.buck.core.artifact
Class BuildArtifactFactory
- java.lang.Object
-
- com.facebook.buck.core.artifact.BuildArtifactFactory
-
- Direct Known Subclasses:
DefaultActionRegistry
public class BuildArtifactFactory extends Object
Factory for managing and creating the variousArtifact
s for a specificBuildTarget
. All of the artifacts created by this instance of the factory will be rooted at the package path as generated byBuildPaths
.
-
-
Field Summary
Fields Modifier and Type Field Description protected BuildTarget
target
-
Constructor Summary
Constructors Modifier Constructor Description protected
BuildArtifactFactory(BuildTarget target, ProjectFilesystem filesystem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BuildArtifact
bindtoBuildArtifact(ActionAnalysisDataKey key, Artifact artifact)
protected com.facebook.buck.core.artifact.DeclaredArtifact
createDeclaredArtifact(String output, com.google.devtools.build.lib.events.Location location)
Simple wrapper that also validates that a raw string is indeed a valid pathprotected com.facebook.buck.core.artifact.DeclaredArtifact
createDeclaredArtifact(Path output, com.google.devtools.build.lib.events.Location location)
protected void
verifyAllArtifactsBound()
Validates that allDeclaredArtifact
s have been bound to anActionAnalysisDataKey
-
-
-
Field Detail
-
target
protected final BuildTarget target
-
-
Constructor Detail
-
BuildArtifactFactory
protected BuildArtifactFactory(BuildTarget target, ProjectFilesystem filesystem)
-
-
Method Detail
-
createDeclaredArtifact
protected com.facebook.buck.core.artifact.DeclaredArtifact createDeclaredArtifact(Path output, com.google.devtools.build.lib.events.Location location) throws ArtifactDeclarationException
- Parameters:
output
- the outputPath
relative to the package path for the current rule that theAction
s are being created forlocation
- the location within the extension file where this artifact was declared.Location.BUILTIN
may be used if not applicable.- Returns:
- a
DeclaredArtifact
for the given path - Throws:
ArtifactDeclarationException
- if the provided output path is invalid in some way
-
createDeclaredArtifact
protected com.facebook.buck.core.artifact.DeclaredArtifact createDeclaredArtifact(String output, com.google.devtools.build.lib.events.Location location) throws ArtifactDeclarationException
Simple wrapper that also validates that a raw string is indeed a valid path- Parameters:
output
- the output path relative to the package path for the current rule that theAction
s are being created forlocation
- the location within the extension file where this artifact was declared.Location.BUILTIN
may be used if not applicable.- Returns:
- a
DeclaredArtifact
for the given path - Throws:
ArtifactDeclarationException
- if the provided output path is invalid in some way
-
bindtoBuildArtifact
protected BuildArtifact bindtoBuildArtifact(ActionAnalysisDataKey key, Artifact artifact)
- Parameters:
key
- theActionAnalysisDataKey
corresponding to anAction
to bind the givenArtifact
to.artifact
- theArtifact
to bind- Returns:
- a
BuildArtifact
by binding the action to the given artifact
-
verifyAllArtifactsBound
protected void verifyAllArtifactsBound()
Validates that allDeclaredArtifact
s have been bound to anActionAnalysisDataKey
-
-