use of org.gradle.api.internal.tasks.execution.DefaultTaskExecutionContext in project gradle by gradle.
the class AbstractTask method execute.
@Override
public final void execute() {
DeprecationLogger.nagUserOfDiscontinuedMethod("TaskInternal.execute()", getReuseTaskLogicAdvice());
TaskExecuter executer = DeprecationLogger.whileDisabled(new Factory<TaskExecuter>() {
@Override
public TaskExecuter create() {
return getExecuter();
}
});
executer.execute(this, state, new DefaultTaskExecutionContext());
state.rethrowFailure();
}
use of org.gradle.api.internal.tasks.execution.DefaultTaskExecutionContext in project gradle by gradle.
the class LocalTaskNodeExecutor method execute.
@Override
public boolean execute(Node node, NodeExecutionContext context) {
if (node instanceof LocalTaskNode) {
LocalTaskNode localTaskNode = (LocalTaskNode) node;
TaskInternal task = localTaskNode.getTask();
TaskStateInternal state = task.getState();
if (state.getExecuted()) {
// This should move earlier in task scheduling, so that a worker thread does not even bother trying to run this task
return true;
}
ExecutionNodeAccessHierarchies.InputNodeAccessHierarchy inputHierarchy = context.getService(ExecutionNodeAccessHierarchies.InputNodeAccessHierarchy.class);
TaskExecutionContext ctx = new DefaultTaskExecutionContext(localTaskNode, localTaskNode.getTaskProperties(), localTaskNode.getValidationContext(), (historyMaintained, typeValidationContext) -> detectMissingDependencies(localTaskNode, historyMaintained, inputHierarchy, typeValidationContext));
TaskExecuter taskExecuter = context.getService(TaskExecuter.class);
taskExecuter.execute(task, state, ctx);
localTaskNode.getPostAction().execute(task);
return true;
} else {
return false;
}
}
Aggregations