Search in sources :

Example 1 with Completion

use of org.gradle.internal.operations.BuildOperationWorkerRegistry.Completion in project gradle by gradle.

the class WorkerDaemonClient method execute.

@Override
public <T extends WorkSpec> DefaultWorkResult execute(final WorkerAction<T> action, final T spec, Operation parentWorkerOperation, BuildOperationExecutor.Operation parentBuildOperation) {
    Completion workerLease = parentWorkerOperation.operationStart();
    BuildOperationDetails buildOperation = BuildOperationDetails.displayName(action.getDisplayName()).parent(parentBuildOperation).build();
    try {
        return buildOperationExecutor.run(buildOperation, new Transformer<DefaultWorkResult, BuildOperationContext>() {

            @Override
            public DefaultWorkResult transform(BuildOperationContext buildOperationContext) {
                uses++;
                return workerDaemonProcess.execute(action, spec);
            }
        });
    } finally {
        workerLease.operationFinish();
    }
}
Also used : BuildOperationDetails(org.gradle.internal.progress.BuildOperationDetails) BuildOperationContext(org.gradle.internal.operations.BuildOperationContext) Completion(org.gradle.internal.operations.BuildOperationWorkerRegistry.Completion)

Aggregations

BuildOperationContext (org.gradle.internal.operations.BuildOperationContext)1 Completion (org.gradle.internal.operations.BuildOperationWorkerRegistry.Completion)1 BuildOperationDetails (org.gradle.internal.progress.BuildOperationDetails)1