use of org.gradle.tooling.internal.consumer.connection.ConsumerConnection in project gradle by gradle.
the class DefaultBuildLauncher method run.
public void run(final ResultHandler<? super Void> handler) {
final ConsumerOperationParameters operationParameters = getConsumerOperationParameters();
connection.run(new ConsumerAction<Void>() {
public ConsumerOperationParameters getParameters() {
return operationParameters;
}
public Void run(ConsumerConnection connection) {
Void sink = connection.run(Void.class, operationParameters);
return sink;
}
}, new ResultHandlerAdapter(handler));
}
use of org.gradle.tooling.internal.consumer.connection.ConsumerConnection in project gradle by gradle.
the class DefaultTestLauncher method run.
public void run(final ResultHandler<? super Void> handler) {
if (operationDescriptors.isEmpty() && internalJvmTestRequests.isEmpty()) {
throw new TestExecutionException("No test declared for execution.");
}
final ConsumerOperationParameters operationParameters = getConsumerOperationParameters();
final TestExecutionRequest testExecutionRequest = new TestExecutionRequest(operationDescriptors, ImmutableList.copyOf(testClassNames), ImmutableSet.copyOf(internalJvmTestRequests));
connection.run(new ConsumerAction<Void>() {
public ConsumerOperationParameters getParameters() {
return operationParameters;
}
public Void run(ConsumerConnection connection) {
connection.runTests(testExecutionRequest, getParameters());
return null;
}
}, new ResultHandlerAdapter(handler));
}
use of org.gradle.tooling.internal.consumer.connection.ConsumerConnection in project gradle by gradle.
the class CachingToolingImplementationLoader method create.
public ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, InternalBuildProgressListener progressListener, ConnectionParameters connectionParameters, BuildCancellationToken cancellationToken) {
ClassPath classpath = distribution.getToolingImplementationClasspath(progressLoggerFactory, progressListener, connectionParameters.getGradleUserHomeDir(), cancellationToken);
ConsumerConnection connection = connections.get(classpath);
if (connection == null) {
connection = loader.create(distribution, progressLoggerFactory, progressListener, connectionParameters, cancellationToken);
connections.put(classpath, connection);
}
return connection;
}
use of org.gradle.tooling.internal.consumer.connection.ConsumerConnection in project gradle by gradle.
the class DefaultBuildActionExecuter method run.
public void run(ResultHandler<? super T> handler) throws IllegalStateException {
final ConsumerOperationParameters operationParameters = getConsumerOperationParameters();
connection.run(new ConsumerAction<T>() {
public ConsumerOperationParameters getParameters() {
return operationParameters;
}
public T run(ConsumerConnection connection) {
T result = connection.run(buildAction, operationParameters);
return result;
}
}, new ResultHandlerAdapter<T>(handler, new ExceptionTransformer(new Transformer<String, Throwable>() {
@Override
public String transform(Throwable throwable) {
return String.format("Could not run build action using %s.", connection.getDisplayName());
}
})));
}
use of org.gradle.tooling.internal.consumer.connection.ConsumerConnection in project gradle by gradle.
the class DefaultModelBuilder method get.
public void get(final ResultHandler<? super T> handler) throws IllegalStateException {
final ConsumerOperationParameters operationParameters = getConsumerOperationParameters();
connection.run(new ConsumerAction<T>() {
public ConsumerOperationParameters getParameters() {
return operationParameters;
}
public T run(ConsumerConnection connection) {
T model = connection.run(modelType, operationParameters);
return model;
}
}, new ResultHandlerAdapter<T>(handler));
}
Aggregations