Search in sources :

Example 1 with DefaultParallelismConfiguration

use of org.gradle.internal.concurrent.DefaultParallelismConfiguration in project gradle by gradle.

the class ParallelismConfigurationBuildActionExecuter method execute.

@Override
public Object execute(BuildAction action, BuildRequestContext requestContext, BuildActionParameters actionParameters, ServiceRegistry contextServices) {
    StartParameter startParameter = action.getStartParameter();
    parallelismConfigurationManager.setParallelismConfiguration(new DefaultParallelismConfiguration(startParameter.isParallelProjectExecutionEnabled(), startParameter.getMaxWorkerCount()));
    try {
        return delegate.execute(action, requestContext, actionParameters, contextServices);
    } finally {
        parallelismConfigurationManager.setParallelismConfiguration(DefaultParallelismConfiguration.DEFAULT);
    }
}
Also used : DefaultParallelismConfiguration(org.gradle.internal.concurrent.DefaultParallelismConfiguration) StartParameter(org.gradle.StartParameter)

Aggregations

StartParameter (org.gradle.StartParameter)1 DefaultParallelismConfiguration (org.gradle.internal.concurrent.DefaultParallelismConfiguration)1