Search in sources :

Example 1 with TaskNode

use of org.gradle.execution.plan.TaskNode in project gradle by gradle.

the class DefaultBuildController method visitDependenciesOf.

private void visitDependenciesOf(TaskInternal task, Consumer<TaskInternal> consumer) {
    TaskNodeFactory taskNodeFactory = ((GradleInternal) task.getProject().getGradle()).getServices().get(TaskNodeFactory.class);
    TaskNode node = taskNodeFactory.getOrCreateNode(task);
    for (Node dependency : node.getAllSuccessors()) {
        if (dependency instanceof TaskNode) {
            consumer.accept(((TaskNode) dependency).getTask());
        }
    }
}
Also used : TaskNode(org.gradle.execution.plan.TaskNode) ExportedTaskNode(org.gradle.internal.build.ExportedTaskNode) TaskNodeFactory(org.gradle.execution.plan.TaskNodeFactory) TaskNode(org.gradle.execution.plan.TaskNode) Node(org.gradle.execution.plan.Node) ExportedTaskNode(org.gradle.internal.build.ExportedTaskNode)

Example 2 with TaskNode

use of org.gradle.execution.plan.TaskNode in project gradle by gradle.

the class DefaultTaskExecutionGraph method getDependencies.

@Override
public Set<Task> getDependencies(Task task) {
    Node node = executionPlan.getNode(task);
    ImmutableSet.Builder<Task> builder = ImmutableSet.builder();
    for (Node dependencyNode : node.getDependencySuccessors()) {
        if (dependencyNode instanceof TaskNode) {
            builder.add(((TaskNode) dependencyNode).getTask());
        }
    }
    return builder.build();
}
Also used : Task(org.gradle.api.Task) TaskNode(org.gradle.execution.plan.TaskNode) ImmutableSet(com.google.common.collect.ImmutableSet) TaskNode(org.gradle.execution.plan.TaskNode) Node(org.gradle.execution.plan.Node)

Aggregations

Node (org.gradle.execution.plan.Node)2 TaskNode (org.gradle.execution.plan.TaskNode)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 Task (org.gradle.api.Task)1 TaskNodeFactory (org.gradle.execution.plan.TaskNodeFactory)1 ExportedTaskNode (org.gradle.internal.build.ExportedTaskNode)1