public class BuildInfoRecorder extends Object
OnDiskBuildInfo
.Constructor and Description |
---|
BuildInfoRecorder(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
BuildInfoStore buildInfoStore,
Clock clock,
BuildId buildId,
com.google.common.collect.ImmutableMap<String,String> environment) |
Modifier and Type | Method and Description |
---|---|
BuildInfoRecorder |
addBuildMetadata(String key,
String value)
Used by the build engine to record metadata describing the build (e.g.
|
void |
addMetadata(String key,
com.google.common.collect.ImmutableList<String> value) |
void |
addMetadata(String key,
String value)
This key/value pair is stored in memory until
writeMetadataToDisk(boolean) is invoked. |
void |
assertOnlyHasKeys(String... keys) |
Optional<String> |
getBuildMetadataFor(String key) |
com.google.common.hash.HashCode |
getOutputHash(FileHashLoader fileHashLoader) |
com.google.common.collect.ImmutableSortedSet<Path> |
getRecordedPaths() |
void |
recordArtifact(Path pathToArtifact) |
void |
updateBuildMetadata() |
void |
writeMetadataToDisk(boolean clearExistingMetadata)
Writes the metadata currently stored in memory to the directory returned by
BuildInfo.getPathToArtifactMetadataDirectory(BuildTarget, ProjectFilesystem) . |
public BuildInfoRecorder(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildInfoStore buildInfoStore, Clock clock, BuildId buildId, com.google.common.collect.ImmutableMap<String,String> environment)
public void writeMetadataToDisk(boolean clearExistingMetadata) throws IOException
BuildInfo.getPathToArtifactMetadataDirectory(BuildTarget, ProjectFilesystem)
.IOException
public void updateBuildMetadata() throws IOException
IOException
public BuildInfoRecorder addBuildMetadata(String key, String value)
public void addMetadata(String key, String value)
writeMetadataToDisk(boolean)
is invoked.public void addMetadata(String key, com.google.common.collect.ImmutableList<String> value)
public com.google.common.collect.ImmutableSortedSet<Path> getRecordedPaths()
public com.google.common.hash.HashCode getOutputHash(FileHashLoader fileHashLoader) throws IOException
IOException
public void recordArtifact(Path pathToArtifact)
pathToArtifact
- Relative path to the project root.public void assertOnlyHasKeys(String... keys)