Search in sources :

Example 1 with ResolveTaskOutputCachingStateExecuter

use of org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter in project gradle by gradle.

the class TaskExecutionServices method createTaskExecuter.

TaskExecuter createTaskExecuter(TaskArtifactStateRepository repository, TaskOutputPacker packer, BuildCacheService buildCacheService, StartParameter startParameter, ListenerManager listenerManager, GradleInternal gradle, TaskOutputOriginFactory taskOutputOriginFactory, BuildOperationExecutor buildOperationExecutor, AsyncWorkTracker asyncWorkTracker) {
    // TODO - need a more comprehensible way to only collect inputs for the outer build
    //      - we are trying to ignore buildSrc here, but also avoid weirdness with use of GradleBuild tasks
    boolean isOuterBuild = gradle.getParent() == null;
    TaskInputsListener taskInputsListener = isOuterBuild ? listenerManager.getBroadcaster(TaskInputsListener.class) : TaskInputsListener.NOOP;
    boolean taskOutputCacheEnabled = startParameter.isBuildCacheEnabled();
    TaskOutputsGenerationListener taskOutputsGenerationListener = listenerManager.getBroadcaster(TaskOutputsGenerationListener.class);
    TaskExecuter executer = new ExecuteActionsTaskExecuter(taskOutputsGenerationListener, listenerManager.getBroadcaster(TaskActionListener.class), buildOperationExecutor, asyncWorkTracker);
    boolean verifyInputsEnabled = Boolean.getBoolean("org.gradle.tasks.verifyinputs");
    if (verifyInputsEnabled) {
        executer = new VerifyNoInputChangesTaskExecuter(repository, executer);
    }
    if (taskOutputCacheEnabled) {
        executer = new SkipCachedTaskExecuter(taskOutputOriginFactory, buildCacheService, packer, taskOutputsGenerationListener, executer);
    }
    executer = new SkipUpToDateTaskExecuter(executer);
    if (verifyInputsEnabled || taskOutputCacheEnabled) {
        executer = new ResolveBuildCacheKeyExecuter(listenerManager.getBroadcaster(TaskOutputCachingListener.class), executer);
    }
    executer = new ValidatingTaskExecuter(executer);
    executer = new SkipEmptySourceFilesTaskExecuter(taskInputsListener, executer);
    executer = new ResolveTaskArtifactStateTaskExecuter(repository, executer);
    executer = new SkipTaskWithNoActionsExecuter(executer);
    executer = new SkipOnlyIfTaskExecuter(executer);
    if (taskOutputCacheEnabled) {
        executer = new ResolveTaskOutputCachingStateExecuter(executer);
    }
    executer = new ExecuteAtMostOnceTaskExecuter(executer);
    executer = new CatchExceptionTaskExecuter(executer);
    return executer;
}
Also used : CatchExceptionTaskExecuter(org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter) SkipCachedTaskExecuter(org.gradle.api.internal.tasks.execution.SkipCachedTaskExecuter) SkipOnlyIfTaskExecuter(org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter) SkipUpToDateTaskExecuter(org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter) ValidatingTaskExecuter(org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter) VerifyNoInputChangesTaskExecuter(org.gradle.api.internal.tasks.execution.VerifyNoInputChangesTaskExecuter) CatchExceptionTaskExecuter(org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter) SkipEmptySourceFilesTaskExecuter(org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter) TaskExecuter(org.gradle.api.internal.tasks.TaskExecuter) ResolveTaskArtifactStateTaskExecuter(org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter) ExecuteActionsTaskExecuter(org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter) ExecuteAtMostOnceTaskExecuter(org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter) SkipCachedTaskExecuter(org.gradle.api.internal.tasks.execution.SkipCachedTaskExecuter) TaskOutputsGenerationListener(org.gradle.api.internal.tasks.execution.TaskOutputsGenerationListener) ResolveTaskArtifactStateTaskExecuter(org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter) ResolveBuildCacheKeyExecuter(org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter) ExecuteAtMostOnceTaskExecuter(org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter) SkipUpToDateTaskExecuter(org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter) ExecuteActionsTaskExecuter(org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter) SkipEmptySourceFilesTaskExecuter(org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter) SkipTaskWithNoActionsExecuter(org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter) ResolveTaskOutputCachingStateExecuter(org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter) VerifyNoInputChangesTaskExecuter(org.gradle.api.internal.tasks.execution.VerifyNoInputChangesTaskExecuter) TaskActionListener(org.gradle.api.execution.TaskActionListener) ValidatingTaskExecuter(org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter) SkipOnlyIfTaskExecuter(org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter) TaskInputsListener(org.gradle.api.execution.internal.TaskInputsListener)

Aggregations

TaskActionListener (org.gradle.api.execution.TaskActionListener)1 TaskInputsListener (org.gradle.api.execution.internal.TaskInputsListener)1 TaskExecuter (org.gradle.api.internal.tasks.TaskExecuter)1 CatchExceptionTaskExecuter (org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter)1 ExecuteActionsTaskExecuter (org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter)1 ExecuteAtMostOnceTaskExecuter (org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter)1 ResolveBuildCacheKeyExecuter (org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter)1 ResolveTaskArtifactStateTaskExecuter (org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter)1 ResolveTaskOutputCachingStateExecuter (org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter)1 SkipCachedTaskExecuter (org.gradle.api.internal.tasks.execution.SkipCachedTaskExecuter)1 SkipEmptySourceFilesTaskExecuter (org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter)1 SkipOnlyIfTaskExecuter (org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter)1 SkipTaskWithNoActionsExecuter (org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter)1 SkipUpToDateTaskExecuter (org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter)1 TaskOutputsGenerationListener (org.gradle.api.internal.tasks.execution.TaskOutputsGenerationListener)1 ValidatingTaskExecuter (org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter)1 VerifyNoInputChangesTaskExecuter (org.gradle.api.internal.tasks.execution.VerifyNoInputChangesTaskExecuter)1