use of com.google.devtools.build.lib.skyframe.RecursivePkgValue.RecursivePkgKey in project bazel by bazelbuild.
the class PrepareDepsOfTargetsUnderDirectoryFunction method compute.
@Override
public SkyValue compute(SkyKey skyKey, Environment env) throws InterruptedException {
PrepareDepsOfTargetsUnderDirectoryKey argument = (PrepareDepsOfTargetsUnderDirectoryKey) skyKey.argument();
final FilteringPolicy filteringPolicy = argument.getFilteringPolicy();
RecursivePkgKey recursivePkgKey = argument.getRecursivePkgKey();
ProcessPackageDirectory processPackageDirectory = new ProcessPackageDirectory(directories, new ProcessPackageDirectory.SkyKeyTransformer() {
@Override
public SkyKey makeSkyKey(RepositoryName repository, RootedPath subdirectory, ImmutableSet<PathFragment> excludedSubdirectoriesBeneathSubdirectory) {
return PrepareDepsOfTargetsUnderDirectoryValue.key(repository, subdirectory, excludedSubdirectoriesBeneathSubdirectory, filteringPolicy);
}
});
ProcessPackageDirectoryResult packageExistenceAndSubdirDeps = processPackageDirectory.getPackageExistenceAndSubdirDeps(recursivePkgKey.getRootedPath(), recursivePkgKey.getRepository(), env, recursivePkgKey.getExcludedPaths());
if (env.valuesMissing()) {
return null;
}
Iterable<SkyKey> keysToRequest = packageExistenceAndSubdirDeps.getChildDeps();
if (packageExistenceAndSubdirDeps.packageExists()) {
keysToRequest = Iterables.concat(ImmutableList.of(CollectTargetsInPackageValue.key(PackageIdentifier.create(recursivePkgKey.getRepository(), recursivePkgKey.getRootedPath().getRelativePath()), filteringPolicy)), keysToRequest);
}
env.getValuesOrThrow(keysToRequest, NoSuchPackageException.class);
if (env.valuesMissing()) {
return null;
}
return PrepareDepsOfTargetsUnderDirectoryValue.INSTANCE;
}
Aggregations