use of org.gradle.tooling.internal.provider.connection.ProviderOperationParameters in project gradle by gradle.
the class DefaultConnection method getModel.
/**
* This is used by consumers 1.6-rc-1 to 2.0
*/
public BuildResult<?> getModel(ModelIdentifier modelIdentifier, BuildParameters operationParameters) throws UnsupportedOperationException, IllegalStateException {
ProviderOperationParameters providerParameters = validateAndConvert(operationParameters);
Object result = connection.run(modelIdentifier.getName(), new DefaultBuildCancellationToken(), providerParameters);
return new ProviderBuildResult<Object>(result);
}
use of org.gradle.tooling.internal.provider.connection.ProviderOperationParameters in project gradle by gradle.
the class DefaultConnection method run.
/**
* This is used by consumers 2.1-rc-1 and later.
*/
public <T> BuildResult<T> run(InternalBuildAction<T> action, InternalCancellationToken cancellationToken, BuildParameters operationParameters) throws BuildExceptionVersion1, InternalUnsupportedBuildArgumentException, IllegalStateException {
ProviderOperationParameters providerParameters = validateAndConvert(operationParameters);
BuildCancellationToken buildCancellationToken = new InternalCancellationTokenAdapter(cancellationToken);
Object results = connection.run(action, buildCancellationToken, providerParameters);
return new ProviderBuildResult<T>((T) results);
}
use of org.gradle.tooling.internal.provider.connection.ProviderOperationParameters in project gradle by gradle.
the class DefaultConnection method runTests.
/**
* This is used by consumers 2.6-rc-1 and later
*/
public BuildResult<?> runTests(InternalTestExecutionRequest testExecutionRequest, InternalCancellationToken cancellationToken, BuildParameters operationParameters) throws BuildExceptionVersion1, InternalUnsupportedBuildArgumentException, IllegalStateException {
ProviderOperationParameters providerParameters = validateAndConvert(operationParameters);
ProviderInternalTestExecutionRequest testExecutionRequestVersion2 = adapter.adapt(ProviderInternalTestExecutionRequest.class, testExecutionRequest);
BuildCancellationToken buildCancellationToken = new InternalCancellationTokenAdapter(cancellationToken);
Object results = connection.runTests(testExecutionRequestVersion2, buildCancellationToken, providerParameters);
return new ProviderBuildResult<Object>(results);
}
use of org.gradle.tooling.internal.provider.connection.ProviderOperationParameters 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();
}
}
use of org.gradle.tooling.internal.provider.connection.ProviderOperationParameters in project gradle by gradle.
the class ProviderConnection method run.
public Object run(InternalBuildAction<?> clientAction, BuildCancellationToken cancellationToken, ProviderOperationParameters providerParameters) {
List<String> tasks = providerParameters.getTasks();
SerializedPayload serializedAction = payloadSerializer.serialize(clientAction);
Parameters params = initParams(providerParameters);
StartParameter startParameter = new ProviderStartParameterConverter().toStartParameter(providerParameters, params.properties);
ProgressListenerConfiguration listenerConfig = ProgressListenerConfiguration.from(providerParameters);
BuildAction action = new ClientProvidedBuildAction(startParameter, serializedAction, tasks != null, listenerConfig.clientSubscriptions);
return run(action, cancellationToken, listenerConfig, providerParameters, params);
}
Aggregations