public class WatchmanBuildPackageComputation extends Object implements GraphComputation<BuildTargetPatternToBuildPackagePathKey,BuildPackagePaths>
This computation uses Watchman for finding build files. This computation fails if Watchman is unavailable.
This computation has no dependencies on other computations.
See BuildTargetPatternToBuildPackagePathComputation
for an equivalent computation
which does not use Watchman.
Constructor and Description |
---|
WatchmanBuildPackageComputation(String buildFileName,
ProjectFilesystemView filesystemView,
Watchman watchman) |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableSet<? extends ComputeKey<? extends ComputeResult>> |
discoverDeps(BuildTargetPatternToBuildPackagePathKey key,
ComputationEnvironment env)
Compute dependent keys required to compute given key, and a set of dependencies as listed by
GraphComputation.discoverPreliminaryDeps(ComputeKey) . |
com.google.common.collect.ImmutableSet<? extends ComputeKey<? extends ComputeResult>> |
discoverPreliminaryDeps(BuildTargetPatternToBuildPackagePathKey key)
Compute dependent keys required to compute given the current key.
|
ComputationIdentifier<BuildPackagePaths> |
getIdentifier() |
BuildPackagePaths |
transform(BuildTargetPatternToBuildPackagePathKey key,
ComputationEnvironment env)
Perform a transformation identified by key
Key into a final type Result . |
public WatchmanBuildPackageComputation(String buildFileName, ProjectFilesystemView filesystemView, Watchman watchman) throws FileSystemNotWatchedException
buildFileName
- Name of the build file to search for, for example 'BUCK'filesystemView
- Cell to search in. Discovered paths are relative to ProjectFilesystemView.getRootPath()
.FileSystemNotWatchedException
- watchman
does not include a watch for ProjectFilesystemView.getRootPath()
.public ComputationIdentifier<BuildPackagePaths> getIdentifier()
getIdentifier
in interface GraphComputation<BuildTargetPatternToBuildPackagePathKey,BuildPackagePaths>
ComputeKey.getIdentifier()
public BuildPackagePaths transform(BuildTargetPatternToBuildPackagePathKey key, ComputationEnvironment env) throws IOException, InterruptedException, WatchmanQueryTimedOutException
GraphComputation
Key
into a final type Result
. This
transformation should be performed synchronously.transform
in interface GraphComputation<BuildTargetPatternToBuildPackagePathKey,BuildPackagePaths>
key
- The Key of the requested resultenv
- The execution environment containing results of keys from GraphComputation.discoverDeps(ComputeKey, ComputationEnvironment)
and GraphComputation.discoverPreliminaryDeps(ComputeKey)
IOException
InterruptedException
WatchmanQueryTimedOutException
public com.google.common.collect.ImmutableSet<? extends ComputeKey<? extends ComputeResult>> discoverDeps(BuildTargetPatternToBuildPackagePathKey key, ComputationEnvironment env)
GraphComputation
GraphComputation.discoverPreliminaryDeps(ComputeKey)
. The results of those computations will be
available in GraphComputation.transform(ComputeKey, ComputationEnvironment)
as a part of ComputationEnvironment
discoverDeps
in interface GraphComputation<BuildTargetPatternToBuildPackagePathKey,BuildPackagePaths>
key
- the current key to transformenv
- The execution environment containing results of keys from GraphComputation.discoverPreliminaryDeps(ComputeKey)
public com.google.common.collect.ImmutableSet<? extends ComputeKey<? extends ComputeResult>> discoverPreliminaryDeps(BuildTargetPatternToBuildPackagePathKey key)
GraphComputation
GraphComputation.discoverDeps(ComputeKey, ComputationEnvironment)
as
a part of ComputationEnvironment
, and GraphComputation.transform(ComputeKey,
ComputationEnvironment)
discoverPreliminaryDeps
in interface GraphComputation<BuildTargetPatternToBuildPackagePathKey,BuildPackagePaths>
key
- the current key to transformGraphComputation.discoverDeps(ComputeKey, ComputationEnvironment)
and
GraphComputation.transform(ComputeKey, ComputationEnvironment)
of the current key depends on