Search in sources :

Example 1 with DefaultContinuousExecutionGate

use of org.gradle.initialization.DefaultContinuousExecutionGate in project gradle by gradle.

the class ContinuousBuildActionExecuter method execute.

@Override
public Object execute(BuildAction action, BuildRequestContext requestContext, final BuildActionParameters actionParameters, ServiceRegistry buildSessionScopeServices) {
    BuildCancellationToken cancellationToken = requestContext.getCancellationToken();
    if (actionParameters.isContinuous()) {
        SingleMessageLogger.incubatingFeatureUsed("Continuous build");
        DefaultContinuousExecutionGate alwaysOpenExecutionGate = new DefaultContinuousExecutionGate();
        final CancellableOperationManager cancellableOperationManager = createCancellableOperationManager(actionParameters, cancellationToken);
        return executeMultipleBuilds(action, requestContext, actionParameters, buildSessionScopeServices, cancellableOperationManager, alwaysOpenExecutionGate);
    } else {
        try {
            return delegate.execute(action, requestContext, actionParameters, buildSessionScopeServices);
        } finally {
            final CancellableOperationManager cancellableOperationManager = createCancellableOperationManager(actionParameters, cancellationToken);
            waitForDeployments(action, requestContext, actionParameters, buildSessionScopeServices, cancellableOperationManager);
        }
    }
}
Also used : DefaultCancellableOperationManager(org.gradle.execution.DefaultCancellableOperationManager) PassThruCancellableOperationManager(org.gradle.execution.PassThruCancellableOperationManager) CancellableOperationManager(org.gradle.execution.CancellableOperationManager) DefaultContinuousExecutionGate(org.gradle.initialization.DefaultContinuousExecutionGate) BuildCancellationToken(org.gradle.initialization.BuildCancellationToken)

Aggregations

CancellableOperationManager (org.gradle.execution.CancellableOperationManager)1 DefaultCancellableOperationManager (org.gradle.execution.DefaultCancellableOperationManager)1 PassThruCancellableOperationManager (org.gradle.execution.PassThruCancellableOperationManager)1 BuildCancellationToken (org.gradle.initialization.BuildCancellationToken)1 DefaultContinuousExecutionGate (org.gradle.initialization.DefaultContinuousExecutionGate)1