Search in sources :

Example 1 with DefaultBuildRequestMetaData

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

the class ProviderConnection method run.

private Object run(BuildAction action, BuildCancellationToken cancellationToken, ProgressListenerConfiguration progressListenerConfiguration, ProviderOperationParameters providerParameters, Parameters parameters) {
    try {
        BuildActionExecuter<ProviderOperationParameters> executer = createExecuter(providerParameters, parameters);
        BuildRequestContext buildRequestContext = new DefaultBuildRequestContext(new DefaultBuildRequestMetaData(providerParameters.getStartTime()), cancellationToken, progressListenerConfiguration.buildEventConsumer);
        BuildActionResult result = (BuildActionResult) executer.execute(action, buildRequestContext, providerParameters, sharedServices);
        if (result.failure != null) {
            throw (RuntimeException) payloadSerializer.deserialize(result.failure);
        }
        return payloadSerializer.deserialize(result.result);
    } finally {
        progressListenerConfiguration.failsafeWrapper.rethrowErrors();
    }
}
Also used : DefaultBuildRequestContext(org.gradle.initialization.DefaultBuildRequestContext) DefaultBuildRequestMetaData(org.gradle.initialization.DefaultBuildRequestMetaData) ProviderOperationParameters(org.gradle.tooling.internal.provider.connection.ProviderOperationParameters) DefaultBuildRequestContext(org.gradle.initialization.DefaultBuildRequestContext) BuildRequestContext(org.gradle.initialization.BuildRequestContext)

Aggregations

BuildRequestContext (org.gradle.initialization.BuildRequestContext)1 DefaultBuildRequestContext (org.gradle.initialization.DefaultBuildRequestContext)1 DefaultBuildRequestMetaData (org.gradle.initialization.DefaultBuildRequestMetaData)1 ProviderOperationParameters (org.gradle.tooling.internal.provider.connection.ProviderOperationParameters)1