Search in sources :

Example 1 with ExportedTaskNode

use of org.gradle.internal.build.ExportedTaskNode in project gradle by gradle.

the class DefaultBuildController method finalizeWorkGraph.

@Override
public void finalizeWorkGraph() {
    assertInState(State.DiscoveringTasks);
    if (!queuedForExecution.isEmpty()) {
        throw new IllegalStateException("Queued tasks have not been scheduled.");
    }
    // TODO - This check should live in the task execution plan, so that it can reuse checks that have already been performed and
    // also check for cycles across all nodes
    Set<TaskInternal> visited = new HashSet<>();
    Set<TaskInternal> visiting = new HashSet<>();
    for (ExportedTaskNode node : scheduled) {
        checkForCyclesFor(node.getTask(), visited, visiting);
    }
    workGraph.finalizeGraph();
    state = State.ReadyToRun;
}
Also used : ExportedTaskNode(org.gradle.internal.build.ExportedTaskNode) TaskInternal(org.gradle.api.internal.TaskInternal) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet)

Example 2 with ExportedTaskNode

use of org.gradle.internal.build.ExportedTaskNode in project gradle by gradle.

the class DefaultIncludedBuildTaskGraph method locateTask.

@Override
public IncludedBuildTaskResource locateTask(TaskIdentifier taskIdentifier) {
    return withState(workGraph -> {
        BuildState build = buildRegistry.getBuild(taskIdentifier.getBuildIdentifier());
        ExportedTaskNode taskNode = build.getWorkGraph().locateTask(taskIdentifier);
        return new TaskBackedResource(workGraph, build, taskNode);
    });
}
Also used : ExportedTaskNode(org.gradle.internal.build.ExportedTaskNode) BuildState(org.gradle.internal.build.BuildState)

Aggregations

ExportedTaskNode (org.gradle.internal.build.ExportedTaskNode)2 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 TaskInternal (org.gradle.api.internal.TaskInternal)1 BuildState (org.gradle.internal.build.BuildState)1