Search in sources :

Example 6 with BuildRequestContext

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

the class ProviderConnection method run.

private Object run(BuildAction action, BuildCancellationToken cancellationToken, ProgressListenerConfiguration progressListenerConfiguration, BuildEventConsumer buildEventConsumer, ProviderOperationParameters providerParameters, Parameters parameters) {
    try {
        BuildActionExecuter<ConnectionOperationParameters, BuildRequestContext> executer = createExecuter(providerParameters, parameters);
        boolean interactive = providerParameters.getStandardInput() != null;
        BuildRequestContext buildRequestContext = new DefaultBuildRequestContext(new DefaultBuildRequestMetaData(providerParameters.getStartTime(), interactive), cancellationToken, buildEventConsumer);
        BuildActionResult result = executer.execute(action, new ConnectionOperationParameters(parameters.daemonParams, providerParameters), buildRequestContext);
        throwFailure(result);
        return payloadSerializer.deserialize(result.getResult());
    } finally {
        progressListenerConfiguration.failsafeWrapper.rethrowErrors();
    }
}
Also used : DefaultBuildRequestContext(org.gradle.initialization.DefaultBuildRequestContext) DefaultBuildRequestMetaData(org.gradle.initialization.DefaultBuildRequestMetaData) BuildActionResult(org.gradle.launcher.exec.BuildActionResult) DefaultBuildRequestContext(org.gradle.initialization.DefaultBuildRequestContext) BuildRequestContext(org.gradle.initialization.BuildRequestContext)

Aggregations

BuildRequestContext (org.gradle.initialization.BuildRequestContext)6 DefaultBuildRequestContext (org.gradle.initialization.DefaultBuildRequestContext)6 LoggingManagerInternal (org.gradle.internal.logging.LoggingManagerInternal)3 BuildActionParameters (org.gradle.launcher.exec.BuildActionParameters)3 BuildActionResult (org.gradle.launcher.exec.BuildActionResult)3 HashMap (java.util.HashMap)2 Map (java.util.Map)2 BuildResult (org.gradle.BuildResult)2 StartParameterInternal (org.gradle.api.internal.StartParameterInternal)2 CommandLineParser (org.gradle.cli.CommandLineParser)2 DefaultBuildRequestMetaData (org.gradle.initialization.DefaultBuildRequestMetaData)2 BuildLayoutFactory (org.gradle.initialization.layout.BuildLayoutFactory)2 ListenerManager (org.gradle.internal.event.ListenerManager)2 BuildAction (org.gradle.internal.invocation.BuildAction)2 Parameters (org.gradle.launcher.cli.Parameters)2 ParametersConverter (org.gradle.launcher.cli.ParametersConverter)2 DefaultBuildActionParameters (org.gradle.launcher.exec.DefaultBuildActionParameters)2 InputStream (java.io.InputStream)1 FileCollectionFactory (org.gradle.api.internal.file.FileCollectionFactory)1 BuildCancellationToken (org.gradle.initialization.BuildCancellationToken)1