public class TargetSpecResolver extends Object implements AutoCloseable
TargetNodeSpec
.Modifier and Type | Class and Description |
---|---|
static interface |
TargetSpecResolver.FlavorEnhancer
Allows to change flavors of some targets while performing the resolution.
|
static interface |
TargetSpecResolver.TargetNodeFilterForSpecResolver
Performs filtering of target nodes using a given
TargetNodeSpec . |
public static TargetSpecResolver createWithFileSystemCrawler(BuckEventBus eventBus, DepsAwareExecutor<? super ComputeResult,?> executor, CellProvider cellProvider, com.google.common.cache.LoadingCache<Path,DirectoryListCache> dirListCachePerRoot, com.google.common.cache.LoadingCache<Path,FileTreeCache> fileTreeCachePerRoot)
instance
using BuildTargetPatternToBuildPackagePathComputation
eventBus
- Event bus to send performance events toexecutor
- The executor for the GraphTransformationEngine
cellProvider
- Provider to get a cell by path; this is a workaround for the state that
cell itself is not really hashable so we use cell path instead as a key for appropriate
cachesdirListCachePerRoot
- Global cache that stores a mapping of cell root path to a cache of
all directory structures under that cellfileTreeCachePerRoot
- Global cache that stores a mapping of cell root path to a cache of
all file tree structures under that cellpublic static TargetSpecResolver createWithWatchmanCrawler(BuckEventBus eventBus, Watchman watchman, DepsAwareExecutor<? super ComputeResult,?> executor, CellProvider cellProvider)
instance
using WatchmanBuildPackageComputation
eventBus
- Event bus to send performance events toexecutor
- The executor for the GraphTransformationEngine
cellProvider
- Provider to get a cell by path; this is a workaround for the state that
cell itself is not really hashable so we use cell path instead as a key for appropriate
cachespublic <T extends HasBuildTarget> com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableSet<BuildTarget>> resolveTargetSpecs(Cell rootCell, Iterable<? extends TargetNodeSpec> specs, Optional<TargetConfiguration> targetConfiguration, TargetSpecResolver.FlavorEnhancer flavorEnhancer, PerBuildState perBuildState, TargetSpecResolver.TargetNodeFilterForSpecResolver targetNodeFilter) throws BuildFileParseException, InterruptedException
TargetNodeSpec
.BuildFileParseException
InterruptedException
public void close()
close
in interface AutoCloseable