use of org.gradle.tooling.internal.protocol.InternalBuildController in project gradle by gradle.
the class InternalBuildActionAdapter method execute.
public T execute(final InternalBuildController buildController) {
ProtocolToModelAdapter protocolToModelAdapter = new ProtocolToModelAdapter(new ConsumerTargetTypeProvider());
BuildController buildControllerAdapter = new BuildControllerAdapter(protocolToModelAdapter, buildController, new ModelMapping(), rootDir);
if (!versionDetails.maySupportModel(BuildInvocations.class)) {
buildControllerAdapter = new BuildInvocationsAdapterController(protocolToModelAdapter, buildControllerAdapter);
}
return action.execute(buildControllerAdapter);
}
use of org.gradle.tooling.internal.protocol.InternalBuildController in project gradle by gradle.
the class ClientProvidedBuildActionRunner method buildResult.
private BuildActionResult buildResult(InternalBuildAction<?> clientAction, GradleInternal gradle, boolean isRunTasks) {
if (!isRunTasks) {
forceFullConfiguration(gradle);
}
InternalBuildController internalBuildController = new DefaultBuildController(gradle);
Object model = null;
Throwable failure = null;
try {
model = clientAction.execute(internalBuildController);
} catch (BuildCancelledException e) {
failure = new InternalBuildCancelledException(e);
} catch (RuntimeException e) {
failure = new InternalBuildActionFailureException(e);
}
PayloadSerializer payloadSerializer = getPayloadSerializer(gradle);
if (failure != null) {
return new BuildActionResult(null, payloadSerializer.serialize(failure));
} else {
return new BuildActionResult(payloadSerializer.serialize(model), null);
}
}
Aggregations