Search in sources :

Example 1 with TargetGraphAndTargetNodes

use of com.facebook.buck.rules.TargetGraphAndTargetNodes in project buck by facebook.

the class TargetsCommand method computeShowTargetHash.

private void computeShowTargetHash(CommandRunnerParams params, ListeningExecutorService executor, TargetGraphAndTargetNodes targetGraphAndTargetNodes, Map<BuildTarget, ShowOptions.Builder> showRulesResult) throws IOException, InterruptedException, BuildFileParseException, BuildTargetException, CycleException {
    LOG.debug("Getting target hash for %s", targetGraphAndTargetNodes.getTargetNodes());
    TargetGraphAndTargetNodes targetGraphAndNodesWithTests = computeTargetsAndGraphToShowTargetHash(params, executor, targetGraphAndTargetNodes);
    TargetGraph targetGraphWithTests = targetGraphAndNodesWithTests.getTargetGraph();
    FileHashLoader fileHashLoader = createOrGetFileHashLoader(params);
    // Hash each target's rule description and contents of any files.
    ImmutableMap<BuildTarget, HashCode> buildTargetHashes = new TargetGraphHashing(params.getBuckEventBus(), targetGraphWithTests, fileHashLoader, targetGraphAndNodesWithTests.getTargetNodes()).setNumThreads(params.getBuckConfig().getNumThreads()).hashTargetGraph();
    ImmutableMap<BuildTarget, HashCode> finalHashes = rehashWithTestsIfNeeded(targetGraphWithTests, targetGraphAndTargetNodes.getTargetNodes(), buildTargetHashes);
    for (TargetNode<?, ?> targetNode : targetGraphAndTargetNodes.getTargetNodes()) {
        processTargetHash(targetNode.getBuildTarget(), showRulesResult, finalHashes);
    }
}
Also used : TargetGraphAndTargetNodes(com.facebook.buck.rules.TargetGraphAndTargetNodes) FileHashLoader(com.facebook.buck.hashing.FileHashLoader) HashCode(com.google.common.hash.HashCode) BuildTarget(com.facebook.buck.model.BuildTarget) TargetGraphHashing(com.facebook.buck.rules.TargetGraphHashing) TargetGraph(com.facebook.buck.rules.TargetGraph)

Aggregations

FileHashLoader (com.facebook.buck.hashing.FileHashLoader)1 BuildTarget (com.facebook.buck.model.BuildTarget)1 TargetGraph (com.facebook.buck.rules.TargetGraph)1 TargetGraphAndTargetNodes (com.facebook.buck.rules.TargetGraphAndTargetNodes)1 TargetGraphHashing (com.facebook.buck.rules.TargetGraphHashing)1 HashCode (com.google.common.hash.HashCode)1